Post

Replies

Boosts

Views

Activity

Change iOS Keyboard Language without adding to Settings > Keyboards
The first-party Apple Translate app will switch the on-screen keyboard to the selected language, even when the keyboard for that language is NOT added in Settings > General > Keyboards. We'd like to mirror this behavior and switch the keyboard for input based on a user-selected language from a drop-down without the user needing to add that language to Keyboards I'm struggling to find if this behavior is achieved via a public API. Any insights here?
1
0
45
4w
Old CloudKit Data Repopulating after a Local Reset
We are trying to solve for the following condition with SwiftData + CloudKit: Lots of data in CloudKit Perform "app-reset" to clear data & App settings and start fresh. Reset data models with try modelContext.delete(model:_) myModel.count() confirms local deletion (0 records); but iCloud Console shows expectedly slow process to delete. Old CloudKit data is returning during the On Boarding process. Questions: • Would making a new iCloud Zone for each reset work around this, as the new zone would be empty? We're having trouble finding details about how to do this with SwiftData. • Would CKSyncEngine have a benefit over the default SwiftData methods? Open to hearing if anyone has experienced a similar challenge and how you worked around it!
2
0
157
Jun ’25
CloudKit Console: No Containers
Background: Our non-production App was using SwiftData locally. Yesterday we followed the documentation to enable CloudKit: https://developer.apple.com/documentation/cloudkit/enabling-cloudkit-in-your-app iCloud Works: Data is properly syncing via iCloud between 2 devices. Add on one shows on the other; delete on one deletes on the other. Today we logged into CloudKit Console for the first time; but there are no databases showing. We verified: Users and Roles: we have “Access to Cloud Managed… Certificates” Certificates, Identifiers & Profiles: our app has iCloud capabilities and is using our iCloud Container Signed into CloudKit Console with same developer ID as AppStoreConnect This is also the Apple ID of the iCloud account that has synced data from our app. In Xcode > Signing & Capabilities we are signed in as our Company team. Any guidance or tips to understanding how to what’s going on in CloudKit Console and gaining access to the database is appreciated!
1
0
102
Jun ’25
Translation API & Download Language Sheet
Using Apple SwiftUI Translate library: when calling: try await session.prepareTranslation() the first time, the API's Language Download sheet does not show (or shows briefly and dismisses immediately) Even when the sheet doesn't show, the keyboard is lowered, as though the sheet would be appearing, but then the keyboard raises as though the sheet was dismissed. The following Errors are printed in the console dozens of times; but on all subsequent executions, the API Language Download sheet shows as expected. The trigger code is in a function which is executed when a Translate button is tapped. Any ideas would be welcome! Console Error on first execution only LaunchServices: store (null) or url (null) was nil: Error Domain=NSOSStatusErrorDomain Code=-54 "process may not map database" UserInfo={NSDebugDescription=process may not map database, _LSLine=72, _LSFunction=_LSServer_GetServerStoreForConnectionWithCompletionHandler} Attempt to map database failed: permission was denied. This attempt will not be retried. Failed to initialize client context with error Error Domain=NSOSStatusErrorDomain Code=-54 "process may not map database" UserInfo={NSDebugDescription=process may not map database, _LSLine=72, _LSFunction=_LSServer_GetServerStoreForConnectionWithCompletionHandler} LaunchServices: store (null) or url (null) was nil: Error Domain=NSOSStatusErrorDomain Code=-54 "process may not map database" UserInfo={NSDebugDescription=process may not map database, _LSLine=72, _LSFunction=_LSServer_GetServerStoreForConnectionWithCompletionHandler} Attempt to map database failed: permission was denied. This attempt will not be retried. Failed to initialize client context with error Error Domain=NSOSStatusErrorDomain Code=-54 "process may not map database" UserInfo={NSDebugDescription=process may not map database, _LSLine=72, _LSFunction=_LSServer_GetServerStoreForConnectionWithCompletionHandler} LaunchServices: store (null) or url (null) was nil: Error Domain=NSOSStatusErrorDomain Code=-54 "process may not map database" UserInfo={NSDebugDescription=process may not map database, _LSLine=72, _LSFunction=_LSServer_GetServerStoreForConnectionWithCompletionHandler} Attempt to map database failed: permission was denied. This attempt will not be retried. Failed to initialize client context with error Error Domain=NSOSStatusErrorDomain Code=-54 "process may not map database" UserInfo={NSDebugDescription=process may not map database, _LSLine=72, _LSFunction=_LSServer_GetServerStoreForConnectionWithCompletionHandler} Error returned from iconservicesagent image request: <ISBundleIdentifierIcon: 0x300df3c30> BundleID: (null) digest: 7749FEEE-F663-39B4-AD68-A18CFF762CCC - <ISImageDescriptor: 0x3033b26c0> - (64.00, 64.00)@2x v:4 l:5 a:0:0:0:0 t:() b:0 s:2 ps:0 digest: DF83A970-D4C9-3D90-BB7D-0BC21FC22E03 error: Error Domain=NSOSStatusErrorDomain Code=-609 "Client is disallowed from making such an icon request" UserInfo={NSLocalizedDescription=Client is disallowed from making such an icon request} Error returned from iconservicesagent image request: <ISTypeIcon: 0x300d0fb70>,Type: com.apple.appprotection.badge.faceid - <ISImageDescriptor: 0x3033ad0e0> - (32.00, 32.00)@2x v:0 l:5 a:0:0:0:0 t:() b:0 s:2 ps:0 digest: 648D7A72-90CB-3858-9409-5C554BB43B8E error: Error Domain=NSOSStatusErrorDomain Code=-609 "Client is disallowed from making such an icon request" UserInfo={NSLocalizedDescription=Client is disallowed from making such an icon request} Connection interrupted, finishing translation with error Error Domain=TranslationErrorDomain Code=14 "(null)" Got response from extension with error: Error Domain=TranslationErrorDomain Code=14 "(null)" Reported that remote UI finished but didn't get finished configuration, reporting the error as: Error Domain=TranslationErrorDomain Code=20 "(null)" VS terminated with error: Error Domain=_UIViewServiceErrorDomain Code=1 "(null)" UserInfo={Terminated=disconnect method} Reported that remote UI finished but didn't get finished configuration, reporting the error as: Error Domain=TranslationErrorDomain Code=14 "(null)" VS terminated with error: Error Domain=_UIViewServiceErrorDomain Code=1 "(null)" UserInfo={Terminated=disconnect method} VS terminated with error: Error Domain=_UIViewServiceErrorDomain Code=1 "(null)" UserInfo={Terminated=disconnect method} VS terminated with error: Error Domain=_UIViewServiceErrorDomain Code=1 "(null)" UserInfo={Terminated=disconnect method} VS terminated with error: Error Domain=_UIViewServiceErrorDomain Code=1 "(null)" UserInfo={Terminated=disconnect method} Trigger the Translation: // check if we need to create a translation configuration if configuration == nil { configuration = TranslationSession.Configuration.init( source: Locale.Language(identifier: sourceLanguageCode), target: Locale.Language(identifier: targetLanguageCode) ) } else { // or just update the target code then invalidate the config to re-trigger the refresh of .translationTask() configuration?.source = Locale.Language(identifier: sourceLanguageCode) configuration?.target = Locale.Language(identifier: targetLanguageCode) configuration?.invalidate() } Prepare and check if Download sheet should be presented: .translationTask(configuration) { session in do { // prepare translation & present API download sheet if lanugage download needed. try await session.prepareTranslation() } catch { print("Translate failed: \(error)") } }
4
0
90
May ’25
.autocorrectionDisabled() not updating with @State variable
Using 'true' or 'false' works as expected and disables Auto Correction: TextEditor(text: $input) .autocorrectionDisabled(true) But when replacing true with a State variable, only the initial value is used. When the state value changes to 'false', the behavior of autocorrect in the TextEditor doesn't re-enable auto correction. Here's a simple View to test out: struct ContentView: View { @State var input = "" @State var autocorrectionDisabled = true var body: some View { VStack { TextEditor(text: $input) .autocorrectionDisabled(autocorrectionDisabled) .font(.headline) Button("Toggle Auto Correction") { autocorrectionDisabled.toggle() print("autocorrectionDisabled: \(autocorrectionDisabled)") } .padding() } .padding() } } Finally, the value was validated via the print() statement output: autocorrectionDisabled: false autocorrectionDisabled: true autocorrectionDisabled: false autocorrectionDisabled: true I'm running this on a physical device with iOS 15 as its our oldest supported target. I'm interested to hear others' results and ideas about how to work around this.
1
0
491
Mar ’24
Include Parameters in AppIntent invocation?
I'd like to build an AppIntent where the parameters are included in the initial invocation. First-party example "Set a timer for 10 minutes" immediately sets new timer using the parameter 10 minutes. Is this possible via AppIntents? Or do we have to invoke with "Set a timer" then give parameters via dialog: "for how long"? with user replying "10 minutes."
1
2
1.2k
Jan ’23