4.0.0
4.0.0
Released on 2026-06-15.
Added
- Added
CDMarkdownTextLayoutManager, a customNSTextLayoutManagersubclass used as the TextKit 2 layout manager forCDMarkdownLabelandCDMarkdownTextViewon iOS/tvOS 16+. Delegates fragment creation toCDMarkdownTextLayoutFragmentand exposes aroundAllCornersproperty that propagates to each fragment. - Added
CDMarkdownTextLayoutFragment, a customNSTextLayoutFragmentsubclass that draws rounded-corner backgrounds for code and syntax spans in the TextKit 2 rendering path. Reads the.backgroundColorattribute from text storage at draw time so code and syntax blocks each use their correct color. - Added TextKit 2 rendering path to
CDMarkdownLabelon iOS/tvOS 16+. Text layout, rect measurement, glyph-position calculation, and link hit-testing all useNSTextLayoutManagerwhen TextKit 2 is active; TextKit 1 fallback is preserved for iOS/tvOS 15. - Added TextKit 2 rendering path to
CDMarkdownTextViewon iOS/tvOS 16+.configureTK2()installsCDMarkdownTextLayoutManagervia KVC;configureTK1()continues to installCDMarkdownLayoutManageron iOS/tvOS 15. - Added
CDMarkdownTextView.makeTextView(frame:)public factory method. Preferred way to construct aCDMarkdownTextViewprogrammatically — selects TextKit 2 on iOS/tvOS 16+ and TextKit 1 on iOS/tvOS 15 automatically.
Changed
- Raised minimum deployment targets:
- iOS: 12.0 → 13.0
- macOS: 10.13 → 10.15
- tvOS: 12.0 → 13.0
- watchOS: 4.0 → 6.0
- Improved Swift 6 strict concurrency: removed
@preconcurrencyimports,@unchecked Sendableconformances, andnonisolated(unsafe)from parser properties; added@MainActorto all sixteen element classes and base protocol declarations; added@MainActorto theNSLayoutManagerDelegateextension. - Replaced
DispatchQueue.main.asyncAfterwithTask.sleepin the async parsing pipeline to align with structured Swift concurrency.