In my Swift code to handle push notification I have this line:
if ( application.applicationState == UIApplicationStateInactive || application.applicationState == UIApplicationStateBackground) {
}
Which cause the compilation error: Use of unresolved identifier 'UIApplicationStateInactive'
Am I missing some import files?
Thanks
Currently your are using the identifiers for Objective-C. You need to use the identifier for swift:
UIApplicationState.Inactive // equals UIApplicationStateInactive
UIApplicationState.Background // equals UIApplicationStateBackground
Apple documentation for:
You can check the documentation for both languages in the Apple Documentation and choose the language in the top right corner.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With