PSA: TextKit 2 Has Bugs
When I linked to Marcin Krzyzanowski’s STTextView, I didn’t want to pollute the link post with this – but I did notice that Marcin added a very informative section to the README: a Bug Report List.
When I linked to Marcin Krzyzanowski’s STTextView, I didn’t want to pollute the link post with this – but I did notice that Marcin added a very informative section to the README: a Bug Report List.
In my recent post about the TextKit 2 sample app, commenter Frizlab pointed out that Marcin Krzyzanowski (@krzyzanowskim on Twitter) is doing TextKit 2 stuff. I didn’t notice that in my Twitter timeline even though I follow him for years now, so I was confused, nay, angry about the state of my Twitter timeline since Musk’s takeover /s
.
And yes, Marcin does have a very extensive open source sample project that explores TextKit 2! He’s working on Swift Studio, a pure Swift IDE and his STTextView
is a part of that.
So meet STTextView, a “TextKit2 text view without NSTextView baggage”.
One thing I love about the code comments for the UI compoents is the ASCII diagrams of layer contents, e.g. in STTextView.swift
:
// STTextView
// |---selectionLayer (CALayer)
// |---contentLayer (CALAyer)
// |---(STInsertionPointLayer | TextLayoutFragmentLayer)
//
Am totally going to adopt this :)
The Apple Developer Docs have an example app, “Using TextKit 2 to Interact with Text”. That’s related to WWDC 2021’s introduction to TextKit 2.
I’ve just watched the TextKit 2 WWDC video. Without hands-on experience, I cannot say much about the tech, but judging from the presentation, all of the changes sound like an amazing step forward to make rich text-based interfaces nicer to work with. I didn’t particularly enjoy implementing some things in TextKit 1.