31 Commits
0.3.3 ... 0.3.6

Author SHA1 Message Date
Matt Coneybeare
1ea2201dd3 bump podspec 2018-10-29 15:04:25 -04:00
Matt Coneybeare
fb6e2444be Merge pull request #123 from metasmile/patch-1
add "s.swift_version = '4.2'"
2018-10-04 08:30:36 -04:00
metasmile
ddc5a0d7ea Update Armchair.podspec 2018-10-02 18:21:15 +02:00
Matt Coneybeare
7f05ad9ef6 Merge pull request #122 from bitsfabrik/master
change cancel action style & swift 4.2 changes
2018-09-28 07:55:56 -04:00
BiNo
94817f1715 swift 4.2 fix 2018-09-18 14:05:52 +02:00
BiNo
abeb3eb4b1 Merge branch 'master_original' 2018-09-18 13:56:02 +02:00
Matt Coneybeare
3d9c47bf60 Merge pull request #121 from metasmile/master
Remove Xcode warning forArmchair.swift:720:14
2018-08-31 14:32:13 -04:00
metasmile
fcd99c015a Merge pull request #1 from metasmile/metasmile-patch-1
Remove Xcode warning forArmchair.swift:720:14
2018-08-29 17:41:33 +02:00
metasmile
66fb9abb8d Remove Xcode warning forArmchair.swift:720:14
'let' properties are implicitly 'final'; use 'public' instead of 'open'
2018-08-29 17:40:29 +02:00
Philip Messlehner
d5ba63a0a4 removed duplicate cancel action 2018-07-24 10:38:09 +02:00
Philip Messlehner
44b930169c changed ordering and make use of cancel action 2018-07-24 10:28:57 +02:00
Matt Coneybeare
f7ed2b2063 Merge pull request #119 from mabidakun/Xcode-9.3-Swift-4.1-Fixes
Xcode 9.3 swift 4.1 fixes
2018-04-09 06:40:38 -04:00
Mike O. Abidakun
de6e53da44 Applies Xcode-9.3. Fix-it which adds compile time warnings for the implicit retention of self. 2018-03-30 21:38:58 +01:00
Mike O. Abidakun
ead9ec4656 Replaces code for checking the platform and OS version, with a simplified call that meets the original intent.
The original intent was to check if the code was running in an iOS simulator on an x86 architecture.
This solution was provided by a FixIt in Xcode-9.3.
2018-03-30 21:36:44 +01:00
Mike O. Abidakun
ffd05b16a5 Fixes a compile-time failure caused by referening to the useStoreKitReviewPrompt method, which is no included for macOS. 2018-03-30 21:33:37 +01:00
Matt Coneybeare
a8c1dfdae5 Merge pull request #112 from MartinMoizard/master
Improve iOS 10.3 review dialog support + documentation
2017-11-10 12:16:23 -05:00
Martin Moizard
b3bd6ecc16 Restore func hideRatingAlert() 2017-11-10 17:11:29 +01:00
Matt Coneybeare
773c9c9ddd Merge pull request #111 from 1bannamgiauten/patch-1
missing ; in end of line one
2017-10-29 12:43:59 -04:00
Martin Moizard
90ce675259 Add documentation on new API 2017-10-27 10:53:51 +02:00
Tuan Nguyen
f53bf4637d missing ; in end of line one 2017-10-21 01:12:17 +07:00
Matt Coneybeare
804141486d update podspec 2017-10-11 14:28:33 -04:00
Matt Coneybeare
86bb26031d updated iOS 11 review string template 2017-10-11 12:54:42 -04:00
Matt Coneybeare
74ae451630 updated iOS 11 review string template 2017-10-11 11:46:01 -04:00
Matt Coneybeare
c70e28dd42 Merge branch 'master' of github.com:UrbanApps/Armchair 2017-10-11 11:41:39 -04:00
Matt Coneybeare
04208a6f75 Merge pull request #110 from ArturoLee/master
Rate Button is now Bold
2017-10-05 11:27:07 -04:00
ArturoLee
5c963bda6a UIAlertActionStyle.cancel was assigned to the rate button so it can appear bold.
UIAlertActionStyle.default was assigned to the cancel button so it can have a regular font 2017-10-02 19:41:34 -04:00
Matt Coneybeare
04cb290dc1 updated podspec 2017-09-17 08:23:23 -04:00
whitepixelstudios
adc0a0d580 Update iOS 10.3 review dialog support 2017-07-31 12:25:05 +10:00
whitepixelstudios
dddaa62c25 Changes 2017-07-31 11:52:04 +10:00
whitepixelstudios
ea3ab5ed28 Merge remote-tracking branch 'UrbanApps/master'
# Conflicts:
#	Source/Armchair.swift
2017-07-31 11:50:17 +10:00
whitepixelstudios
068c4b92c1 Remove ios < 9 support [Alertview] 2017-07-31 11:44:12 +10:00
10 changed files with 116 additions and 84 deletions

