diff --git a/.swift-version b/.swift-version index 5186d07..bf77d54 100644 --- a/.swift-version +++ b/.swift-version @@ -1 +1 @@ -4.0 +4.2 diff --git a/Source/Armchair.swift b/Source/Armchair.swift index 3294106..ee5491d 100644 --- a/Source/Armchair.swift +++ b/Source/Armchair.swift @@ -1261,20 +1261,20 @@ open class Manager : ArmchairManager { } else { /// Didn't show storekit prompt, present app store manually - let alertView : UIAlertController = UIAlertController(title: reviewTitle, message: reviewMessage, preferredStyle: UIAlertControllerStyle.alert) - alertView.addAction(UIAlertAction(title: cancelButtonTitle, style:UIAlertActionStyle.default, handler: { + let alertView : UIAlertController = UIAlertController(title: reviewTitle, message: reviewMessage, preferredStyle: .alert) + alertView.addAction(UIAlertAction(title: rateButtonTitle, style: .default, handler: { (alert: UIAlertAction!) in - self.dontRate() + self._rateApp() })) if (showsRemindButton()) { - alertView.addAction(UIAlertAction(title: remindButtonTitle!, style:UIAlertActionStyle.default, handler: { + alertView.addAction(UIAlertAction(title: remindButtonTitle!, style: .default, handler: { (alert: UIAlertAction!) in self.remindMeLater() })) } - alertView.addAction(UIAlertAction(title: rateButtonTitle, style:UIAlertActionStyle.cancel, handler: { + alertView.addAction(UIAlertAction(title: cancelButtonTitle, style: .cancel, handler: { (alert: UIAlertAction!) in - self._rateApp() + self.dontRate() })) ratingAlert = alertView @@ -1724,11 +1724,11 @@ open class Manager : ArmchairManager { private static func getRootViewController() -> UIViewController? { if var window = UIApplication.shared.keyWindow { - if window.windowLevel != UIWindowLevelNormal { + if window.windowLevel != .normal { let windows: NSArray = UIApplication.shared.windows as NSArray for candidateWindow in windows { if let candidateWindow = candidateWindow as? UIWindow { - if candidateWindow.windowLevel == UIWindowLevelNormal { + if candidateWindow.windowLevel == .normal { window = candidateWindow break } @@ -1834,9 +1834,9 @@ open class Manager : ArmchairManager { fileprivate func setupNotifications() { #if os(iOS) - NotificationCenter.default.addObserver(self, selector: #selector(Manager.appWillResignActive(_:)), name: NSNotification.Name.UIApplicationWillResignActive, object: nil) - NotificationCenter.default.addObserver(self, selector: #selector(Manager.applicationDidFinishLaunching(_:)), name: NSNotification.Name.UIApplicationDidFinishLaunching, object: nil) - NotificationCenter.default.addObserver(self, selector: #selector(Manager.applicationWillEnterForeground(_:)), name: NSNotification.Name.UIApplicationWillEnterForeground, object: nil) + NotificationCenter.default.addObserver(self, selector: #selector(Manager.appWillResignActive(_:)), name: UIApplication.willResignActiveNotification, object: nil) + NotificationCenter.default.addObserver(self, selector: #selector(Manager.applicationDidFinishLaunching(_:)), name: UIApplication.didFinishLaunchingNotification, object: nil) + NotificationCenter.default.addObserver(self, selector: #selector(Manager.applicationWillEnterForeground(_:)), name: UIApplication.willEnterForegroundNotification, object: nil) #elseif os(OSX) NotificationCenter.default.addObserver(self, selector: #selector(Manager.appWillResignActive(_:)), name: NSApplication.willResignActiveNotification, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(Manager.applicationDidFinishLaunching(_:)), name: NSApplication.didFinishLaunchingNotification, object: nil)