### setup(with:format:) Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtextviewcomponent/setup%28with%3Aformat%3A%29 Setup the view with a text and data format. ```APIDOC ## Instance Method # setup(with:format:) Setup the view with a text and data format. ```swift @MainActor func setup( with text: NSAttributedString, format: RichTextDataFormat ) ``` ``` -------------------------------- ### RichTextViewComponent setup(with:format:) Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtextviewcomponent/setup%28with%3Aformat%3A%29 Setup the view with data and a data format. ```APIDOC ## Default Implementations ### RichTextViewComponent Implementations `func setup(with: Data, format: RichTextDataFormat) throws` Setup the view with data and a data format. ``` -------------------------------- ### Setup Rich Text View with Content and Format Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtextview Configures the RichTextView with an initial NSAttributedString and a RichTextDataFormat. This is a primary setup method. ```swift func setup(with: NSAttributedString, format: RichTextDataFormat) ``` -------------------------------- ### Initialization and Setup Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtextviewcomponent Methods for initializing and setting up the rich text view. ```APIDOC ## setup(with attributedString: NSAttributedString, format: RichTextDataFormat) ### Description Setup the rich text view with an attributed string and a data format. ### Method `setup` ### Parameters - **attributedString** (NSAttributedString) - The attributed string to initialize the view with. - **format** (RichTextDataFormat) - The data format to use. ``` -------------------------------- ### setup(with:format:) Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtextview/setup%28with%3Aformat%3A%29 Sets up the rich text view with a given NSAttributedString and RichTextDataFormat. ```APIDOC ## setup(with:format:) ### Description Setup the rich text view with a rich text and a certain data format. ### Method `@MainActor func setup(with text: NSAttributedString, format: RichTextDataFormat)` ### Parameters #### Parameters - **text** (NSAttributedString) - The text to edit with the text view. - **format** (RichTextDataFormat) - The rich text format to edit. ``` -------------------------------- ### RTKL10n.done Case Example Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/rtkl10n/done Demonstrates the basic case handling for RTKL10n.done. ```swift case done ``` -------------------------------- ### Get Range After Input Cursor Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtextpresenter/rangeafterinputcursor This property returns the `NSRange` that starts immediately after the current input cursor position. It is a read-only property. ```swift var rangeAfterInputCursor: NSRange { get } ``` -------------------------------- ### Get Index of Current Word - RichTextKit Swift Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/swift/string/findindexofcurrentword%28from%3A%29 Use this method to find the starting index of the word that contains the specified text location. This is useful for text manipulation and analysis within RichTextKit. ```swift func findIndexOfCurrentWord(from location: UInt) -> UInt ``` -------------------------------- ### Get Unique URL - RichTextKit Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/foundation/filemanager/uniqueurl%28for%3A%29 Use this function to obtain a unique URL for a given URL. If the URL already exists, a counter will be appended to the filename to ensure uniqueness. For example, `myFile.txt` might become `myFile-1.txt`. ```swift func uniqueUrl(for url: URL) -> URL ``` -------------------------------- ### setup(with:format:) Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtextviewcomponent/setup%28with%3Aformat%3A%29-7wcbm Sets up the RichTextViewComponent with the provided data and data format. This method is marked with @MainActor, indicating it must be called on the main thread. ```APIDOC ## setup(with:format:) ### Description Setup the view with data and a data format. ### Method Signature ```swift @MainActor func setup( with data: Data, format: RichTextDataFormat ) throws ``` ### Parameters #### Path Parameters - **data** (Data) - Required - The data to set up the view with. - **format** (RichTextDataFormat) - Required - The format of the data. ### Throws This method can throw an error if the setup fails. ``` -------------------------------- ### Get toolbarHeight Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtextkeyboardtoolbarstyle/toolbarheight Get the height of the toolbar. This is a Double value. ```swift var toolbarHeight: Double ``` -------------------------------- ### Initializer Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtextkeyboardtoolbar Create a rich text keyboard toolbar. ```APIDOC ### Initializers `init(context: RichTextContext, leadingButtons: (StandardLeadingButtons) -> LeadingButtons, trailingButtons: (StandardTrailingButtons) -> TrailingButtons, formatSheet: (StandardFormatSheet) -> FormatSheet)` Create a rich text keyboard toolbar. ``` -------------------------------- ### init(context:leadingButtons:trailingButtons:formatSheet:) Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtextkeyboardtoolbar/init%28context%3Aleadingbuttons%3Atrailingbuttons%3Aformatsheet%3A%29 Creates a rich text keyboard toolbar with customizable buttons and format sheet. ```APIDOC ## init(context:leadingButtons:trailingButtons:formatSheet:) ### Description Create a rich text keyboard toolbar. ### Parameters #### Parameters - **context** (RichTextContext) - The context to affect. - **leadingButtons** (@ViewBuilder (StandardLeadingButtons) -> LeadingButtons) - The leading buttons to place after the leading actions. - **trailingButtons** (@ViewBuilder (StandardTrailingButtons) -> TrailingButtons) - The trailing buttons to place before the trailing actions. - **formatSheet** (@ViewBuilder (StandardFormatSheet) -> FormatSheet) - The rich text format sheet to use, by default `RichTextFormat.Sheet`. ``` -------------------------------- ### Get Disabled Image Configuration Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtextimageconfiguration/disabled Use this static property to get a disabled image configuration. ```swift static var disabled: RichTextImageConfiguration { get } ``` -------------------------------- ### Get RichTextSuperscriptLevel Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtextview/richtextsuperscriptlevel Get the superscript level of the RichTextView. This property is optional and returns nil if no superscript is applied. ```swift @MainActor var richTextSuperscriptLevel: Int? { get } ``` -------------------------------- ### init(urlResolver:directory:) Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/standardrichtextshareservice/init%28urlresolver%3Adirectory%3A%29 Creates a standard rich text share service with customizable URL resolution and directory settings. ```APIDOC ## init(urlResolver:directory:) ### Description Create a standard rich text share service. ### Method `init` ### Parameters #### Path Parameters - **urlResolver** (RichTextExportUrlResolver) - Required - The type to use to resolve file urls, by default `FileManager.default`. - **directory** (FileManager.SearchPathDirectory) - Required - The directory to save the file in, by default `.cachesDirectory`. ``` -------------------------------- ### Get RichTextViewComponent Frame Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtextviewcomponent/frame Access the frame of the RichTextViewComponent to get its bounding rectangle. This property is available on the main actor. ```swift @MainActor var frame: CGRect { get } ``` -------------------------------- ### Get RichTextColor Representation Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtextview/richtextcolor%28_%3A%29 Use this instance method to get a `ColorRepresentable` for a given `RichTextColor`. This method is marked with `@MainActor`. ```swift @MainActor func richTextColor(_ color: RichTextColor) -> ColorRepresentable? ``` -------------------------------- ### Get Highlighting Style Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtextviewcomponent/highlightingstyle This property is used to get the current highlighting style for text in the RichTextViewComponent. It is a required instance property. ```swift @MainActor var highlightingStyle: RichTextHighlightingStyle { get set } ``` -------------------------------- ### Initializer Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtextaction/buttongroup/init%28context%3Aactions%3Agreedy%3A%29 Creates a rich text action button stack. ```APIDOC ## init(context:actions:greedy:) ### Description Create a rich text action button stack. ### Parameters `context` (RichTextContext) - The context to affect. `actions` ([RichTextAction]) - The actions to list, by default all non-size actions. `greedy` (Bool) - Whether or not the group is horizontally greedy, by default `true`. ``` -------------------------------- ### RTKL10n.indent Case Example Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/rtkl10n/indent Demonstrates a basic case for indentation within RTKL10n. ```swift case indent ``` -------------------------------- ### Get Image Attachment Max Size Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtextview/imageattachmentmaxsize Get the max image attachment size. This property is available on the main actor. ```swift @MainActor var imageAttachmentMaxSize: CGSize { get } ``` -------------------------------- ### init(selection:) Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtextfont/sizepicker/init%28selection%3A%29 Creates a font size picker with a binding to the selected font size. ```APIDOC ## init(selection:) ### Description Create a font size picker. ### Parameters #### Path Parameters - **selection** (Binding) - Required - The selected font size. ``` -------------------------------- ### RTKL10n.more Case Example Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/rtkl10n/more Demonstrates a basic case usage within the RTKL10n.more context. ```swift case more ``` -------------------------------- ### help(_:) Instance Method Signature Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/nsmutableparagraphstylevaluelabel/help%28_%3A%29-1tg0w This is the signature for the `help(_:)` instance method. It takes a `LocalizedStringKey` and returns a `View`. ```swift nonisolated func help(_ textKey: LocalizedStringKey) -> some View ``` -------------------------------- ### Get all system fonts Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtextfont/pickerfont/all Use the static `all` property to get an array of all available system fonts. This property requires no arguments. ```swift static var all: [`Self`] { get } ``` -------------------------------- ### Initializer Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtextaction/buttonstack/init%28context%3Aactions%3Aspacing%3A%29 Creates a rich text action button stack with the specified context, actions, and spacing. ```APIDOC ## init(context:actions:spacing:) ### Description Create a rich text action button stack. ### Parameters `context` (RichTextContext) - The context to affect. `actions` ([RichTextAction]) - The actions to list, by default all non-size actions. `spacing` (Double) - Optional. The spacing to apply to stack items, by default `5`. ``` -------------------------------- ### init(title:icon:formats:formatAction:pdfAction:) Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtextdataformat/menu/init%28title%3Aicon%3Aformats%3Aformataction%3Apdfaction%3A%29 Initializes a new menu with a title, icon, optional formats, a format action, and an optional PDF action. ```APIDOC ## init(title:icon:formats:formatAction:pdfAction:) ### Description Initializes a new menu with a title, icon, optional formats, a format action, and an optional PDF action. ### Parameters #### Initializer Parameters - **title** (String) - The title of the menu. - **icon** (Image) - The icon to display for the menu. - **formats** ([Format] = Format.libraryFormats) - An array of formats to be included in the menu. Defaults to `Format.libraryFormats`. - **formatAction** (@escaping (Format) -> Void) - A closure that is executed when a format is selected. - **pdfAction** (() -> Void)? = nil - An optional closure that is executed when the PDF action is triggered. ``` -------------------------------- ### Get Enabled Rich Text Styles Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/uikit/uifontdescriptor/symbolictraits Get the rich text styles that are enabled in the traits. This property is part of the FontTraitsRepresentable protocol. ```swift extension FontTraitsRepresentable { var enabledRichTextStyles: [RichTextStyle] { !} } ``` -------------------------------- ### Get Color Binding Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtextcontext/binding%28for%3A%29-641eh Use this method to get a `Binding` for a specific `RichTextColor`. This is useful for dynamically updating colors in your UI. ```swift @preconcurrency @MainActor func binding(for color: RichTextColor) -> Binding ``` -------------------------------- ### Initializers Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/swiftuicore/image Create a default icon for the provided key path. ```APIDOC init?(for: KeyPath) ``` -------------------------------- ### Initializer Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtextcontext/init%28%29 Creates a new rich text context instance. ```APIDOC ## Initializer ### Description Create a new rich text context instance. ### Signature ```swift init() ``` ``` -------------------------------- ### Get localizedDescription Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/pdfdataerror/localizeddescription Access the localizedDescription property to get a localized string representation of the error. This property is inherited from the standard Error protocol. ```swift var localizedDescription: String { get } ``` -------------------------------- ### Get RichTextAlignment Property Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtextview/richtextalignment This property is inherited from RichTextViewComponent and is used to get the current text alignment of the RichTextView. It is an optional property and is marked with @MainActor. ```swift @MainActor var richTextAlignment: RichTextAlignment? { get } ``` -------------------------------- ### init(submenus:additionalActions:) Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtextcommand/formatmenu/init%28submenus%3Aadditionalactions%3A%29 Creates a rich text format command menu. You can provide custom submenus and additional actions to tailor the menu's functionality. ```APIDOC ## init(submenus:additionalActions:) ### Description Create a rich text format command menu. ### Parameters #### submenus - `[SubMenu]` - Optional - The submenus to include in the format menu. Defaults to all available cases. #### additionalActions - `[RichTextAction]` - Optional - Additional actions to append to the format menu. ### Method Signature ```swift @MainActor init( submenus: [SubMenu] = SubMenu.allCases, additionalActions: [RichTextAction] = [] ) ``` ``` -------------------------------- ### Initializer Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtextaction/button/init%28action%3Acontext%3Afillvertically%3A%29 Creates a rich text action button with the specified action, context, and vertical fill option. ```APIDOC ## init(action:context:fillVertically:) ### Description Create a rich text action button. ### Parameters `action` The action to trigger. `context` The context to affect. `fillVertically` Whether to fill up vertical space, by default `false`. ``` -------------------------------- ### Get Attachment Size - Swift Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtextview/attachmentsize%28for%3A%29 Use this method to get the size of an image attachment. It requires the image to be representable by `ImageRepresentable` and is marked with `@MainActor`. ```swift @MainActor func attachmentSize(for image: ImageRepresentable) -> CGSize ``` -------------------------------- ### Get Space Character Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/swift/character/space Access the static `space` property to get a `String.Element` representing a space. This is useful for text manipulation and formatting within RichTextKit. ```swift static var space: String.Element { get } ``` -------------------------------- ### help(_:) Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtextcommand/formatmenu/submenu/help%28_%3A%29-624va This instance method is inherited from `View.help(_:)` and is available on iOS, iPadOS, Mac Catalyst, macOS, tvOS, and watchOS. It takes a `Text` object as input and returns a `View`. ```APIDOC ## help(_:) ### Description Inherited from `View.help(_:)`. ### Method Signature ```swift nonisolated func help(_ text: Text) -> some View ``` ### Availability RichTextKitSwiftUICore iOS 14.0+ iPadOS 14.0+ Mac Catalyst 14.0+ macOS 11.0+ tvOS 14.0+ watchOS 7.0+ ``` -------------------------------- ### Get and Set textContentInset Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtextview/textcontentinset Access the textContentInset property to get or set the spacing between the text view edges and its text. This property is available on the main actor. ```swift @MainActor var textContentInset: CGSize { get set } ``` -------------------------------- ### init(_:) Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtextalignment/init%28_%3A%29 Creates a RichTextAlignment instance using a native NSTextAlignment. ```APIDOC ## init(_:) ### Description Create a rich text alignment with a native alignment. ### Signature ```swift init(_ alignment: NSTextAlignment) ``` ### Parameters #### alignment - **alignment** (NSTextAlignment) - The native alignment to use. ``` -------------------------------- ### help(_:) Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtextcolor/picker/help%28_%3A%29-7d5va This instance method is inherited from `View.help(_:)` and is used to provide help text for the picker. It accepts a `LocalizedStringResource` and returns a `View`. ```APIDOC ## help(_:) ### Description Inherited from `View.help(_:)`. ### Method Signature ```swift nonisolated func help(_ textKey: LocalizedStringResource) -> some View ``` ### Parameters * **textKey** (`LocalizedStringResource`) - The localized string resource to display as help text. ### Returns * `some View` - A view that displays the help text. ``` -------------------------------- ### Get or Set RichTextImageAttachment Image Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtextimageattachment/image Use this property to get or set the image for a RichTextImageAttachment. It is marked with `@MainActor` to ensure it's accessed on the main thread. ```swift @MainActor override var image: UIImage? { get set } ``` -------------------------------- ### Initializer Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/standardrichtextexportservice/init%28urlresolver%3Adirectory%3A%29 Creates a new instance of `StandardRichTextExportService`. ```APIDOC ## init(urlResolver:directory:) ### Description Create a standard rich text export service. ### Parameters `urlResolver` The type to use to resolve file urls, by default `FileManager.default`. `directory` The directory to save the file in, by default `.documentDirectory`. ### Code Example ```swift @MainActor init( urlResolver: RichTextExportUrlResolver = FileManager.default, directory: FileManager.SearchPathDirectory = .documentDirectory ) ``` ``` -------------------------------- ### Get Unique URL Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtextexporturlresolver Get a unique URL for a given URL to ensure that a file with the same name does not already exist. This method is required for conforming types. ```swift func uniqueUrl(for: URL) -> URL ``` -------------------------------- ### Get and Set lineSpacing Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtextcontext/linespacing The lineSpacing property can be used to get and set the line spacing for RichTextKit. This property is published, meaning it will trigger UI updates when changed. ```swift @Published var lineSpacing: CGFloat { get set } ``` -------------------------------- ### Initializers Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtextalignment/rawrepresentable-implementations Initializers for RawRepresentable conformance. ```APIDOC ## Initializers ### `init(from: any Decoder) throws` Initializes the type from a decoder. ``` -------------------------------- ### Initializer Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtextstyle/toggle/init%28style%3Avalue%3Afillvertically%3A%29 Creates a rich text style toggle. ```APIDOC ## init(style:value:fillVertically:) ### Description Create a rich text style toggle toggle. ### Parameters - **style** (RichTextStyle) - The style to toggle. - **value** (Binding) - The value to bind to. - **fillVertically** (Bool) - Whether or not fill up vertical space in a non-greedy way, by default `false`. ``` -------------------------------- ### Get or Set Attachment Image Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtextimageattachment Provides access to the attachment's image. This property can be used to get the image currently associated with the attachment or to set a new image. ```swift var image: UIImage? ``` -------------------------------- ### Get Attachment Size Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/foundation/nsattributedstring/attachmentsize%28for%3Amaxsize%3A%29 Use this function to get the attachment size of an image, given a max size. This is useful for determining how an image will fit within layout constraints. ```swift func attachmentSize( for image: ImageRepresentable, maxSize: CGSize ) -> CGSize ``` -------------------------------- ### Initializer Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtextkeyboardtoolbarmenu/init%28content%3Alabel%3A%29 Creates a keyboard toolbar menu with the specified content and label. This initializer is marked with @MainActor, indicating it should be called on the main thread. ```APIDOC ## init(content:label:) ### Description Create a keyboard toolbar menu. ### Parameters - **content** (@ViewBuilder @escaping () -> Content) - Required - A closure that returns the content of the toolbar menu. - **label** (@ViewBuilder @escaping () -> Label) - Required - A closure that returns the label for the toolbar menu. ### Notes This initializer is marked with @MainActor, meaning it must be called on the main thread. ``` -------------------------------- ### Initializer Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtextcolor/picker/init%28type%3Aicon%3Avalue%3Aquickcolors%3A%29 Creates a rich text color picker with customizable type, icon, value binding, and quick color options. ```APIDOC ## init(type:icon:value:quickColors:) ### Description Create a rich text color picker. ### Parameters `type` (RichTextColor) - The type of color to pick. `icon` (Image?) - Optional. The icon to show, if any, by default the `type` icon. `value` (Binding) - The value to bind to. `quickColors` ([Color]) - Optional. Colors to show in the trailing list, by default no colors. ``` -------------------------------- ### Get Attachment Bounds Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/foundation/nsattributedstring/attachmentbounds%28for%3Amaxsize%3A%29 Use this function to get the bounding rectangle of an image attachment, constrained by a maximum size. This is useful for layout calculations within rich text. ```swift func attachmentBounds( for image: ImageRepresentable, maxSize: CGSize ) -> CGRect ``` -------------------------------- ### Get Default Stepper Interval Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/swift/keypath/defaultstepperinterval Get the default stepper interval for the key path. This property is available when `Root` is `NSMutableParagraphStyle`, `Value` conforms to `Hashable`, and `Value` conforms to `Strideable`. ```swift var defaultStepperInterval: Value? { get } ``` -------------------------------- ### help(_:) Method Signature Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/nsmutableparagraphstylevaluelabel/help%28_%3A%29-1987c This is the signature for the help(_:) instance method. It takes a StringProtocol as input and returns some View. Available on iOS 14.0+, iPadOS 14.0+, Mac Catalyst 14.0+, macOS 11.0+, tvOS 14.0+, and watchOS 7.0+. ```swift nonisolated func help(_ text: S) -> some View where S : StringProtocol ``` -------------------------------- ### init(values:) Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtextfont/sizepickerconfig/init%28values%3A%29 Creates a custom font size picker configuration with a specified list of font sizes. If no values are provided, a default list of standard font sizes is used. ```APIDOC ## init(values:) ### Description Create a custom font size picker config. ### Parameters #### Parameters - **values** (Array) - The values to display in the list, by default a standard list. ``` -------------------------------- ### Get Attachment Bounds in RichTextView Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtextview/attachmentbounds%28for%3A%29 Use this method to get the `CGRect` for a given image attachment within the RichTextView. This is useful for layout calculations or custom drawing related to attachments. ```swift @MainActor func attachmentBounds(for image: ImageRepresentable) -> CGRect ``` -------------------------------- ### Initializer Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtextfont/foreachpicker/init%28selection%3A%29 Creates a font picker that allows selection of a font name. ```APIDOC ## init(selection:) ### Description Create a font picker. ### Parameters #### Path Parameters - **selection** (Binding) - Required - The selected font name. ``` -------------------------------- ### Get Writing Direction with Strategy Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/nsmutableparagraphstylevaluelabel/writingdirection%28strategy%3A%29 Use this method to get the writing direction of a view, specifying the strategy for determining it. This is inherited from `View` and available on iOS 26.0+ and other Apple platforms. ```swift nonisolated func writingDirection(strategy: Text.WritingDirectionStrategy) -> some View ``` -------------------------------- ### Initializer Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtextfont/listpicker/init%28selection%3A%29 Creates a font list picker with a specified binding for the selected font name. ```APIDOC ## init(selection:) ### Description Create a font list picker. ### Parameters #### selection - **selection** (Binding) - The selected font name. ``` -------------------------------- ### Get a Safe Range for an NSRange Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/foundation/nsattributedstring/saferange%28for%3Aisattributeoperation%3A%29 Use this function to get a valid `NSRange` that is within the bounds of the attributed string. Set `isAttributeOperation` to `true` to exclude the last character position. ```swift @MainActor func safeRange( for range: NSRange, isAttributeOperation: Bool = false ) -> NSRange ``` -------------------------------- ### Get and Set Standard Rich Text Font Size Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/corefoundation/cgfloat/standardrichtextfontsize This property allows you to get and set the standard font size used for rich text. It is a static property of CGFloat. ```swift static var standardRichTextFontSize: CGFloat { get set } ``` -------------------------------- ### Initializer Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtextcommand/actionbuttongroup/init%28linespacing%3Aadditionalactions%3A%29 Creates a button group with line spacing steppers. ```APIDOC ## init(lineSpacing:additionalActions:) ### Description Create a button group with line spacing steppers. ### Signature ```swift @MainActor init( lineSpacing: Bool, additionalActions: [RichTextAction] = [] ) ``` ### Parameters #### lineSpacing - **lineSpacing** (Bool) - Determines if line spacing steppers should be included. #### additionalActions - **additionalActions** ([RichTextAction]) - An array of additional actions to include in the button group. Defaults to an empty array. ``` -------------------------------- ### Get Default Mutable Paragraph Style Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/uikit/nsmutableparagraphstyle/defaultmutable Use this static property to get a default mutable paragraph style. This is useful for creating new paragraph styles or modifying existing ones. ```swift static var defaultMutable: NSMutableParagraphStyle { get } ``` -------------------------------- ### help(_:) Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtextcommand/formatmenu/submenu/help%28_%3A%29-5rdjg This instance method is inherited from `View.help(_:)` and is used to associate a localized string key with a view, typically for providing help text or tooltips. ```APIDOC ## help(_:) ### Description Inherited from `View.help(_:)`. ### Method Signature ```swift nonisolated func help(_ textKey: LocalizedStringKey) -> some View ``` ### Parameters * **textKey** (`LocalizedStringKey`) - The localized string key for the help text. ``` -------------------------------- ### Get Enabled Rich Text Styles Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtextstyle/styles%28in%3Aattributes%3A%29 Use this static method to get the rich text styles that are enabled for a given set of font traits and attributes. This is useful for determining the current styling of text. ```swift static func styles( in traits: FontTraitsRepresentable?, attributes: RichTextAttributes? ) -> [RichTextStyle] ``` -------------------------------- ### help(_:) Instance Method Signature Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/nsmutableparagraphstylevaluelabel/help%28_%3A%29-9sopi This is the signature for the `help(_:)` instance method. It takes a `Text` object and returns some `View`. This method is available on iOS 14.0+, iPadOS 14.0+, Mac Catalyst 14.0+, macOS 11.0+, tvOS 14.0+, and watchOS 7.0+. ```swift nonisolated func help(_ text: Text) -> some View ``` -------------------------------- ### all Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtextfont/pickerfont/all Get all available system fonts. ```APIDOC ## all ### Description Get all available system fonts. ### Property `static var all: [`Self`] { get }` ``` -------------------------------- ### init(context:) Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtextformat/sheet/init%28context%3A%29 Creates a new instance of RichTextFormat.Sheet, applying the specified context. ```APIDOC ## init(context:) ### Description Create a rich text format sheet. ### Method Signature @MainActor init(context: RichTextContext) ### Parameters #### context - **context** (RichTextContext) - The context to apply changes to. ``` -------------------------------- ### Initializer Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtextfont/sizepickerstack/init%28context%3A%29 Creates a rich text font size picker stack. This initializer requires a `RichTextContext` to be provided. ```APIDOC ## init(context:) ### Description Create a rich text font size picker stack. ### Parameters #### Parameters - **context** (RichTextContext) - The context to affect. ``` -------------------------------- ### paperRect Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/pdfpageconfiguration/paperrect Get the paper rectangle. ```APIDOC ## paperRect ### Description Get the paper rectangle. ### Property `var paperRect: CGRect { get }` ``` -------------------------------- ### printableRect Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/pdfpageconfiguration/printablerect Get the printable rectangle. ```APIDOC ## printableRect ### Description Get the printable rectangle. ### Instance Property `var printableRect: CGRect { get }` ``` -------------------------------- ### init(selection:) Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtextline/spacingpicker/init%28selection%3A%29 Creates a line spacing picker. This initializer is deprecated. ```APIDOC ## init(selection:) ### Description Create a line spacing picker. ### Parameters #### Path Parameters - **selection** (Binding) - Required - The selected font size. ``` -------------------------------- ### rangeAfterInputCursor Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtextpresenter/rangeafterinputcursor Get the range after the input cursor. ```APIDOC ## rangeAfterInputCursor ### Description Get the range after the input cursor. ### Property `rangeAfterInputCursor`: `NSRange` { get } This property returns the character range that immediately follows the current input cursor's position within the rich text content. It is useful for operations that need to manipulate or query text after the cursor, such as text insertion or deletion. ``` -------------------------------- ### help(_:) Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtextkeyboardtoolbarmenu/help%28_%3A%29-8fwvi This instance method is inherited from `View.help(_:)` and is available on `RichTextKeyboardToolbarMenu` for iOS, iPadOS, Mac Catalyst, macOS, tvOS, and watchOS versions 14.0 and later. ```APIDOC ## help(_:) ### Description Provides help text for the view. ### Method `func help(_ textKey: LocalizedStringKey) -> some View` ### Parameters #### Path Parameters - **textKey** (LocalizedStringKey) - Required - The localized string key for the help text. ``` -------------------------------- ### help(_:) Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/nsmutableparagraphstylevaluelabel/help%28_%3A%29-9sopi This instance method is inherited from `View.help(_:)` and is available on iOS 14.0+, iPadOS 14.0+, Mac Catalyst 14.0+, macOS 11.0+, tvOS 14.0+, and watchOS 7.0+. ```APIDOC ## Instance Method # help(_:) Inherited from `View.help(_:)`. RichTextKitSwiftUICoreiOS 14.0+iPadOS 14.0+Mac Catalyst 14.0+macOS 11.0+tvOS 14.0+watchOS 7.0+ ```swift nonisolated func help(_ text: Text) -> some View ``` ``` -------------------------------- ### displayName Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtextfont/pickerfont/displayname Get the font display name. ```APIDOC ## displayName ### Description Get the font display name. ### Property `var displayName: String { get }` ``` -------------------------------- ### init(content:index:moveCursor:) Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtextinsertion/init%28content%3Aindex%3Amovecursor%3A%29 Creates a rich text insertion with specified content, index, and cursor movement behavior. ```APIDOC ## init(content:index:moveCursor:) ### Description Create a rich text insertion. ### Parameters #### Parameters - **content** (T) - The content to insert. - **index** (Int) - The index at where to insert. - **moveCursor** (Bool) - Whether or not to move the cursor to the insertion point. ``` -------------------------------- ### attributedString Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtexteditor/attributedstring Get the string that is managed by the editor. ```APIDOC ## attributedString ### Description Get the string that is managed by the editor. ### Signature ```swift @MainActor var attributedString: NSAttributedString { get } ``` ``` -------------------------------- ### text(for:) Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/rtkl10n/text%28for%3A%29 Get the localized text for a certain `Locale`. ```APIDOC ## text(for:) ### Description Get the localized text for a certain `Locale`. ### Method Signature ```swift func text(for locale: Locale) -> String ``` ### Parameters #### Path Parameters - **locale** (Locale) - Required - The locale for which to retrieve the localized text. ``` -------------------------------- ### help(_:) Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/nsmutableparagraphstylevaluelabel/help%28_%3A%29-1987c This instance method is inherited from `View.help(_:)`. It allows you to attach help text to a view, which is useful for providing contextual information to the user. The method is available across multiple Apple platforms and versions. ```APIDOC ## help(_:) ### Description Attaches help text to a view. ### Method Signature `nonisolated func help(_ text: S) -> some View where S : StringProtocol` ### Inheritance Inherited from `View.help(_:)`. ### Availability RichTextKitSwiftUICore iOS 14.0+ iPadOS 14.0+ Mac Catalyst 14.0+ macOS 11.0+ tvOS 14.0+ watchOS 7.0+ ``` -------------------------------- ### Initializer Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtextstyle/togglegroup/init%28context%3Astyles%3Agreedy%3A%29 Creates a rich text style toggle button group. ```APIDOC ## init(context:styles:greedy:) ### Description Create a rich text style toggle button group. ### Parameters `context` The context to affect. `styles` The styles to list, by default `all`. `greedy` Whether or not the group is horizontally greedy, by default `true`. ``` -------------------------------- ### imageAttachmentMaxSize Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtextview/imageattachmentmaxsize Get the max image attachment size. ```APIDOC ## Instance Property # imageAttachmentMaxSize Get the max image attachment size. ```swift @MainActor var imageAttachmentMaxSize: CGSize { get } ``` ``` -------------------------------- ### Initializer Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtextstyle/toggle/init%28style%3Acontext%3Afillvertically%3A%29 Creates a rich text style toggle with the specified style, context, and vertical fill behavior. ```APIDOC ## init(style:context:fillVertically:) ### Description Create a rich text style toggle. ### Parameters `style` (RichTextStyle) - The style to toggle. `context` (RichTextContext) - The context to affect. `fillVertically` (Bool) - Whether or not fill up vertical space in a non-greedy way, defaults to `false`. ``` -------------------------------- ### richTextBeforeInputCursor Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtextpresenter/richtextbeforeinputcursor Get the rich text before the input cursor. ```APIDOC ## richTextBeforeInputCursor ### Description Get the rich text before the input cursor. ### Property `richTextBeforeInputCursor`: NSAttributedString { get } ### Returns The `NSAttributedString` representing the text before the cursor. ``` -------------------------------- ### Setup RichTextViewComponent with Data and Format Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtextviewcomponent/setup%28with%3Aformat%3A%29-7wcbm Use this method to configure the RichTextViewComponent with raw data and its corresponding format. Ensure the operation is performed on the main actor. ```swift @MainActor func setup( with data: Data, format: RichTextDataFormat ) throws ``` -------------------------------- ### richTextAfterInputCursor Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtextpresenter/richtextafterinputcursor Get the rich text after the input cursor. ```APIDOC ## richTextAfterInputCursor ### Description Get the rich text after the input cursor. ### Property `var richTextAfterInputCursor: NSAttributedString { get }` ``` -------------------------------- ### mutableAttributedString Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtexteditor/mutableattributedstring Get the mutable string that is managed by the editor. ```APIDOC ## mutableAttributedString ### Description Get the mutable string that is managed by the editor. ### Method `get` ### Signature `@MainActor var mutableAttributedString: NSMutableAttributedString? { get }` ``` -------------------------------- ### Instance Methods Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtextalignment/rawrepresentable-implementations Instance methods for RawRepresentable conformance. ```APIDOC ## Instance Methods ### `func encode(to: any Encoder) throws` Encodes the type to a given encoder. ### `func hash(into: inout Hasher)` Hashes the essential components of the type by feeding them into the provided hasher. ``` -------------------------------- ### libraryFormats Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtextdataformat/libraryformats Get all library supported data formats. ```APIDOC ## libraryFormats ### Description Get all library supported data formats. ### Method static var ### Signature `static var libraryFormats: [`Self`] { get }` ``` -------------------------------- ### help(_:) Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtextcolor/picker/help%28_%3A%29-5h3pl Adds help text to the picker, inherited from the View protocol. ```APIDOC ## help(_:) ### Description Adds help text to the picker. ### Method `func help(_ text: S) -> some View where S : StringProtocol` ### Parameters #### Path Parameters - **text** (S) - The string protocol to use as help text. ``` -------------------------------- ### Initializer Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/richtextstyle/togglestack/init%28context%3Astyles%3Aspacing%3A%29 Creates a rich text style toggle button group with specified context, styles, and spacing. ```APIDOC ## init(context:styles:spacing:) ### Description Create a rich text style toggle button group. ### Parameters `context` (RichTextContext) - The context to affect. `styles` ([RichTextStyle] = .all) - The styles to list, by default `all`. `spacing` (Double = 5) - The spacing to apply to stack items, by default `5`. ``` -------------------------------- ### uniqueUrl(for:) Source: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/foundation/filemanager/richtextexporturlresolver-implementations Gets a unique URL for a given URL. ```APIDOC ## func uniqueUrl(for: URL) -> URL ### Description Get a unique url for the provided `url`. ### Parameters #### Path Parameters - **url** (URL) - Required - The URL to make unique. ```