Post

Replies

Boosts

Views

Activity

NSPersistentCloudKitContainer: How to know initial sync between CloudKit has happened?
I am looking into using the new NSPersistentCloudKitContainer to sync some internal data for my app. Generally it works great, but I have one scenario that I cannot figure out.Here the basic scenario, there is a single record in CloudKit that created and used to keep track of some internal state. Keeping it the cloud allows for two cases: when the user open the app on another device (say an iPad) and when the user re-installs the app on the same device.If its indeed the very first time the user is using the app on any device, I need to create the record with a bunch of default initial values. I am okay with spending a little time at app startup determining if its a brand new user or an existing user installing on another device.I thought maybe observing NSPersistentStoreRemoteChangeNotification would provide a useful point in time that I can say "ah ha, now I know its a new user, or an existing user". However its gets called a lot and I cannot find anything in its userInfo that gives me a definitive answer to my question.Any suggestions?joey
4
0
3.8k
Dec ’20
UIButton image not honoring dynamic type changes
I am unable to get a UIButton's image to size as I change the font size. I can get the text in the label to work correctly using the adjustsFontForContentSizeCategory property on the button's label, but there appears to be now equivalent for the image. If I restart the app after making the font size change, the button does indeed scale the image correctly so I know I have the preferred configuration setup correctly. I figured I could work around the issue using traitCollectionDidChange and comparing the preferredContentSizeCategory, but I am still unable to get the button to resize itself no matter what I attempt to tweak. Anybody else running into this issue? Any workarounds?
Topic: UI Frameworks SubTopic: UIKit Tags:
2
1
1.7k
Dec ’20