Post

Replies

Boosts

Views

Activity

Reply to Implement UNUserNotificationCenterDelegate in iOS app using Swift6
My hunch is that the UNUserNotificationCenter code hasn't gotten the Swift 6/strict concurrency checking treatment by Apple yet. I encountered a similar problem with QLPreviewControllerDelegate and learned of a syntax where you can prepend @preconcurrency to the protocol conformance: final class NotificationServiceDelegate: UIResponder, UIApplicationDelegate, @preconcurrency UNUserNotificationCenterDelegate ... This will let you remove the nonisolated from the protocol methods and fix (or at least silence) the error. A side note for those reading, you'll want to use the async versions of User Notification methods in Swift 6 code where available. The completion-handler-based methods can crash with a __dispatch_queue_assert assertion.
Feb ’25
Reply to Implement UNUserNotificationCenterDelegate in iOS app using Swift6
My hunch is that the UNUserNotificationCenter code hasn't gotten the Swift 6/strict concurrency checking treatment by Apple yet. I encountered a similar problem with QLPreviewControllerDelegate and learned of a syntax where you can prepend @preconcurrency to the protocol conformance: final class NotificationServiceDelegate: UIResponder, UIApplicationDelegate, @preconcurrency UNUserNotificationCenterDelegate ... This will let you remove the nonisolated from the protocol methods and fix (or at least silence) the error. A side note for those reading, you'll want to use the async versions of User Notification methods in Swift 6 code where available. The completion-handler-based methods can crash with a __dispatch_queue_assert assertion.
Replies
Boosts
Views
Activity
Feb ’25