Swift Use of unresolved identifier 'UIApplicationStateInactive'
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: Swift