Post

Replies

Boosts

Views

Activity

Can I use NSPersistentCloudKitContainer while at the same time adding extra fields to my CloudKit CKRecord?
For example, because NSPersistentCloudKitContainer doesn't support ordered relationship, I'd like to have an array of references on my CKRecord because CloudKit support NSArray field type; I can then sync these array manually (e.g. persist without relying on Core Data). Is it okay or recommended to do so?
1
0
948
Sep ’22
When does viewport bounds gets recalculated?
The demo app has a problem: if you vertically shrink the window using the bottom edge and move it to position y0, then drag the bottom edge again to another position y1, parts of the document after y0 will not be rendered due to the fact the viewport bounds are not recalculated when frame height changes. My fix to this problem is to remove the check that inspects whether the text container width changed and always set the value of the text container size used by the text layout manager whenever frame size changes: this does fix the problem mentioned above. However, I would like to know exactly when will the text layout manager recalculate the viewport bounds. This is not documented anywhere, nor in the video.
1
0
1.1k
Apr ’22
Why I cannot interact with transparent views (e.g. `Color.clear`)?
import SwiftUI import PlaygroundSupport struct ContentView: View {     @State var count = 1     var body: some View {         VStack {             Color.clear                 .onTapGesture {                     count += 1                 }             Text("Counter: \(count)")         }     } } PlaygroundPage.current.setLiveView(ContentView()) The above counter doesn't work for Color.clear in the playground app. However, if the Color.clear were replaced by any color that's not transparent (e.g. Color.red) it will work. I don't understand why transparent views are not interactable like other views. Make transparent views interactable can be very useful (e.g. provide a larger tolerance space to let visually-small controls recognise gestures).
2
0
2.5k
Feb ’22
TextKit 2 Demo Question
Hi there, I have a small question regards to the TextKit 2 demo app: In macOS / TextDocumentView.swift / viewportBounds(for:) / Line 106 , why compare overdrawRect.minY with max(visibleRect.minY, 0)? Isn’t overdrawRect.minY always the smaller one (as it’s an overdraw rect)? Another question would be, if I'm planning to start working on an application with complex text editing features, would you recommend using NSTextView for now and wait for further updates, or just use the TextKit 2 stack (with CALayers) like the one used in the demo? I really love TextKit 2 and so far the demo seems pretty performant. But I don't know if there is any drawbacks if I build a TextKit 2 stack on my own so I'm looking forward to your advice. Many thanks
0
0
888
Dec ’21
Will Safari Web Extension support browsingData API in the future?
A good user experience can be provided if users are able to clean browsing data through a toolbar button without going back to its app container to change cleaning rules. However, without support of browsingData API, it will be much more harder to create such experience. Will browsingData API come to the ground for Safari one day? If not, what could be the potential reasons behind?
0
0
614
Oct ’21
The example project of TextKit 2 did't implement the indented, nested comments like the one shown in the session
Hi there, The example project provided along with the session video doesn't behave like the one shown in the video: the comments are not indented. I couldn't find where the commentDepth value is being used in drawing anywhere. Is it possible to get an updated version with the indentation implemented of this example project? Thanks.
2
0
1.1k
Jun ’21