This version makes a first step towards removing library-specific types in favor of native types, to avoid having to add custom types and logic where native alternatives exist.
This version starts with NSParagraphStyle
and its nested types, and makes it possible to get, set, pick, step and toggle the following values with a single set of functions, pickers, steppers and toggles:
alignment
, allowsDefaultTighteningForTruncation
, baseWritingDirection
, defaultTabInterval
, firstLineHeadIndent
, headIndent
, hyphenationFactor
, lineBreakMode
, lineBreakStrategy
, lineHeightMultiple
, lineSpacing
, maximumLineHeight
, minimumLineHeight
, paragraphSpacing
, paragraphSpacingBefore
, tabStops
, tailIndent
, usesDefaultHyphenation
.
As a result, this version deprecates the RichTextAlignment
and RichTextLine
type. This makes the library tighter, and a lot more capable with less code that does more.
✨ Features
NSMutableParagraphStyle
has a newdefaultMutable
builder.NSParagraphStyle
has a newdefaultPickerValues(for:)
function.NSParagraphStyle
has a newdefaultStepperSteps(for:)
function.NSParagraphStyle.KeyPath
has a newdefaultIcon
image property.NSParagraphStyle.KeyPath
has a newdefaultPickerValues
property.NSParagraphStyle.KeyPath
has a newdefaultStepperInterval
property.NSTextAlignment
has a newdefaultIcon
image-building property.RichTextContext
has a newparagraphStyleValue(for:)
function.RichTextContext
has a newparagraphStyleValueBinding(for:)
function.RichTextViewComponent
has a new, keypath-basedrichTextParagraphStyleValue(_:)
.RichTextViewComponent
has a new, keypath-basedsetRichTextParagraphStyleValue(_:_:)
.RichTextViewComponent
has a new, keypath-basedstepRichTextParagraphStyleValue(_:_:)
.
🏞️ Views
Picker
has new paragraph style value-based initializers.Stepper
has new paragraph style value-based initializers.Toggle
has new paragraph style value-based initializers.
🗑️ Deprecations
RichTextAlignment
and all nested types have been deprecated due to the new paragraph-based features.RichTextLine
and all nested types have been deprecated due to the new paragraph-based features.