From bf8c97e92bbe340c70db3375922d5df464cd91d9 Mon Sep 17 00:00:00 2001 From: whitepixelstudios Date: Fri, 17 Feb 2017 12:54:25 +1000 Subject: [PATCH] Update Readme, Fix custom alerts, update review URL Update version in podspec to 0.3.0 (Swift 3) Update readme to match podfile Make custom alert closure parameters escaping Review URL: auto-open to write review page --- Armchair.podspec | 4 +++- README.md | 17 ++++++++++++++++- Source/Armchair.swift | 4 ++-- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/Armchair.podspec b/Armchair.podspec index d4fe553..19d7d0a 100644 --- a/Armchair.podspec +++ b/Armchair.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "Armchair" - s.version = "0.1.1" + s.version = "0.3.0" 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,7 @@ Pod::Spec.new do |s| s.ios.deployment_target = '8.0' s.osx.deployment_target = '10.10' s.requires_arc = true + + end diff --git a/README.md b/README.md index fd5259f..abbf2a4 100644 --- a/README.md +++ b/README.md @@ -93,7 +93,22 @@ platform :ios, '8.0' platform :osx, '10.10' use_frameworks! -pod 'Armchair', '>= 0.1' +pod 'Armchair', '>= 0.3' + +#Add the following in order to automatically set debug flags for armchair in debug builds +post_install do |installer| + installer.pods_project.targets.each do |target| + if target.name == 'Armchair' + target.build_configurations.each do |config| + if config.name == 'Debug' + config.build_settings['OTHER_SWIFT_FLAGS'] = '-DDebug' + else + config.build_settings['OTHER_SWIFT_FLAGS'] = '' + end + end + end + end + end ``` Then, run the following command: diff --git a/Source/Armchair.swift b/Source/Armchair.swift index a3a22ac..9e963be 100644 --- a/Source/Armchair.swift +++ b/Source/Armchair.swift @@ -564,7 +564,7 @@ public func rateApp() { */ public typealias ArmchairClosure = () -> () -public typealias ArmchairClosureCustomAlert = (_ rateAppClosure: ArmchairClosure, _ remindLaterClosure: ArmchairClosure, _ noThanksClosure: ArmchairClosure) -> () +public typealias ArmchairClosureCustomAlert = (_ rateAppClosure: @escaping ArmchairClosure, _ remindLaterClosure: @escaping ArmchairClosure, _ noThanksClosure: @escaping ArmchairClosure) -> () public typealias ArmchairAnimateClosure = (Bool) -> () public typealias ArmchairShouldPromptClosure = (ArmchairTrackingInfo) -> Bool public typealias ArmchairShouldIncrementClosure = () -> Bool @@ -749,7 +749,7 @@ open class Manager : ArmchairManager { #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" + 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" #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"