Merge remote-tracking branch 'UrbanApps/master'

# Conflicts:
#	Source/Armchair.swift
This commit is contained in:
whitepixelstudios
2017-07-31 11:50:17 +10:00
parent 068c4b92c1
commit ea3ab5ed28
3 changed files with 19 additions and 6 deletions

View File

@@ -28,7 +28,5 @@ Pod::Spec.new do |s|
s.ios.deployment_target = '8.0'
s.osx.deployment_target = '10.10'
s.requires_arc = true
end

View File

@@ -725,7 +725,6 @@
SWIFT_OBJC_BRIDGING_HEADER = "";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
};
name = Debug;
};
@@ -747,7 +746,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_OBJC_BRIDGING_HEADER = "";
SWIFT_VERSION = 2.3;
SWIFT_VERSION = 3.0;
};
name = Release;
};

View File

@@ -69,6 +69,18 @@ public func reviewTitle(_ reviewTitle: String) {
Manager.defaultManager.reviewTitle = reviewTitle
}
/*
* If set to true, use SKStoreReviewController's requestReview() prompt instead of the default prompt.
* If not on iOS 10.3+, reort to the default prompt.
* Default => false.
*/
public func useStoreKitReviewPrompt() -> Bool {
return Manager.defaultManager.useStoreKitReviewPrompt
}
public func useStoreKitReviewPrompt(_ useStoreKitReviewPrompt: Bool) {
Manager.defaultManager.useStoreKitReviewPrompt = useStoreKitReviewPrompt
}
/*
* Get/Set the message to use on the review prompt.
* Default value is a localized
@@ -869,6 +881,7 @@ open class Manager : ArmchairManager {
fileprivate var tintColor: UIColor? = nil
fileprivate lazy var usesAlertController: Bool = self.defaultUsesAlertController()
fileprivate lazy var opensInStoreKit: Bool = self.defaultOpensInStoreKit()
fileprivate var useStoreKitReviewPrompt: Bool = false
fileprivate func defaultOpensInStoreKit() -> Bool {
return operatingSystemVersion >= 8
@@ -1198,7 +1211,7 @@ open class Manager : ArmchairManager {
}
} else {
#if os(iOS)
/* 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: {
(alert: UIAlertAction!) in
@@ -1218,7 +1231,10 @@ open class Manager : ArmchairManager {
// get the top most controller (= the StoreKit Controller) and dismiss it
if let presentingController = UIApplication.shared.keyWindow?.rootViewController {
if let topController = topMostViewController(presentingController) {
topController.present(alertView, animated: usesAnimation) {
topController.present(alertView, animated: usesAnimation) { [weak self] _ in
if let closure = self?.didDisplayAlertClosure {
closure()
}
print("presentViewController() completed")
}
}