Skip to content

Add UIKit live preview support for iOS 17 - #180

Open
RuslanTsitser wants to merge 4 commits into
nodes-app:mainfrom
RuslanTsitser:main
Open

Add UIKit live preview support for iOS 17#180
RuslanTsitser wants to merge 4 commits into
nodes-app:mainfrom
RuslanTsitser:main

Conversation

@RuslanTsitser

Copy link
Copy Markdown

Summary

  • add iOS 17 support to the MarkdownEngine package with an editable UIKit/TextKit 2 NativeTextViewWrapper
  • reuse the existing AST/tokenizer pipeline so iOS styling preserves the original Markdown source and UTF-16 ranges
  • provide live styling for headings, emphasis, links, blockquotes, code, lists, task items, thematic breaks, tables, images, LaTeX source, and strikethrough
  • reveal Markdown markers around the active construct while hiding them elsewhere
  • preserve the existing AppKit implementation and behavior behind macOS platform guards
  • isolate the existing macOS test suite and add focused UIKit styling tests

Implementation notes

The iOS editor uses the same public entry point as macOS and keeps editing and preview in one surface. It supports fit-to-content layout, selection-preserving restyling, list continuation, ordered-list increments, task reset on Return, raw-source mode, and accessibility identification.

The core target still has no new external dependencies. Existing AppKit-only service integrations and specialized renderers remain unchanged and macOS-only; the UIKit path styles their Markdown source without changing stored content.

Testing

  • swift test — 470 tests in 68 suites passed on macOS
  • xcodebuild iOS test action — MarkdownEngineIOSTests passed on iPhone 17 Pro Max Simulator
  • MarkdownEngine builds for a generic iOS Simulator destination
  • verified live editing in a real SwiftUI host: headings, bold, italic, hidden markers, and completed task styling

@RuslanTsitser
RuslanTsitser marked this pull request as ready for review September 7, 2026 14:34
…ving the text cursor. This update includes gesture recognizer adjustments to ensure proper handling of taps within the Markdown editor.
This update introduces a new optional property, `configureTextView`, to the `NativeTextViewWrapper` struct, allowing users to customize the UITextView instance during its creation. The closure is invoked in the `makeUIView` method, enhancing flexibility for text view configuration.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant