Post

Replies

Boosts

Views

Activity

Reply to Swift 6 actor error in didReceiveRemoteNotification of UIApplicationDelegate
@zoha131 Please add @MainActor before the AppDelegate class: @MainActor class AppDelegate: NSObject, UIApplicationDelegate, UNUserNotificationCenterDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { UNUserNotificationCenter.current().delegate = self return true } func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any]) async -> UIBackgroundFetchResult { return .noData } }
Topic: UI Frameworks SubTopic: UIKit Tags:
Aug ’24
Reply to invalid mode 'kCFRunLoopCommonModes'
One way to silence this warning is to: Go into your project's "Edit Scheme..." Select the Run (Debug) option, in the left-hand sidebar. Add a new Environment Variable by clicking on the "+" icon. Enter "OS_ACTIVITY_MODE" (without the quotes) for the name. Enter "disable" (without the quotes) into the value field. Click "Close" and then build and run your app. Please note that this may hide other important info in the console. But, your print messages will still appear, as expected.
Topic: Programming Languages SubTopic: Swift Tags:
Feb ’23
Reply to Swift 6 actor error in didReceiveRemoteNotification of UIApplicationDelegate
Did my answer help you at all zoha131? I'm just curious. Thanks, Mark
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Oct ’24
Reply to Swift 6 actor error in didReceiveRemoteNotification of UIApplicationDelegate
@zoha131 Please add @MainActor before the AppDelegate class: @MainActor class AppDelegate: NSObject, UIApplicationDelegate, UNUserNotificationCenterDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { UNUserNotificationCenter.current().delegate = self return true } func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any]) async -> UIBackgroundFetchResult { return .noData } }
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Aug ’24
Reply to invalid mode 'kCFRunLoopCommonModes'
One way to silence this warning is to: Go into your project's "Edit Scheme..." Select the Run (Debug) option, in the left-hand sidebar. Add a new Environment Variable by clicking on the "+" icon. Enter "OS_ACTIVITY_MODE" (without the quotes) for the name. Enter "disable" (without the quotes) into the value field. Click "Close" and then build and run your app. Please note that this may hide other important info in the console. But, your print messages will still appear, as expected.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Feb ’23