View File

@@ -1 +1 @@
3.0
4.2

View File

@@ -1,7 +1,7 @@
Pod::Spec.new do |s|
s.name = "Armchair"
s.version = "0.3.2"
s.version = "0.3.6"
s.summary = "A simple yet powerful App Review Manager for iOS and OSX in Swift"
s.description = <<-DESC
A simple yet powerful App Review Manager for iOS and OSX in Swift.
@@ -28,5 +28,6 @@ Pod::Spec.new do |s|
s.ios.deployment_target = '8.0'
s.osx.deployment_target = '10.10'
s.requires_arc = true
s.swift_version = '4.2'
end

View File

@@ -318,7 +318,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0700;
LastUpgradeCheck = 0900;
LastUpgradeCheck = 0930;
ORGANIZATIONNAME = Armchair;
TargetAttributes = {
E6A0AF6419C9CFF400C3A7DC = {
@@ -626,12 +626,14 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
@@ -685,12 +687,14 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0900"
LastUpgradeVersion = "0930"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -26,7 +26,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
@@ -56,7 +55,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0900"
LastUpgradeVersion = "0930"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -26,7 +26,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
@@ -37,7 +36,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"

View File

@@ -1,4 +1,4 @@
"If you enjoy using %@, would you mind taking a moment to rate it? It won't take more than a minute. Thanks for your support!" = "Cảm ơn bạn đã sử dụng ứng dụng %@ trong thời gian qua, bạn có thể dành chút thời gian để đánh giá ứng dụng trong AppStore không? Sẽ không mất quá 1 phút nhưng chúng tôi rất trân trọng điều đó!"
"If you enjoy using %@, would you mind taking a moment to rate it? It won't take more than a minute. Thanks for your support!" = "Cảm ơn bạn đã sử dụng ứng dụng %@ trong thời gian qua, bạn có thể dành chút thời gian để đánh giá ứng dụng trong AppStore không? Sẽ không mất quá 1 phút nhưng chúng tôi rất trân trọng điều đó!";
"Rate %@" = "Đánh giá %@";
"No, Thanks" = "Không, xin cảm ơn";
"Remind me later" = "Hãy nhắc nhở tôi sau";

View File

@@ -161,7 +161,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0700;
LastUpgradeCheck = 0900;
LastUpgradeCheck = 0930;
ORGANIZATIONNAME = Armchair;
TargetAttributes = {
E60FA7B919C908FE00179D70 = {
@@ -289,12 +289,14 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
@@ -342,12 +344,14 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;

View File

@@ -284,6 +284,14 @@ Armchair.shouldPromptIfRated() -> Bool
Armchair.shouldPromptIfRated(shouldPromptIfRated: Bool)
```
The `useStoreKitReviewPrompt` configuration determines wether or not to try showing the SKStoreReviewController's requestReview() prompt instead of the default prompt. This setting has some effects only on iOS version >= 10.3. It's default value is `false`.
```swift
// GETTER
Armchair.useStoreKitReviewPrompt() -> Bool
// SETTER
Armchair.useStoreKitReviewPrompt(useStoreKitReviewPrompt: Bool)
```
The `useMainAppBundleForLocalizations` configuration is a way to tell Armchair that you are providing your own translations for the review prompt popup strings. This may be because you are just customizing them, or that you have set your own text for the popup. If set to `true`, the main bundle will always be used to load localized strings. You have to include the translations either in a file called `ArmchairLocalizable.strings` or the standard `Localizable.strings`. If set to `false` Armchair will look in its own translation bundle for the translating strings. It's default value is `false`.
```swift

View File

@@ -243,6 +243,13 @@ public func shouldPromptIfRated(_ shouldPromptIfRated: Bool) {
Manager.defaultManager.shouldPromptIfRated = shouldPromptIfRated
}
/*
* Return whether Armchair will try and present the Storekit review prompt (useful for custom dialog modification)
*/
public var shouldTryStoreKitReviewPrompt : Bool {
return Manager.defaultManager.shouldTryStoreKitReviewPrompt
}
/*
* If set to true, the main bundle will always be used to load localized strings.
* Set this to true if you have provided your own custom localizations in
@@ -710,7 +717,7 @@ public enum ArmchairKey: String, CustomStringConvertible {
}
open class ArmchairTrackingInfo: CustomStringConvertible {
open let info: Dictionary<ArmchairKey, AnyObject>
public let info: Dictionary<ArmchairKey, AnyObject>
init(info: Dictionary<ArmchairKey, AnyObject>) {
self.info = info
@@ -742,7 +749,7 @@ public struct AppiraterKey {
// MARK: PRIVATE Interface
#if os(iOS)
open class ArmchairManager : NSObject, UIAlertViewDelegate, SKStoreProductViewControllerDelegate { }
open class ArmchairManager : NSObject, SKStoreProductViewControllerDelegate { }
#elseif os(OSX)
open class ArmchairManager : NSObject, NSAlertDelegate { }
#else
@@ -762,8 +769,9 @@ open class Manager : ArmchairManager {
// MARK: Review Alert & Properties
#if os(iOS)
fileprivate var ratingAlert: UIAlertView? = nil
fileprivate let reviewURLTemplate = "itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&onlyLatestVersion=true&pageNumber=0&sortOrdering=1&id=APP_ID&at=AFFILIATE_CODE&ct=AFFILIATE_CAMPAIGN_CODE&action=write-review"
fileprivate var ratingAlert: UIAlertController? = nil
fileprivate let reviewURLTemplate = "itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&onlyLatestVersion=true&pageNumber=0&sortOrdering=1&id=APP_ID&at=AFFILIATE_CODE&ct=AFFILIATE_CAMPAIGN_CODE&action=write-review"
fileprivate let reviewURLTemplateiOS11 = "https://itunes.apple.com/us/app/idAPP_ID?ls=1&mt=8&at=AFFILIATE_CODE&ct=AFFILIATE_CAMPAIGN_CODE&action=write-review"
#elseif os(OSX)
private var ratingAlert: NSAlert? = nil
private let reviewURLTemplate = "macappstore://itunes.apple.com/us/app/idAPP_ID?ls=1&mt=12&at=AFFILIATE_CODE&ct=AFFILIATE_CAMPAIGN_CODE"
@@ -1206,40 +1214,71 @@ open class Manager : ArmchairManager {
return (daysBeforeReminding > 0 && remindButtonTitle != nil)
}
public var shouldTryStoreKitReviewPrompt : Bool {
#if os(iOS)
if #available(iOS 10.3, *), useStoreKitReviewPrompt {
return true
}
#endif
return false
}
fileprivate func requestStoreKitReviewPrompt() -> Bool {
#if os(iOS)
if #available(iOS 10.3, *), useStoreKitReviewPrompt {
SKStoreReviewController.requestReview()
// Assume this version is rated. There is no API to tell if the user actaully rated.
userDefaultsObject?.setBool(true, forKey: keyForArmchairKeyType(ArmchairKey.RatedCurrentVersion))
userDefaultsObject?.setBool(true, forKey: keyForArmchairKeyType(ArmchairKey.RatedAnyVersion))
userDefaultsObject?.synchronize()
closeModalPanel()
return true
}
#endif
return false
}
fileprivate func showRatingAlert() {
if let customClosure = customAlertClosure {
customClosure({[weak self] in self?._rateApp()}, {[weak self] in self?.remindMeLater()}, {[weak self] in self?.dontRate()})
customClosure({[weak self] in
if let result = self?.requestStoreKitReviewPrompt(), result {
///Showed storekit prompt, all done
} else {
/// Didn't show storekit prompt, present app store manually
self?._rateApp()
}
}, {[weak self] in self?.remindMeLater()}, {[weak self] in self?.dontRate()})
if let closure = self.didDisplayAlertClosure {
closure()
}
} else {
#if os(iOS)
if #available(iOS 10.3, *), useStoreKitReviewPrompt {
SKStoreReviewController.requestReview()
// Assume this version is rated. There is no API to tell if the user actaully rated.
userDefaultsObject?.setBool(true, forKey: keyForArmchairKeyType(ArmchairKey.RatedCurrentVersion))
userDefaultsObject?.setBool(true, forKey: keyForArmchairKeyType(ArmchairKey.RatedAnyVersion))
userDefaultsObject?.synchronize()
return
}
if (operatingSystemVersion >= 8 && usesAlertController) || operatingSystemVersion >= 9 {
/* iOS 8 uses new UIAlertController API*/
let alertView : UIAlertController = UIAlertController(title: reviewTitle, message: reviewMessage, preferredStyle: UIAlertControllerStyle.alert)
alertView.addAction(UIAlertAction(title: cancelButtonTitle, style:UIAlertActionStyle.cancel, handler: {
if requestStoreKitReviewPrompt() {
///Showed storekit prompt, all done
} else {
/// Didn't show storekit prompt, present app store manually
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.default, handler: {
alertView.addAction(UIAlertAction(title: cancelButtonTitle, style: .cancel, handler: {
(alert: UIAlertAction!) in
self._rateApp()
self.dontRate()
}))
ratingAlert = alertView
// get the top most controller (= the StoreKit Controller) and dismiss it
if let presentingController = UIApplication.shared.keyWindow?.rootViewController {
if let topController = Manager.topMostViewController(presentingController) {
@@ -1253,25 +1292,6 @@ open class Manager : ArmchairManager {
// note that tint color has to be set after the controller is presented in order to take effect (last checked in iOS 9.3)
alertView.view.tintColor = tintColor
}
} else {
/* Otherwise we use UIAlertView still */
var alertView: UIAlertView
if (showsRemindButton()) {
alertView = UIAlertView(title: reviewTitle, message: reviewMessage, delegate: self, cancelButtonTitle: cancelButtonTitle, otherButtonTitles: remindButtonTitle!, rateButtonTitle)
} else {
alertView = UIAlertView(title: reviewTitle, message: reviewMessage, delegate: self, cancelButtonTitle: cancelButtonTitle, otherButtonTitles: rateButtonTitle)
}
// If we have a remind button, show it first. Otherwise show the rate button
// If we have a remind button, show the rate button next. Otherwise stop adding buttons.
alertView.cancelButtonIndex = -1
ratingAlert = alertView
alertView.show()
if let closure = didDisplayAlertClosure {
closure()
}
}
#elseif os(OSX)
@@ -1309,19 +1329,6 @@ open class Manager : ArmchairManager {
// MARK: PRIVATE Alert View / StoreKit Delegate Methods
#if os(iOS)
open func alertView(_ alertView: UIAlertView, didDismissWithButtonIndex buttonIndex: Int) {
// cancelButtonIndex is set to -1 to show the cancel button up top, but a tap on it ends up here with index 0
if (alertView.cancelButtonIndex == buttonIndex || 0 == buttonIndex) {
// they don't want to rate it
dontRate()
} else if (showsRemindButton() && 1 == buttonIndex) {
// remind them later
remindMeLater()
} else {
// they want to rate it
_rateApp()
}
}
//Delegate call from the StoreKit view.
open func productViewControllerDidFinish(_ viewController: SKStoreProductViewController!) {
@@ -1330,23 +1337,23 @@ open class Manager : ArmchairManager {
//Close the in-app rating (StoreKit) view and restore the previous status bar style.
fileprivate func closeModalPanel() {
let usedAnimation = usesAnimation
if modalPanelOpen {
UIApplication.shared.setStatusBarStyle(currentStatusBarStyle, animated:usesAnimation)
let usedAnimation = usesAnimation
modalPanelOpen = false
// get the top most controller (= the StoreKit Controller) and dismiss it
if let presentingController = UIApplication.shared.keyWindow?.rootViewController {
if let topController = Manager.topMostViewController(presentingController) {
topController.dismiss(animated: usesAnimation) {
if let closure = self.didDismissModalViewClosure {
closure(usedAnimation)
}
}
topController.dismiss(animated: usesAnimation) {}
currentStatusBarStyle = UIStatusBarStyle.default
}
}
}
if let closure = self.didDismissModalViewClosure {
closure(usedAnimation)
}
}
#elseif os(OSX)
@@ -1440,8 +1447,8 @@ open class Manager : ArmchairManager {
UIApplication.shared.openURL(url)
}
}
// Check for iOS simulator
#if (arch(i386) || arch(x86_64)) && os(iOS)
#if targetEnvironment(simulator)
debugLog("iTunes App Store is not supported on the iOS simulator.")
debugLog(" - We would have went to \(reviewURLString()).")
debugLog(" - Try running on a test-device")
@@ -1462,7 +1469,12 @@ open class Manager : ArmchairManager {
}
fileprivate func reviewURLString() -> String {
let template = reviewURLTemplate
#if os(iOS)
let template = operatingSystemVersion >= 11 ? reviewURLTemplateiOS11 : reviewURLTemplate
#elseif os(OSX)
let template = reviewURLTemplate
#else
#endif
var reviewURL = template.replacingOccurrences(of: "APP_ID", with: "\(appID)")
reviewURL = reviewURL.replacingOccurrences(of: "AFFILIATE_CODE", with: "\(affiliateCode)")
reviewURL = reviewURL.replacingOccurrences(of: "AFFILIATE_CAMPAIGN_CODE", with: "\(affiliateCampaignCode)")
@@ -1712,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
}
@@ -1752,8 +1764,11 @@ open class Manager : ArmchairManager {
if let alert = ratingAlert {
debugLog("Hiding Alert")
#if os(iOS)
if alert.isVisible {
alert.dismiss(withClickedButtonIndex: alert.cancelButtonIndex, animated: false)
let isAlertVisible = alert.isViewLoaded && alert.view.window != nil
if isAlertVisible {
alert.dismiss(animated: false, completion: {
self.dontRate()
})
}
#elseif os(OSX)
if let window = NSApplication.shared.keyWindow {
@@ -1761,7 +1776,7 @@ open class Manager : ArmchairManager {
parent.endSheet(window)
}
}
#else
#endif
ratingAlert = nil
@@ -1819,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)

View File

@@ -188,7 +188,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0700;
LastUpgradeCheck = 0900;
LastUpgradeCheck = 0930;
ORGANIZATIONNAME = Armchair;
TargetAttributes = {
F8111E0419A951050040E7D1 = {
@@ -331,12 +331,14 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
@@ -385,12 +387,14 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;