Post

Replies

Boosts

Views

Activity

Reply to iCloud Sync not working with iPhone, works fine for Mac.
Wish I'd reported this weeks ago when my iPad showed this symptom on the iOS beta, but I'd assumed it was due to me using a sandbox user since Apple was so bullish in their WWDC 2023 video about the number of test cases they'd created for CkSyncEngine. I'd also created a feedback before discovering this thread (FB22344526) Easy to reproduce - the Apple sample app fails. Hoping it gets taken seriously.
Mar ’26
Reply to Force a locale from string catalog
Many thanks Apple Engineer, func localizedString( is exactly what I needed and the fog is clearing :) Reminder to myself: func localizedString(_ resource: LocalizedStringResource, _ myLocale: String) -> String { var locale: Locale { Locale(identifier: myLocale) } var resource = resource resource.locale = locale return String(localized: resource) }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Aug ’25
Reply to Force a locale from string catalog
LocalizedStringResource didn't seem to work. The .environment modifier may work on Views but not on the content of the view ( strings in the view used to build the shared content) However, the localizedString method suggested by AI did work despite looking messy. A shame there's not a simpler solution. @State var isOtherLanguage = false var body: some View { var myLocale: String { isOtherLanguage ? "de" : "en" } VStack { Toggle("Switch language", isOn: $isOtherLanguage).frame(maxWidth: 200) HStack { Text("❌\(myLocale): ") Text( LocalizedStringResource( "Hello world!", table: "Localizable", locale: Locale(identifier: myLocale) ) ) } HStack { Text("❌\(myLocale): ") Text( String( localized: "Hello world!", locale: (Locale(identifier: myLocale)), comment: "To share" ) ) .environment(\.locale, Locale(identifier: myLocale)) } HStack { Text("❌\(myLocale): ") Text(localizedString) } HStack { Text("✅\(myLocale): ") Text("Hello world!") .environment(\.locale, Locale(identifier: myLocale)) } HStack { Text("✅\(myLocale): ") Text(localizedString("Hello world!", locale: myLocale)) } } } func localizedString(_ key: String.LocalizationValue, locale: String) -> String { guard let path = Bundle.main.path(forResource: locale, ofType: "lproj"), let bundle = Bundle(path: path) else { return String(localized: key) } return String(localized: key, bundle: bundle) }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Aug ’25
Reply to How to create a second target for an app with a linked App Clip?
Here's how to fix it... In the target for the Test Flight App in the general tab you'll find a framework, library, clips section and this contains the reference to the clip ( a relic of copying the original production target.) This must be deleted. However, you cannot delete it here (if you try, you'll get warning popups etc but the deletion fails. ) Instead, navigate to the Build Phases tab and scroll down to the Embed App Clips section and here you can delete it. Warning: Make sure you do this in the test flight target not the production target.
Feb ’25
Reply to Run identical UI/Unit tests on different build targets
I discovered this nugget of Apple Documentation. It visualises how the scheme is the link specifying which build target is used by the test target. Unfortunately this doesn't seem to be the case. The host application field in the test target (general tab) appears to be the main determinator. So my assumptions above seem to be correct, and you can be easily be misled into assuming one build target is used whereas in fact another target is used. Tip: Include a screenshot of the about page of your app/clip/widget to avoid being misled.
Nov ’24
Reply to NSCocoaErrorDomain 513
Solved. I'm not sure where or how Sandbox is selected as a capability. I'd much rather it wasn't. But my problem was that User Selected File (see screenshot above) was specified as read/write in the release tab, but none in the debug tab.
Topic: App & System Services SubTopic: Core OS Tags:
Nov ’24
Reply to iCloud Sync not working with iPhone, works fine for Mac.
I can confirm my App works again (iPad 26.5 beta) .✅ ⁇ I cannot confirm the apple example program works as I've run out of devices (and I'm not sure if CkSyncEngine behaves properly with sandbox users or Xcode simulation)
Replies
Boosts
Views
Activity
Mar ’26
Reply to iCloud Sync not working with iPhone, works fine for Mac.
I’d like a robust dev environment for this. I’m not confident cksyncengine works for sandbox users. I’m not confident cksyncengine works in Xcode simulators I’m not confident cksyncengine works in development as opposed to production iCloud. Without this confidence it’s difficult to set-up, difficult to test and difficult reporting bugs.
Replies
Boosts
Views
Activity
Mar ’26
Reply to iCloud Sync not working with iPhone, works fine for Mac.
Wish I'd reported this weeks ago when my iPad showed this symptom on the iOS beta, but I'd assumed it was due to me using a sandbox user since Apple was so bullish in their WWDC 2023 video about the number of test cases they'd created for CkSyncEngine. I'd also created a feedback before discovering this thread (FB22344526) Easy to reproduce - the Apple sample app fails. Hoping it gets taken seriously.
Replies
Boosts
Views
Activity
Mar ’26
Reply to Force a locale from string catalog
Many thanks Apple Engineer, func localizedString( is exactly what I needed and the fog is clearing :) Reminder to myself: func localizedString(_ resource: LocalizedStringResource, _ myLocale: String) -> String { var locale: Locale { Locale(identifier: myLocale) } var resource = resource resource.locale = locale return String(localized: resource) }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’25
Reply to Force a locale from string catalog
LocalizedStringResource didn't seem to work. The .environment modifier may work on Views but not on the content of the view ( strings in the view used to build the shared content) However, the localizedString method suggested by AI did work despite looking messy. A shame there's not a simpler solution. @State var isOtherLanguage = false var body: some View { var myLocale: String { isOtherLanguage ? "de" : "en" } VStack { Toggle("Switch language", isOn: $isOtherLanguage).frame(maxWidth: 200) HStack { Text("❌\(myLocale): ") Text( LocalizedStringResource( "Hello world!", table: "Localizable", locale: Locale(identifier: myLocale) ) ) } HStack { Text("❌\(myLocale): ") Text( String( localized: "Hello world!", locale: (Locale(identifier: myLocale)), comment: "To share" ) ) .environment(\.locale, Locale(identifier: myLocale)) } HStack { Text("❌\(myLocale): ") Text(localizedString) } HStack { Text("✅\(myLocale): ") Text("Hello world!") .environment(\.locale, Locale(identifier: myLocale)) } HStack { Text("✅\(myLocale): ") Text(localizedString("Hello world!", locale: myLocale)) } } } func localizedString(_ key: String.LocalizationValue, locale: String) -> String { guard let path = Bundle.main.path(forResource: locale, ofType: "lproj"), let bundle = Bundle(path: path) else { return String(localized: key) } return String(localized: key, bundle: bundle) }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’25
Reply to What's the trick for copying a file to a simulator session?
I checked on a Mac mini . The share method worked there. Here’s hoping the next macOS update solves the problem for my MacBook.
Replies
Boosts
Views
Activity
Jun ’25
Reply to What's the trick for copying a file to a simulator session?
Additional information.... Even if I use safari to download the file from google drive or icloud it fails with no message at all. I suspect it's either an authorisation problem (can't determine how to authorize safari to access the simulation files) or a missing directory (i.e. simulator is trying to download to a non-existent directory).
Replies
Boosts
Views
Activity
Jun ’25
Reply to How to create a second target for an app with a linked App Clip?
Here's how to fix it... In the target for the Test Flight App in the general tab you'll find a framework, library, clips section and this contains the reference to the clip ( a relic of copying the original production target.) This must be deleted. However, you cannot delete it here (if you try, you'll get warning popups etc but the deletion fails. ) Instead, navigate to the Build Phases tab and scroll down to the Embed App Clips section and here you can delete it. Warning: Make sure you do this in the test flight target not the production target.
Replies
Boosts
Views
Activity
Feb ’25
Reply to New Target for project with an App Clip
Posted in the wrong forum and I cannot figure how to move it so I’m closing this post.
Replies
Boosts
Views
Activity
Feb ’25
Reply to Guidelines for ViewThatFits to avoid run-time crashes
Apple replied today to say the problem has now been now fixed: Xcode 16.3 beta (16E5104o) https://developer.apple.com/download/ Posted Date: February 21, 2025
Topic: UI Frameworks SubTopic: SwiftUI
Replies
Boosts
Views
Activity
Feb ’25
Reply to @Observation: Best way of handling binding after injecting a View-Model
I've researched. The diagram is a slight oversimplification. Alternative 2 (@State) is the correct answer.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Dec ’24
Reply to Run identical UI/Unit tests on different build targets
I discovered this nugget of Apple Documentation. It visualises how the scheme is the link specifying which build target is used by the test target. Unfortunately this doesn't seem to be the case. The host application field in the test target (general tab) appears to be the main determinator. So my assumptions above seem to be correct, and you can be easily be misled into assuming one build target is used whereas in fact another target is used. Tip: Include a screenshot of the about page of your app/clip/widget to avoid being misled.
Replies
Boosts
Views
Activity
Nov ’24
Reply to CreateML for Image recognition with a spreadsheet catalog
Here's the code: https://github.com/alanrick/CreateMLImageDistributor
Replies
Boosts
Views
Activity
Nov ’24
Reply to NSCocoaErrorDomain 513
Solved. I'm not sure where or how Sandbox is selected as a capability. I'd much rather it wasn't. But my problem was that User Selected File (see screenshot above) was specified as read/write in the release tab, but none in the debug tab.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Nov ’24
Reply to NSCocoaErrorDomain 513
Same problem in Sequoa 15.1. But, when I copy the same code into another project it works. There must be some project/profile/info.plist setting that makes all the difference 🙁
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Nov ’24