mirror of
https://github.com/UrbanApps/Armchair.git
synced 2026-07-12 07:42:42 +02:00
Merge pull request #122 from bitsfabrik/master
change cancel action style & swift 4.2 changes
This commit is contained in:
+1
-1
@@ -1 +1 @@
|
|||||||
4.0
|
4.2
|
||||||
|
|||||||
+11
-11
@@ -1261,20 +1261,20 @@ open class Manager : ArmchairManager {
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
/// Didn't show storekit prompt, present app store manually
|
/// Didn't show storekit prompt, present app store manually
|
||||||
let alertView : UIAlertController = UIAlertController(title: reviewTitle, message: reviewMessage, preferredStyle: UIAlertControllerStyle.alert)
|
let alertView : UIAlertController = UIAlertController(title: reviewTitle, message: reviewMessage, preferredStyle: .alert)
|
||||||
alertView.addAction(UIAlertAction(title: cancelButtonTitle, style:UIAlertActionStyle.default, handler: {
|
alertView.addAction(UIAlertAction(title: rateButtonTitle, style: .default, handler: {
|
||||||
(alert: UIAlertAction!) in
|
(alert: UIAlertAction!) in
|
||||||
self.dontRate()
|
self._rateApp()
|
||||||
}))
|
}))
|
||||||
if (showsRemindButton()) {
|
if (showsRemindButton()) {
|
||||||
alertView.addAction(UIAlertAction(title: remindButtonTitle!, style:UIAlertActionStyle.default, handler: {
|
alertView.addAction(UIAlertAction(title: remindButtonTitle!, style: .default, handler: {
|
||||||
(alert: UIAlertAction!) in
|
(alert: UIAlertAction!) in
|
||||||
self.remindMeLater()
|
self.remindMeLater()
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
alertView.addAction(UIAlertAction(title: rateButtonTitle, style:UIAlertActionStyle.cancel, handler: {
|
alertView.addAction(UIAlertAction(title: cancelButtonTitle, style: .cancel, handler: {
|
||||||
(alert: UIAlertAction!) in
|
(alert: UIAlertAction!) in
|
||||||
self._rateApp()
|
self.dontRate()
|
||||||
}))
|
}))
|
||||||
|
|
||||||
ratingAlert = alertView
|
ratingAlert = alertView
|
||||||
@@ -1724,11 +1724,11 @@ open class Manager : ArmchairManager {
|
|||||||
private static func getRootViewController() -> UIViewController? {
|
private static func getRootViewController() -> UIViewController? {
|
||||||
if var window = UIApplication.shared.keyWindow {
|
if var window = UIApplication.shared.keyWindow {
|
||||||
|
|
||||||
if window.windowLevel != UIWindowLevelNormal {
|
if window.windowLevel != .normal {
|
||||||
let windows: NSArray = UIApplication.shared.windows as NSArray
|
let windows: NSArray = UIApplication.shared.windows as NSArray
|
||||||
for candidateWindow in windows {
|
for candidateWindow in windows {
|
||||||
if let candidateWindow = candidateWindow as? UIWindow {
|
if let candidateWindow = candidateWindow as? UIWindow {
|
||||||
if candidateWindow.windowLevel == UIWindowLevelNormal {
|
if candidateWindow.windowLevel == .normal {
|
||||||
window = candidateWindow
|
window = candidateWindow
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@@ -1834,9 +1834,9 @@ open class Manager : ArmchairManager {
|
|||||||
|
|
||||||
fileprivate func setupNotifications() {
|
fileprivate func setupNotifications() {
|
||||||
#if os(iOS)
|
#if os(iOS)
|
||||||
NotificationCenter.default.addObserver(self, selector: #selector(Manager.appWillResignActive(_:)), name: NSNotification.Name.UIApplicationWillResignActive, object: nil)
|
NotificationCenter.default.addObserver(self, selector: #selector(Manager.appWillResignActive(_:)), name: UIApplication.willResignActiveNotification, object: nil)
|
||||||
NotificationCenter.default.addObserver(self, selector: #selector(Manager.applicationDidFinishLaunching(_:)), name: NSNotification.Name.UIApplicationDidFinishLaunching, object: nil)
|
NotificationCenter.default.addObserver(self, selector: #selector(Manager.applicationDidFinishLaunching(_:)), name: UIApplication.didFinishLaunchingNotification, object: nil)
|
||||||
NotificationCenter.default.addObserver(self, selector: #selector(Manager.applicationWillEnterForeground(_:)), name: NSNotification.Name.UIApplicationWillEnterForeground, object: nil)
|
NotificationCenter.default.addObserver(self, selector: #selector(Manager.applicationWillEnterForeground(_:)), name: UIApplication.willEnterForegroundNotification, object: nil)
|
||||||
#elseif os(OSX)
|
#elseif os(OSX)
|
||||||
NotificationCenter.default.addObserver(self, selector: #selector(Manager.appWillResignActive(_:)), name: NSApplication.willResignActiveNotification, object: nil)
|
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)
|
NotificationCenter.default.addObserver(self, selector: #selector(Manager.applicationDidFinishLaunching(_:)), name: NSApplication.didFinishLaunchingNotification, object: nil)
|
||||||
|
|||||||
Reference in New Issue
Block a user