RichTextKit is a Swift SDK that helps you use rich text in Swift and SwiftUI.
This version drops support for iOS 14, tvOS 14, macOS 11 and watchOS 7.
This version also consolidates all separate attribute readers and writers into the base attribute reader/writer protocols.
RichTextColor
is a new enum that defines supported colors that can be set.RichTextColorPicker
now works on all platforms.RichTextCommandButton
is a new button for commands.RichTextCommandButtonGroup
is a new button group for commands.RichTextContext
has new enum-based style and color functions.RichTextAttributeReader
can handle more colors and superscripting.RichTextAttributeWriter
can handle more colors and superscripting.RichTextAttributeReader
now has all specific getter functions.RichTextAttributeWriter
now has all specific setter functions.RichTextKeyboardToolbar
now opens the format sheet in medium size on iPhone.richText
.RichTextAttributeWriter
renames functionality and omits to:
param name.RichTextColorPicker
initializer has been cleaned up and simplified.RichTextColorPicker.PickerColor
has been deprecated.RichTextColorPickerColor
has been deprecated.RichTextContext
replaces a lot of action-based functions with handle(_:)
.RichTextIndent
has been deprecated.RichTextIndentPicker
has been deprecated.RichTextViewComponent
and omits to:
param name.richTextMenu*
images are renamed to richTextAction*
.RichTextContext
replaces a lot of action-based functions with handle(_:)
.This version makes the observable trigger properties internal. These properties were never made to be used from the outside, and all have context functions that set them, so use these functions instead.
IMPORTANT
The safeRange
adjustment may lead to crashes, although I haven't been able to make it crash. If so, investigate. If you use the safe range yourself, to access attributes, make sure to set the new attribute parameter to true. It's hopefully temporary.
RichTextContext
has a new attributedString
property.RichTextContext
's paste functions now use the selected range index as default index.RichTextReader
safeRange
no longer subtracts 1 from the string length.RichTextReader
will now move the cursor after the pasted text, if it's pasted at selected range.RichTextViewComponent
image pasting has been rewritten.RichTextViewComponent
will now clear the selected range when pasting in images using that range.RichTextReader
safe range fix makes pasting text at the end behave better.RichTextViewComponent
now properly restores the font size after pasting an image.RichTextContext
trigger properties have been made internal.This version makes the keyboard toolbar menu prefer fixed menu order.
RichTextColorPicker
now supports hiding the icon.RichTextColorPicker
now supports specifying quick colors.RichTextColorPickerColor
is a new enum with curated colors.RichTextFormatSheet
adds curated colors to its color pickers.RichTextFormatSidebar
adds curated colors to its color pickers.RichTextColorPickerStack
has been deprecated.RichTextColorPicker
now supports hiding the icon.RichTextColorPicker
now supports specifying quick colors.RichTextColorPickerColor
is a new enum with curated colors.RichTextFormatSheet
adds curated colors to its color pickers.RichTextFormatSidebar
adds curated colors to its color pickers.RichTextColorPickerStack
has been deprecated.This version is a hot fix that fixes some performance issues in 0.6.
Thanks to @jamesbradleym, RichTextKit now supports text indentation.
Image
has new richTextIndentDecrease
and richTextIndentIncrease
actions.
NSTextAttachment
has a new attachedImage
property.
RichTextAction
has new increaseIndent
and decreaseIndent
actions.
RichTextActionButtonGroup
is a new view that groups multiple action buttons together.
RichTextAttributeWriter
now supports affecting the entire text by default.
RichTextButtonGroup
is a new view that groups multiple buttons together.
RichTextColorWriter
now supports affecting the entire text by default.
RichTextContext
has new canDecreaseIndent
and canIncreaseIndent
properties.
RichTextContext
has new decreaseIndent()
and increaseIndent()
functions.
RichTextContext
has new resetAttributedString()
and setAttributedString()
functions.
RichTextFontWriter
now supports affecting the entire text by default.
RichTextFormatSheet
now groups related buttons and also adds indent buttons.
RichTextIndent
is a new enum for handling text indent changes.
RichTextIndentPicker
is a new enum for picking a text indent.
RichTextIndentReader
is a new type for managing text indents.
RichTextIndentWriter
is a new type for managing text indents.
RichTextKeyboardToolbar
now supports modofying the format sheet before presenting it.
RichTextStyleToggleGroup
is a new view that groups multiple toggles together.
RichTextStyleWriter
now supports affecting the entire text by default.
RichTextKeyboardToolbar
height
and spacing
has been moved to RichTextKeyboardToolbarStyle
.Thanks to @jamesbradleym, RichTextKit now supports text indentation.
Image
has new richTextIndentDecrease
and richTextIndentIncrease
actions.
NSTextAttachment
has a new attachedImage
property.
RichTextAction
has new increaseIndent
and decreaseIndent
actions.
RichTextActionButtonGroup
is a new view that groups multiple action buttons together.
RichTextAttributeWriter
now supports affecting the entire text by default.
RichTextButtonGroup
is a new view that groups multiple buttons together.
RichTextColorWriter
now supports affecting the entire text by default.
RichTextContext
has new canDecreaseIndent
and canIncreaseIndent
properties.
RichTextContext
has new decreaseIndent()
and increaseIndent()
functions.
RichTextContext
has new resetAttributedString()
and setAttributedString()
functions.
RichTextFontWriter
now supports affecting the entire text by default.
RichTextFormatSheet
now groups related buttons and also adds indent buttons.
RichTextIndent
is a new enum for handling text indent changes.
RichTextIndentPicker
is a new enum for picking a text indent.
RichTextIndentReader
is a new type for managing text indents.
RichTextIndentWriter
is a new type for managing text indents.
RichTextKeyboardToolbar
now supports modofying the format sheet before presenting it.
RichTextStyleToggleGroup
is a new view that groups multiple toggles together.
RichTextStyleWriter
now supports affecting the entire text by default.
RichTextView
s now update whenever the text changes.RichTextKeyboardToolbar
height
and spacing
has been moved to RichTextKeyboardToolbarStyle
.This release addresses some performance changes, by trying to minimize the number of redraws.
As a result, the RichTextContext
's selectedRange
is no longer observable, since that caused every input or text position change to redraw the entire app. The library and demo app however still updates way to often, and too much. For instance, switching between having a selected range and not should only redraw the copy button, but now updates the entire screen. If you know how to minimize this, please reach out.
Furthermore, this release adds support for focus values and menu commands. You can see them in action in the demo app.
Commands
is a new namespace for app commands.Focus
is a new namespace for focus values.RichTextDataFormat
has a new fileFormatText
property.RichTextDataFormat
has a new isArchivedDataFormat
property.RichTextDataFormat
has a new libraryFormats
property that returns all formats except the vendorArchivedData
format.RichTextDataFormatMenu
is a new menu that triggers an action for various formats.RichTextDataReader
now has ways to get data for the current rich text.RichTextExportMenu
is a new menu for exporting rich text.RichTextContextFocusedValueKey
is a new rich text context focus key.RichTextFormatCommandMenu
is a new command menu for adding rich text formatting to the system menu.RichTextNSSharingMenu
is a new macOS-specific menu for sharing rich text with NSSharingServices
.RichTextShareCommandMenu
is a new command menu for adding rich text sharing and exporting to the system menu.RichTextShareMenu
is a new menu for sharing rich text.ViewDebug
is a new demo app class that is used for view debugging capabilities.RichTextCoordinator
now checks if properties have changed before it syncs.RichTextKeyboardToolbar
no longer allocates width for hidden items.RichTextStyleToggle
is no longer tinted by default when inactive.PdfDataReader
has been renamed to RichTextPdfDataReader
.RichTextDataWriter
is deprecated.RichTextDataWriter
functionality has been moved to RichTextDataReader
.RichTextContext
no longer has a font size in the initializer, use StandardFontSizeProvider
(CGFloat, TextEditor etc.) instead.RichTextContext
selectedRange
is no longer published.RichTextDataReader
now implements RichTextReader
.RichTextDataReader
format-specific data functions have been made private.RichTextStyleToggle.Style
inactiveColor
is now optional.NSMutableString
format-specific initializers have been made private.