Post

Replies

Boosts

Views

Activity

Reply to Subclass UITextView using TextKit2
Thanks @DTS Engineer for the suggestion and code! In answer to the second part, I’m wanting to recreate a Pages/Word style document writing app that has custom rendering of the same body of text over multiple “pages“. I’ve got a rough working prototype using custom TextKit2 drawing to views but implementing UITextInput manually is A LOT of work. I was hoping instead to make use of UITextView given I only want to control the layout (drawing) of the fragments and essentially get the text editing experience for free. But this has proved very difficult (there’s also almost no documentation on this topic other than 2 WWDC videos so it’s a much more difficult task). I‘ve been able to achieve the above by using a UITextView (without subclassing) and using custom rendering but this draws the text on top of the UITextView in its multiple pages, duplicating the drawn text (not what I want as it effectively draws the UITextView’s text on a layer below as normal, then my text is rendered above it in separate page views, added as subviews to the UITextView) So I thought perhaps the next step would be to subclass UITextView for more control. Hopefully you can see what I’m trying to do, does that make sense?
Aug ’24
Reply to How to link multiple text views to a single text storage in TextKit 2
I've found the documentation on this topic to be really awful with little to explain the relationships between all these elements and the existing documentation to be outdated using TextKit1 (Note the below is archived) https://developer.apple.com/library/archive/documentation/TextFonts/Conceptual/CocoaTextArchitecture/TextSystemArchitecture/ArchitectureOverview.html @DTS Engineer is there any docs for TextKit2 and how its new classes interface with each other? The TextKit2 sample code has a lot of nuance which is impossible to learn unless you know it exists
Aug ’24
Reply to Multiple text containers on layout manager and edibility
I'm working on an older project so apologies for my fuzzy memory. I think my initial attempt was to use TextKit2 now I'm looking at the code. But there was a limit of only using one NSTextContainer. Am I right in thinking if I wanted to create that multi-page setup I'd need each "page" to have its own layer that's drawn in to? Similar to the Bubble TextKit2 example code does? I found this forum post which it sounds like it was going to change to add multiple containers, So I'm quite confused in this... https://developer.apple.com/forums/thread/682251
Aug ’24
Reply to NO ANIMATIONS in NavigationStack or NavigationSplitView
Thanks for the workaround... shame this issue is still around in iOS 18 Beta 2 / Xcode 16 beta 2. For anyone else, my code has to look like this : @State private var path = NavigationPath() // body { // Navigation Split View Detail ... { NavigationStack(path: $path.animation(.linear(duration: 0))) { VStack { Text(document.imageUrl?.absoluteString ?? "") .frame(maxWidth: .infinity, maxHeight: .infinity) .id(document.imageUrl) .transition(.slide) .overlay( alignment: .bottomTrailing, content: makePrevNextView ) } } // } // } Note, the VStack is necessary and fails without it...
Jun ’24
Reply to macOS widget preview error
I'm having the same issue and this just looks like I've done something wrong as a developer with this error rather than it not being supported by Xcode/Previews any more - kind of sucks as a dev experience as I could have just wasted a ton of time trying to fix something that isn't broken
Mar ’24