Is it possible to manually fetch updates over NSPersistentCloudKitContainer? e.g. to allow users request newest data by themselves by pull refresh / some other mechanism?
Post
Replies
Boosts
Views
Activity
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?
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.
During the presentation (19:43) it says the NSTextLayoutFragment 'Layout information for one or more elements'. But from the documentation it seems that you can only generate a layout fragment from one NSTextElement. Besides there is only one property that associates a text element. What does it mean by 'parent element' anyway?
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).
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
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?
So I was exploring Core Graphics and found several documents related to CGColorSpace are saying "If unsuccessful, returns NULL."
I know this NULL is from Objective-C or C, but how should they be handled in Swift? Is there any workaround or should I assume these functions always success in Swift?
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.