Post

Replies

Boosts

Views

Activity

Reply to SwiftData with CloudKit Error: Error updating background task request
@DTS Engineer Ziqiao Chen, As a developer it is quite hard to keep a note of which error to ignore and which ones to act on. If it can be ignored then it shouldn't be thrown in the first place. As we start to ignore these errors, the general tendency for the developers is not to pay attention to any errors thrown by Apple frameworks. So please fix it, I have raised the feedback FB22670054
Topic: App & System Services SubTopic: iCloud Tags:
Sep ’26
Reply to #Predicate needs better validation
@DTS Engineer Is there any documentation on what kind of predicates are not supported by Swift Data? I discovered a new crash: crashed due to an uncaught exception `NSInvalidArgumentException`. Reason: Unsupported function expression TERNARY(department != nil, department.school, nil).identifier. I am really worried as I don't know if other crashes would only discovered at runtime. At least with NSPredicate we knew we were dealing with SQL, now Predicate tries to mask that and it fails at runtime. My suggestion: Please have some proper documentation of what kind of predicate is allowed and what is not allowed in Swift Data Please use compiler validation or build a completely different type The approach of using a generic predicate allowing all valid swift statements inside a predicate falls short at runtime. Current Predicate implementation gives a false sense of security
Sep ’26
Reply to In App Purchase Sandbox Testing - Clear Purchase History Not Working
@Rabadash8820 Feedback links are only accessible by Apple Engineers and the person who created the feedback. Yes this is experienced by many, I hope this gets the attention of some Apple Engineers. This is such a critical feature to test and yet, either we are doing something wrong or is broken. If you don't mind could you also file a feedback, on your mac go to Feedback Assistant app and file a feedback and post the Feedback ID here.
Topic: App & System Services SubTopic: StoreKit Tags:
Aug ’26
Reply to String catalog for app target and widget target and common code
@Developer Tools Engineer wow this is so cool! Thank you so much for your guidance!! As per Use generated localizable symbols in your code The following works: Create a String Catalog file called Common.xcstrings Edit Common.xcstrings to add a symbol dog (This should be a symbol and not a string, by default it was creating as a symbol) Now in SwiftUI it can be used as Text(.Common.dog) It's really cool that these static properties are created automatically.
Aug ’26
Reply to String catalog for app target and widget target and common code
Thanks a lot @Developer Tools Engineer, I liked your suggestion of starting with 1st approach and then taking it on from there. I have a few questions: Point 3 Questions: For the shared code creating custom table name, so in code I would need to use the custom table name explicitly? So doing so the same string will not be generated in the default Localizable.xcstrings file of the app?
Aug ’26
Reply to #Predicate needs better validation
Thanks a lot @DTS Engineer Ziqiao Chen for that clear explanation. The last sentence you mention is key and very valid: I'd go further to make it a rule: Inside the closure of #Predicate, use if let only for unwrapping optional persistent properties of the model; move external parameter branching in Swift outside of the macro. I am no expert but given below are my thoughts: Predicate can be used in SwiftData and outside SwiftData for filtering. There is a problem with this approach there are some restrictions with using it in SwiftData with which you pointed out and many more that aren't allowed. I feel it is better to provide another a predicate type (sample name: DataPredicate) specifically for SwiftData. This would be better because DataPredicate can have more restrictions at compile time by not allowing optional values and other rules. The current approach often catches most programmers off guard primarily because on the surface it offers some compile time checks and lacks some which are caught at runtime. Separate type would allow Apple to add more safety to DataPredicate to allow only what can be translated into SQL / valid commands under the hood at the same time keeping Predicate as it is. On a side note: Please provide feature parity with NSPredicate, currently Predicate doesn't support regex is there a way / workaround to use regex in Swift Data predicate?
Aug ’26
Reply to Widget Extension still uses system language even though CFBundleAllowMixedLocalizations = NO is set
@Seongkue I am no expert on this and I haven't tried this on widgets. Generally while using Swift Packages that contains localization, you could use the following code inside the swift package: String(localized: "hello", bundle: .module) I hadn't changed CFBundleAllowMixedLocalizations and it worked fine. .module will pick from it is being called from. See if it works for you.
Aug ’26
Reply to Xcode 27: Bugs / Feedbacks
@DTS Engineer Xcode 27 Beta 5 seems to crash quite often, I think it happens when I edit code. I think SwiftUI preview was trying to render while I was editing. I have submitted the crash reports, by clicking Send to Apple button on the crash report. Hopefully they can be fixed, Xcode 27 Beta 4 didn't crash like this, seems to be happening on Xcode 27 Beta 5.
Aug ’26
Reply to How to observe calendar changes by using NotificationCenter.messages(of: for:)?
Thanks @DTS Engineer Albert, however my scenario is a bit more complex. My scenario I would like to debounce (AsyncAlgorithms) on the notifications However that will not compile using .notifications(named:) It will throw the error Conformance of 'Notification' to 'Sendable' is unavailable in iOS Code that doesn't compile import EventKit import AsyncAlgorithms func f1() async { let center = NotificationCenter.default let notifications = center.notifications(named: .EKEventStoreChanged) // Error: Conformance of 'Notification' to 'Sendable' is unavailable in iOS for await notification in notifications.debounce(for: .seconds(2)) { // Do something } } My understanding So in this case I would need to use messages(of:for:) to be able to debounce This is the reason why messages(of:for:) exists to cater to such scenarios. Problem There is a public API from Apple for messages and as per documentation https://developer.apple.com/documentation/foundation/notificationcenter/messageidentifier/changed-50yz5 However I can't get it to work. Questions Since .changed is available on the API as an option for EventKit store changes (refer documentation link above), is this an unfinished implementation / bug from Foundation / EventKit framework? Can you please fix it or provide a workaround?
Topic: App & System Services SubTopic: General Tags:
Aug ’26
Reply to SwiftData with CloudKit Error: Error updating background task request
@DTS Engineer Ziqiao Chen, As a developer it is quite hard to keep a note of which error to ignore and which ones to act on. If it can be ignored then it shouldn't be thrown in the first place. As we start to ignore these errors, the general tendency for the developers is not to pay attention to any errors thrown by Apple frameworks. So please fix it, I have raised the feedback FB22670054
Topic: App & System Services SubTopic: iCloud Tags:
Replies
Boosts
Views
Activity
Sep ’26
Reply to Xcode 27: Bugs / Feedbacks
@DTS Engineer Looks Xcode 27 RC doesn't have the ability to change the dynamic type size while running the app in the simulator. This option seems to be missing Feedback: FB24732018 Please let me know if there is a workaround.
Replies
Boosts
Views
Activity
Sep ’26
Reply to #Predicate needs better validation
@DTS Engineer Is there any documentation on what kind of predicates are not supported by Swift Data? I discovered a new crash: crashed due to an uncaught exception `NSInvalidArgumentException`. Reason: Unsupported function expression TERNARY(department != nil, department.school, nil).identifier. I am really worried as I don't know if other crashes would only discovered at runtime. At least with NSPredicate we knew we were dealing with SQL, now Predicate tries to mask that and it fails at runtime. My suggestion: Please have some proper documentation of what kind of predicate is allowed and what is not allowed in Swift Data Please use compiler validation or build a completely different type The approach of using a generic predicate allowing all valid swift statements inside a predicate falls short at runtime. Current Predicate implementation gives a false sense of security
Replies
Boosts
Views
Activity
Sep ’26
Reply to In App Purchase Sandbox Testing - Clear Purchase History Not Working
@Rabadash8820 Feedback links are only accessible by Apple Engineers and the person who created the feedback. Yes this is experienced by many, I hope this gets the attention of some Apple Engineers. This is such a critical feature to test and yet, either we are doing something wrong or is broken. If you don't mind could you also file a feedback, on your mac go to Feedback Assistant app and file a feedback and post the Feedback ID here.
Topic: App & System Services SubTopic: StoreKit Tags:
Replies
Boosts
Views
Activity
Aug ’26
Reply to String catalog for app target and widget target and common code
@Developer Tools Engineer wow this is so cool! Thank you so much for your guidance!! As per Use generated localizable symbols in your code The following works: Create a String Catalog file called Common.xcstrings Edit Common.xcstrings to add a symbol dog (This should be a symbol and not a string, by default it was creating as a symbol) Now in SwiftUI it can be used as Text(.Common.dog) It's really cool that these static properties are created automatically.
Replies
Boosts
Views
Activity
Aug ’26
Reply to String catalog for app target and widget target and common code
Thanks a lot @Developer Tools Engineer, I liked your suggestion of starting with 1st approach and then taking it on from there. I have a few questions: Point 3 Questions: For the shared code creating custom table name, so in code I would need to use the custom table name explicitly? So doing so the same string will not be generated in the default Localizable.xcstrings file of the app?
Replies
Boosts
Views
Activity
Aug ’26
Reply to #Predicate needs better validation
Thanks a lot @DTS Engineer Ziqiao Chen for that clear explanation. The last sentence you mention is key and very valid: I'd go further to make it a rule: Inside the closure of #Predicate, use if let only for unwrapping optional persistent properties of the model; move external parameter branching in Swift outside of the macro. I am no expert but given below are my thoughts: Predicate can be used in SwiftData and outside SwiftData for filtering. There is a problem with this approach there are some restrictions with using it in SwiftData with which you pointed out and many more that aren't allowed. I feel it is better to provide another a predicate type (sample name: DataPredicate) specifically for SwiftData. This would be better because DataPredicate can have more restrictions at compile time by not allowing optional values and other rules. The current approach often catches most programmers off guard primarily because on the surface it offers some compile time checks and lacks some which are caught at runtime. Separate type would allow Apple to add more safety to DataPredicate to allow only what can be translated into SQL / valid commands under the hood at the same time keeping Predicate as it is. On a side note: Please provide feature parity with NSPredicate, currently Predicate doesn't support regex is there a way / workaround to use regex in Swift Data predicate?
Replies
Boosts
Views
Activity
Aug ’26
Reply to Widget Extension still uses system language even though CFBundleAllowMixedLocalizations = NO is set
@Seongkue I am no expert on this and I haven't tried this on widgets. Generally while using Swift Packages that contains localization, you could use the following code inside the swift package: String(localized: "hello", bundle: .module) I hadn't changed CFBundleAllowMixedLocalizations and it worked fine. .module will pick from it is being called from. See if it works for you.
Replies
Boosts
Views
Activity
Aug ’26
Reply to Xcode 27: Bugs / Feedbacks
@DTS Engineer Xcode 27 Beta 5 seems to crash quite often, I think it happens when I edit code. I think SwiftUI preview was trying to render while I was editing. I have submitted the crash reports, by clicking Send to Apple button on the crash report. Hopefully they can be fixed, Xcode 27 Beta 4 didn't crash like this, seems to be happening on Xcode 27 Beta 5.
Replies
Boosts
Views
Activity
Aug ’26
Reply to Unable to sign into sandbox account on simulator / device hub
Thanks @App Store Commerce Engineer Just to clarify do you mean the following: Testing the app on the simulator would require using the StoreKit local configuration file? Testcases would also require using the StoreKit local configuration file? Can you also please have a look at the following: FB23078234 - StoreKit Clear Purchase History doesn't work
Replies
Boosts
Views
Activity
Aug ’26
Reply to How to observe calendar changes by using NotificationCenter.messages(of: for:)?
Thanks @DTS Engineer Albert, however my scenario is a bit more complex. My scenario I would like to debounce (AsyncAlgorithms) on the notifications However that will not compile using .notifications(named:) It will throw the error Conformance of 'Notification' to 'Sendable' is unavailable in iOS Code that doesn't compile import EventKit import AsyncAlgorithms func f1() async { let center = NotificationCenter.default let notifications = center.notifications(named: .EKEventStoreChanged) // Error: Conformance of 'Notification' to 'Sendable' is unavailable in iOS for await notification in notifications.debounce(for: .seconds(2)) { // Do something } } My understanding So in this case I would need to use messages(of:for:) to be able to debounce This is the reason why messages(of:for:) exists to cater to such scenarios. Problem There is a public API from Apple for messages and as per documentation https://developer.apple.com/documentation/foundation/notificationcenter/messageidentifier/changed-50yz5 However I can't get it to work. Questions Since .changed is available on the API as an option for EventKit store changes (refer documentation link above), is this an unfinished implementation / bug from Foundation / EventKit framework? Can you please fix it or provide a workaround?
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Aug ’26