For developing an iOS fully-featured code editor (i.e line numbers + color pass for syntax highlighting + collapsible sections + debug markers/highlights) what would be the best strategy for iOS 27?
- UITextView with new viewport control delegate
- Custom TextKit2 UIView
- Custom TextKit1 UIView (this was the recommendation I got as of WWDC25)
Hi!
Option 1 is definitely the best way to go. You can use the viewport controller delegate's configureRenderingSurfaceForTextLayoutFragment: method to add line numbers, and collapsible sections.
You'll have to use your own parser to add syntax highlighting, and then apply this as attributes to the NSTextStorage. You could use the NSTextContentStorage delegate methods as well.
If you have more specific questions, feel free to ask another question or post a feedback.
- Tarun