Hello,
I am trying to show a localized image using SwiftUI's Image() by overridding the system locale like this:
.environment(\.locale, Locale.init(identifier: "nl"))
Both the preview and the actual app are still showing the default (fallback) image, not the localized version.
The image is localized in a catalog (xcassets) as described here. - https://developer.apple.com/documentation/xcode/localization/localizing_assets_in_a_catalog.
When I change my system locale (to "nl") the correct image appears.
What am I doing wrong, or is this a bug in SwiftUI?
Thanks.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I use NSPersistentCloudKitContainer to synchronize data between iOS and macOS. After installing the app, it takes long (sometimes up to an hour) for all data to become available. Related to this, I have a few questions:
Synchronization seems only to take place when the app runs in the foreground. Is there a way to keep the app synchronizing when it is brought to the background? I have enabled remote notifications and use registerForRemoteNotifications in my app delegate (via UIApplicationDelegateAdaptor). I haven't yet experimented with background processing. Should I do that, and can you point me to some references?
Is there a way to check whether the local-stored data matches what's available on the server? E.g. checking whether a (local-stored) NSPersistentHistoryToken matches the latest NSPersistentHistoryToken on the server. Internally NSPersistentCloudKitContainer knows, as I can see log events popping up saying that there are no new data to mirror. I would like to know this to inform the user that synchronization still takes place. Currently, users are complaining about missing data, which is just not available yet.
Thanks!