Type ‘Notification.Name’ (aka ‘NSNotification.Name’) has no member ‘UIApplication’
Change forName: Notification.Name.UIApplicationDidEnterBackground to forName: UIApplication.didEnterBackgroundNotification
Change forName: Notification.Name.UIApplicationDidEnterBackground to forName: UIApplication.didEnterBackgroundNotification
Swift 3 & 4 Swift 3, and now Swift 4, have replaced many “stringly-typed” APIs with struct “wrapper types”, as is the case with NotificationCenter. Notifications are now identified by a struct Notfication.Name rather than by String. For more details see the now legacy Migrating to Swift 3 guide Swift 2.2 usage: // Define identifier … Read more