mirror of
https://github.com/UrbanApps/Armchair.git
synced 2026-01-11 22:30:50 +01:00
Compare commits
108 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b92da20460 | ||
|
|
c54a35059c | ||
|
|
fedb19b8a7 | ||
|
|
51eca2a931 | ||
|
|
b22a605285 | ||
|
|
118a777ff2 | ||
|
|
690bf6be67 | ||
|
|
1ea2201dd3 | ||
|
|
fb6e2444be | ||
|
|
ddc5a0d7ea | ||
|
|
7f05ad9ef6 | ||
|
|
94817f1715 | ||
|
|
abeb3eb4b1 | ||
|
|
3d9c47bf60 | ||
|
|
fcd99c015a | ||
|
|
66fb9abb8d | ||
|
|
d5ba63a0a4 | ||
|
|
44b930169c | ||
|
|
f7ed2b2063 | ||
|
|
de6e53da44 | ||
|
|
ead9ec4656 | ||
|
|
ffd05b16a5 | ||
|
|
a8c1dfdae5 | ||
|
|
b3bd6ecc16 | ||
|
|
773c9c9ddd | ||
|
|
90ce675259 | ||
|
|
f53bf4637d | ||
|
|
804141486d | ||
|
|
86bb26031d | ||
|
|
74ae451630 | ||
|
|
c70e28dd42 | ||
|
|
04208a6f75 | ||
|
|
5c963bda6a | ||
|
|
04cb290dc1 | ||
|
|
a4f97f92c3 | ||
|
|
dfb230dcd2 | ||
|
|
87d68ec2a7 | ||
|
|
3c95c3df2d | ||
|
|
eaebe860da | ||
|
|
2bdd30f9ed | ||
|
|
adc0a0d580 | ||
|
|
dddaa62c25 | ||
|
|
ea3ab5ed28 | ||
|
|
068c4b92c1 | ||
|
|
ee3d999eb3 | ||
|
|
cc623a0157 | ||
|
|
0db2bb6fb0 | ||
|
|
6163929275 | ||
|
|
1949d8f07e | ||
|
|
7299a7067a | ||
|
|
f9736d6273 | ||
|
|
14c89be4b9 | ||
|
|
2389058301 | ||
|
|
8f0888670a | ||
|
|
10695e5df6 | ||
|
|
bf8c97e92b | ||
|
|
1807313d35 | ||
|
|
ef24da44d5 | ||
|
|
b9b50559aa | ||
|
|
8384be5c1e | ||
|
|
61f124d82c | ||
|
|
24b4f4ab8f | ||
|
|
a717880f55 | ||
|
|
ffb40f4d14 | ||
|
|
bdcacffcb4 | ||
|
|
d57ed6802a | ||
|
|
d8bc619f3c | ||
|
|
b5270a4892 | ||
|
|
44b876e0a5 | ||
|
|
9104458f49 | ||
|
|
0a73212e72 | ||
|
|
556b57cabe | ||
|
|
96f70c8bdf | ||
|
|
586ef9e215 | ||
|
|
2a1d87665b | ||
|
|
dd81a54a77 | ||
|
|
3f78915843 | ||
|
|
e1d6e23ef7 | ||
|
|
43d2b0d4ef | ||
|
|
0ea672f4d5 | ||
|
|
cc3706ca07 | ||
|
|
e7a93e08e7 | ||
|
|
674f044a43 | ||
|
|
9f00619483 | ||
|
|
fd361253d8 | ||
|
|
051e0d2f10 | ||
|
|
202c1701c5 | ||
|
|
4e03a1d725 | ||
|
|
93ae5bf93a | ||
|
|
813de6e889 | ||
|
|
e1de2361bf | ||
|
|
7feeafba9d | ||
|
|
a0fe19a2fd | ||
|
|
6b8e8915ea | ||
|
|
8d5ae9e3d5 | ||
|
|
7e8b62a07e | ||
|
|
be83189c67 | ||
|
|
73b50357d9 | ||
|
|
8e747575a5 | ||
|
|
6ef0ad4811 | ||
|
|
a806177a1b | ||
|
|
304380a9ac | ||
|
|
2f7b70cb0d | ||
|
|
5a4d1da0b5 | ||
|
|
7b5477469a | ||
|
|
7a76f714c4 | ||
|
|
ef3f7e6f63 | ||
|
|
ce4d4a42ff |
1
.swift-version
Normal file
1
.swift-version
Normal file
@@ -0,0 +1 @@
|
||||
5.0
|
||||
@@ -1,7 +1,7 @@
|
||||
Pod::Spec.new do |s|
|
||||
|
||||
s.name = "Armchair"
|
||||
s.version = "0.1.1"
|
||||
s.version = "0.3.7"
|
||||
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.
|
||||
@@ -22,11 +22,12 @@ Pod::Spec.new do |s|
|
||||
s.source = { :git => 'https://github.com/UrbanApps/Armchair.git', :tag => s.version }
|
||||
|
||||
s.license = { :type => "MIT", :file => "LICENSE" }
|
||||
|
||||
|
||||
s.source_files = "Source/*.{h,swift}"
|
||||
s.resources = "Localization/*.lproj"
|
||||
s.ios.deployment_target = '8.0'
|
||||
s.osx.deployment_target = '10.10'
|
||||
s.requires_arc = true
|
||||
|
||||
s.swift_version = '5.0'
|
||||
|
||||
end
|
||||
|
||||
@@ -318,23 +318,29 @@
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastSwiftUpdateCheck = 0700;
|
||||
LastUpgradeCheck = 0700;
|
||||
LastUpgradeCheck = 1100;
|
||||
ORGANIZATIONNAME = Armchair;
|
||||
TargetAttributes = {
|
||||
E6A0AF6419C9CFF400C3A7DC = {
|
||||
CreatedOnToolsVersion = 6.0;
|
||||
ProvisioningStyle = Manual;
|
||||
};
|
||||
E6D8B8EF19C756A4001AD043 = {
|
||||
LastSwiftMigration = 1100;
|
||||
};
|
||||
F8111E3219A95C8B0040E7D1 = {
|
||||
CreatedOnToolsVersion = 6.0;
|
||||
LastSwiftMigration = 1100;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = F8111E2D19A95C8B0040E7D1 /* Build configuration list for PBXProject "Armchair" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
developmentRegion = English;
|
||||
developmentRegion = en;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
Base,
|
||||
);
|
||||
mainGroup = F8111E2919A95C8B0040E7D1;
|
||||
productRefGroup = F8111E2919A95C8B0040E7D1;
|
||||
@@ -482,6 +488,7 @@
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
@@ -503,6 +510,7 @@
|
||||
buildSettings = {
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
DEVELOPMENT_TEAM = "";
|
||||
INFOPLIST_FILE = "Source/Info-Localizable.plist";
|
||||
INSTALL_PATH = "";
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.10;
|
||||
@@ -527,7 +535,7 @@
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
INFOPLIST_FILE = "$(SRCROOT)/Source/Info.plist";
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 7.1;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.10;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.armchair.$(PRODUCT_NAME:rfc1034identifier)";
|
||||
@@ -537,6 +545,8 @@
|
||||
SKIP_INSTALL = YES;
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "";
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
|
||||
SWIFT_VERSION = 5.0;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
@@ -552,7 +562,7 @@
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
INFOPLIST_FILE = "$(SRCROOT)/Source/Info.plist";
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 7.1;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.10;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.armchair.$(PRODUCT_NAME:rfc1034identifier)";
|
||||
@@ -561,6 +571,8 @@
|
||||
SDKROOT = macosx;
|
||||
SKIP_INSTALL = YES;
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "";
|
||||
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
|
||||
SWIFT_VERSION = 5.0;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
@@ -607,17 +619,28 @@
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
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;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
@@ -627,6 +650,7 @@
|
||||
ENABLE_TESTABILITY = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
@@ -646,6 +670,7 @@
|
||||
OTHER_SWIFT_FLAGS = "-DDebug";
|
||||
SDKROOT = iphoneos;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
SWIFT_VERSION = 4.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
VERSION_INFO_PREFIX = "";
|
||||
@@ -656,17 +681,28 @@
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
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;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
@@ -675,6 +711,7 @@
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
@@ -685,6 +722,8 @@
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.9;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = iphoneos;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
||||
SWIFT_VERSION = 4.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
@@ -696,7 +735,9 @@
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
|
||||
DEFINES_MODULE = YES;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
@@ -709,6 +750,7 @@
|
||||
SKIP_INSTALL = YES;
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "";
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
SWIFT_VERSION = 5.0;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
@@ -716,7 +758,9 @@
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
|
||||
DEFINES_MODULE = YES;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
@@ -728,6 +772,7 @@
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SKIP_INSTALL = YES;
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "";
|
||||
SWIFT_VERSION = 5.0;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0710"
|
||||
LastUpgradeVersion = "1100"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
@@ -27,6 +27,15 @@
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "F8111E3219A95C8B0040E7D1"
|
||||
BuildableName = "Armchair.framework"
|
||||
BlueprintName = "Armchair"
|
||||
ReferencedContainer = "container:Armchair.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<Testables>
|
||||
<TestableReference
|
||||
skipped = "NO">
|
||||
@@ -39,17 +48,6 @@
|
||||
</BuildableReference>
|
||||
</TestableReference>
|
||||
</Testables>
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "F8111E3219A95C8B0040E7D1"
|
||||
BuildableName = "Armchair.framework"
|
||||
BlueprintName = "Armchair"
|
||||
ReferencedContainer = "container:Armchair.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
@@ -70,8 +68,6 @@
|
||||
ReferencedContainer = "container:Armchair.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0710"
|
||||
LastUpgradeVersion = "1100"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
@@ -29,8 +29,6 @@
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
@@ -51,8 +49,6 @@
|
||||
ReferencedContainer = "container:Armchair.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IDEDidComputeMac32BitWarning</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -28,12 +28,13 @@
|
||||
class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
var window: UIWindow?
|
||||
|
||||
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
|
||||
func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
|
||||
AppDelegate.setupArmchair()
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
let Pages = "361309726" // Pages iOS
|
||||
let appID = "361309726" // Pages iOS
|
||||
|
||||
#elseif os(OSX)
|
||||
|
||||
@@ -43,9 +44,12 @@
|
||||
class AppDelegate: NSObject, NSApplicationDelegate {
|
||||
@IBOutlet weak var window: NSWindow!
|
||||
|
||||
override init() {
|
||||
AppDelegate.setupArmchair()
|
||||
}
|
||||
}
|
||||
|
||||
let Pages = "409201541" // Pages Mac
|
||||
let appID = "409201541" // Pages Mac
|
||||
|
||||
#else
|
||||
#endif
|
||||
@@ -54,10 +58,6 @@ import Armchair
|
||||
|
||||
extension AppDelegate {
|
||||
|
||||
override class func initialize() {
|
||||
AppDelegate.setupArmchair()
|
||||
}
|
||||
|
||||
class func setupArmchair() {
|
||||
// Normally, all the setup would be here.
|
||||
// But, because we are presenting a few different setups in the example,
|
||||
@@ -68,7 +68,7 @@ extension AppDelegate {
|
||||
// because it needs to receive application life-cycle notifications
|
||||
//
|
||||
// NOTE: The appID call always has to go before any other Armchair calls
|
||||
Armchair.appID(Pages)
|
||||
Armchair.appID(appID)
|
||||
Armchair.debugEnabled(true)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,15 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "20x20",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "20x20",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "29x29",
|
||||
@@ -30,6 +40,16 @@
|
||||
"size" : "60x60",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "20x20",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "20x20",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "29x29",
|
||||
@@ -59,6 +79,16 @@
|
||||
"idiom" : "ipad",
|
||||
"size" : "76x76",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "83.5x83.5",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ios-marketing",
|
||||
"size" : "1024x1024",
|
||||
"scale" : "1x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
|
||||
@@ -55,12 +55,12 @@ extension ViewController {
|
||||
|
||||
// Only set it if we are using Armchair localizations
|
||||
if !Armchair.useMainAppBundleForLocalizations() {
|
||||
let currentLocalization: NSString = NSBundle.mainBundle().preferredLocalizations[0] as NSString
|
||||
let currentLocalization: NSString = Bundle.main.preferredLocalizations[0] as NSString
|
||||
// Only set it if we are using a different language than this apps development language
|
||||
if let developmentLocalization = NSBundle.mainBundle().developmentLocalization {
|
||||
if currentLocalization != developmentLocalization {
|
||||
if let developmentLocalization = Bundle.main.developmentLocalization {
|
||||
if currentLocalization as String != developmentLocalization {
|
||||
languageLabelText = currentLocalization as String
|
||||
if let displayName = NSLocale(localeIdentifier: currentLocalization as String).displayNameForKey(NSLocaleIdentifier, value:currentLocalization) {
|
||||
if let displayName = (Locale(identifier: currentLocalization as String) as NSLocale).displayName(forKey: NSLocale.Key.identifier, value:currentLocalization) {
|
||||
languageLabelText = "\(displayName): \(currentLocalization)"
|
||||
}
|
||||
}
|
||||
@@ -78,7 +78,7 @@ extension ViewController {
|
||||
resetAppReviewManager()
|
||||
|
||||
// The AppID is the only required setup
|
||||
Armchair.appID(Pages)
|
||||
Armchair.appID(appID)
|
||||
|
||||
// Debug means that it will popup on the next available change
|
||||
Armchair.debugEnabled(true)
|
||||
@@ -96,7 +96,7 @@ extension ViewController {
|
||||
resetAppReviewManager()
|
||||
|
||||
// The AppID is the only required setup
|
||||
Armchair.appID(Pages)
|
||||
Armchair.appID(appID)
|
||||
|
||||
// Debug means that it will popup on the next available change
|
||||
Armchair.debugEnabled(true)
|
||||
@@ -141,6 +141,9 @@ extension ViewController {
|
||||
#if os(iOS)
|
||||
// Explicitly disable the storeKit as the default may be true if on iOS 8
|
||||
Armchair.opensInStoreKit(false)
|
||||
|
||||
// This sets a custom tint color (applies only to UIAlertController).
|
||||
Armchair.tintColor(tintColor: UIColor.brown)
|
||||
#endif
|
||||
|
||||
// This sets the Affiliate code you want to use, but is not required.
|
||||
@@ -190,7 +193,7 @@ extension ViewController {
|
||||
resetAppReviewManager()
|
||||
|
||||
// The AppID is the only required setup
|
||||
Armchair.appID(Pages)
|
||||
Armchair.appID(appID)
|
||||
|
||||
// Debug means that it will popup on the next available change
|
||||
Armchair.debugEnabled(true)
|
||||
@@ -213,11 +216,11 @@ extension ViewController {
|
||||
}
|
||||
|
||||
@IBAction func openUrbanApps(_: AnyObject) {
|
||||
if let url = NSURL(string: "http://urbanapps.com") {
|
||||
if let url = URL(string: "http://urbanapps.com") {
|
||||
#if os(iOS)
|
||||
UIApplication.sharedApplication().openURL(url)
|
||||
UIApplication.shared.openURL(url)
|
||||
#elseif os(OSX)
|
||||
NSWorkspace.sharedWorkspace().openURL(url)
|
||||
NSWorkspace.shared.open(url)
|
||||
#else
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -33,13 +33,6 @@
|
||||
remoteGlobalIDString = E6D8B8F919C756A4001AD043;
|
||||
remoteInfo = ArmchairMac;
|
||||
};
|
||||
E60FA80119C90D3500179D70 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = E60FA7F719C90D3500179D70 /* Armchair.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = E6D8B92819C880A9001AD043;
|
||||
remoteInfo = ArmchairTests;
|
||||
};
|
||||
E60FA80319C90D7100179D70 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = E60FA7F719C90D3500179D70 /* Armchair.xcodeproj */;
|
||||
@@ -135,7 +128,6 @@
|
||||
E60FA80019C90D3500179D70 /* Armchair.framework */,
|
||||
E6F6156919C9FE8900C0B51C /* Armchair.bundle */,
|
||||
E6F6159819CA003600C0B51C /* Armchair.bundle */,
|
||||
E60FA80219C90D3500179D70 /* ArmchairTests.xctest */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
@@ -169,17 +161,18 @@
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastSwiftUpdateCheck = 0700;
|
||||
LastUpgradeCheck = 0700;
|
||||
LastUpgradeCheck = 1100;
|
||||
ORGANIZATIONNAME = Armchair;
|
||||
TargetAttributes = {
|
||||
E60FA7B919C908FE00179D70 = {
|
||||
CreatedOnToolsVersion = 6.1;
|
||||
LastSwiftMigration = 1100;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = E60FA7B519C908FE00179D70 /* Build configuration list for PBXProject "Mac Example" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
developmentRegion = English;
|
||||
developmentRegion = en;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
@@ -216,13 +209,6 @@
|
||||
remoteRef = E60FA7FF19C90D3500179D70 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
E60FA80219C90D3500179D70 /* ArmchairTests.xctest */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = wrapper.cfbundle;
|
||||
path = ArmchairTests.xctest;
|
||||
remoteRef = E60FA80119C90D3500179D70 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
E6F6156919C9FE8900C0B51C /* Armchair.bundle */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = wrapper.cfbundle;
|
||||
@@ -296,17 +282,28 @@
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
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;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
CODE_SIGN_IDENTITY = "-";
|
||||
@@ -315,6 +312,7 @@
|
||||
ENABLE_TESTABILITY = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
@@ -332,6 +330,7 @@
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = macosx;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
SWIFT_VERSION = 4.0;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
@@ -339,17 +338,28 @@
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
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;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
CODE_SIGN_IDENTITY = "-";
|
||||
@@ -358,6 +368,7 @@
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
@@ -367,6 +378,8 @@
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.10;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = macosx;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
||||
SWIFT_VERSION = 4.0;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
@@ -374,11 +387,13 @@
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CODE_SIGN_IDENTITY = "-";
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
INFOPLIST_FILE = "Example/Info-Mac.plist";
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.armchair.$(PRODUCT_NAME:rfc1034identifier)";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 5.0;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
@@ -386,11 +401,13 @@
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CODE_SIGN_IDENTITY = "-";
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
INFOPLIST_FILE = "Example/Info-Mac.plist";
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.armchair.$(PRODUCT_NAME:rfc1034identifier)";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 5.0;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
|
||||
412
README.md
412
README.md
@@ -43,7 +43,7 @@ If you are an iTunes Affiliate, you can easily setup Armchair to use your code a
|
||||
|
||||
##### Ready For Primetime
|
||||
|
||||
Armchair is clean code, well documented and well organized. It is easy to understand the logic flow and the purpose of each function. It doesn't mix logic up randomly between Class functions and Instance functions. It's API is clean and predictable.
|
||||
Armchair is clean code, well documented and well organized. It is easy to understand the logic flow and the purpose of each function. It doesn't mix logic up randomly between Class functions and Instance functions. Its API is clean and predictable.
|
||||
|
||||
---
|
||||
|
||||
@@ -93,7 +93,22 @@ platform :ios, '8.0'
|
||||
platform :osx, '10.10'
|
||||
use_frameworks!
|
||||
|
||||
pod 'Armchair', '~> 0.1.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:
|
||||
@@ -120,119 +135,209 @@ Run `carthage update` to build the framework and drag the built `Armchair.framew
|
||||
|
||||
Armchair includes sensible defaults as well as reads data from your localized, or unlocalized `info.plist` to set itself up. While everything is configurable, the only **required** item to configure is your App Store ID. This call is the same for iOS and Mac apps, and should be made as part of your App Delegate's `initialize()` function
|
||||
|
||||
Armchair.appID("12345678")
|
||||
|
||||
```swift
|
||||
Armchair.appID("12345678")
|
||||
```
|
||||
|
||||
That's it to get started. Setting Armchair up with this line uses some sensible default criterion (detailed below) and will present a rating prompt whenever they are met.
|
||||
|
||||
### Custom Configuration
|
||||
|
||||
Optionally, if you are using significant events in your app to track when the user does something of significance, add this line to any place where this event happens, such as a `levelDidFinish` function, or `userDidUploadPhoto` function.
|
||||
|
||||
Armchair.userDidSignificantEvent(true)
|
||||
|
||||
```swift
|
||||
Armchair.userDidSignificantEvent(true)
|
||||
```
|
||||
|
||||
In order for this to mean anything to Armchair, you also have to set the threshold for significant events. Typically, this, and all other logic configuration settings, should be made as part of your App Delegate's `initialize()` function so it can get the notifications on app launch.
|
||||
|
||||
Armchair.significantEventsUntilPrompt(5)
|
||||
|
||||
```swift
|
||||
Armchair.significantEventsUntilPrompt(5)
|
||||
```
|
||||
|
||||
As mentioned above, the `appID` is the only required item to configure. It is used to generate the URL that will link to the page. Most often, this is configured to the App that is currently running, but there may be an instance where you want to set it to another app, such as in an App that reviews other Apps.
|
||||
|
||||
GETTER: Armchair.appID() -> String
|
||||
SETTER: Armchair.appID(appID: String)
|
||||
|
||||
```swift
|
||||
// GETTER
|
||||
Armchair.appID() -> String
|
||||
// SETTER
|
||||
Armchair.appID(appID: String)
|
||||
```
|
||||
|
||||
##### Display Strings
|
||||
|
||||
The `appName` is used in several places on the review prompt popup. It can be configured here to customize your message without losing any of the default localizations. By default, Armchair will read the value from your localized, or unlocalized `info.plist`, but you can set it specifically if you want.
|
||||
|
||||
GETTER: Armchair.appName() -> String
|
||||
SETTER: Armchair.appName(appName: String)
|
||||
```swift
|
||||
// GETTER
|
||||
Armchair.appName() -> String
|
||||
// SETTER
|
||||
Armchair.appName(appName: String)
|
||||
```
|
||||
|
||||
The `reviewTitle` is the title to use on the review prompt popup. It's default value is a localized "Rate \<appName\>", but you can set it to anything you want.
|
||||
|
||||
GETTER: Armchair.reviewTitle() -> String
|
||||
SETTER: Armchair.reviewTitle(reviewTitle: String)
|
||||
```swift
|
||||
// GETTER
|
||||
Armchair.reviewTitle() -> String
|
||||
// SETTER
|
||||
Armchair.reviewTitle(reviewTitle: String)
|
||||
```
|
||||
|
||||
The `reviewMessage` is the message to use on the review prompt popup. It's default value is a localized "If you enjoy using \<appName\>, would you mind taking a moment to rate it? It won't take more than a minute. Thanks for your support!", but you can change it specifically if you want. However, if you do change it, you will need to provide your own localization strings as shown farther down below.
|
||||
|
||||
GETTER: Armchair.reviewMessage() -> String
|
||||
SETTER: Armchair.reviewMessage(reviewMessage: String)
|
||||
```swift
|
||||
// GETTER
|
||||
Armchair.reviewMessage() -> String
|
||||
// SETTER
|
||||
Armchair.reviewMessage(reviewMessage: String)
|
||||
```
|
||||
|
||||
The `cancelButtonTitle` is the button title to use on the review prompt popup for the "Cancel" action. Its default value is a localized "No, Thanks"
|
||||
|
||||
GETTER: Armchair.cancelButtonTitle() -> String
|
||||
SETTER: Armchair.cancelButtonTitle(cancelButtonTitle: String)
|
||||
```swift
|
||||
// GETTER
|
||||
Armchair.cancelButtonTitle() -> String
|
||||
// SETTER
|
||||
Armchair.cancelButtonTitle(cancelButtonTitle: String)
|
||||
```
|
||||
|
||||
The `rateButtonTitle` is the button title to use on the review prompt popup for the "Rate" action. Its default value is a localized "Rate \<appName\>"
|
||||
|
||||
GETTER: Armchair.rateButtonTitle() -> String
|
||||
SETTER: Armchair.rateButtonTitle(rateButtonTitle: String)
|
||||
```swift
|
||||
// GETTER
|
||||
Armchair.rateButtonTitle() -> String
|
||||
// SETTER
|
||||
Armchair.rateButtonTitle(rateButtonTitle: String)
|
||||
```
|
||||
|
||||
The `remindButtonTitle` is the button title to use on the review prompt popup for the "Remind" action. Its default value is a localized "Remind me later"
|
||||
|
||||
GETTER: Armchair.remindButtonTitle() -> String
|
||||
SETTER: Armchair.remindButtonTitle(remindButtonTitle: String)
|
||||
```swift
|
||||
// GETTER
|
||||
Armchair.remindButtonTitle() -> String
|
||||
// SETTER
|
||||
Armchair.remindButtonTitle(remindButtonTitle: String)
|
||||
```
|
||||
|
||||
##### Logic
|
||||
|
||||
The `daysUntilPrompt` configuration determines how many days the users will need to have the same version of your App installed before they will be prompted to rate it. It's default is 30 days.
|
||||
|
||||
GETTER: Armchair.daysUntilPrompt() -> UInt
|
||||
SETTER: Armchair.daysUntilPrompt(daysUntilPrompt: UInt)
|
||||
```swift
|
||||
// GETTER
|
||||
Armchair.daysUntilPrompt() -> UInt
|
||||
// SETTER
|
||||
Armchair.daysUntilPrompt(daysUntilPrompt: UInt)
|
||||
```
|
||||
|
||||
The `usesUntilPrompt` configuration determines how many times the user will need to have 'used' the same version of you App before they will be prompted to rate it. Its default is 20 uses.
|
||||
|
||||
GETTER: Armchair.usesUntilPrompt() -> UInt
|
||||
SETTER: Armchair.usesUntilPrompt(usesUntilPrompt: UInt)
|
||||
```swift
|
||||
// GETTER
|
||||
Armchair.usesUntilPrompt() -> UInt
|
||||
// SETTER
|
||||
Armchair.usesUntilPrompt(usesUntilPrompt: UInt)
|
||||
```
|
||||
|
||||
An example of a 'use' would be if the user launched the app, or brings it to the foreground. Armchair keeps track of these internally by listening to UIApplication/NSApplication lifecycle notifications.
|
||||
An example of a 'use' would be if the user launched the app, or brings it to the foreground. Armchair keeps track of these internally by listening to UIApplication/NSApplication lifecycle notifications.
|
||||
|
||||
As discussed briefly above, the `significantEventsUntilPrompt` configuration determines how many "significant events" the user will need to have before they will be prompted to rate the App. It defaults to 0 significant events.
|
||||
|
||||
GETTER: Armchair.significantEventsUntilPrompt() -> UInt
|
||||
SETTER: Armchair.significantEventsUntilPrompt(significantEventsUntilPrompt: UInt)
|
||||
|
||||
```swift
|
||||
// GETTER
|
||||
Armchair.significantEventsUntilPrompt() -> UInt
|
||||
// SETTER
|
||||
Armchair.significantEventsUntilPrompt(significantEventsUntilPrompt: UInt)
|
||||
```
|
||||
|
||||
A significant event can be anything you want to be in your app. In a telephone app, a significant event might be placing or receiving a call. In a game, it might be beating a level or a boss. This is just another layer of filtering that can be used to make sure that only the most loyal of your users are being prompted to rate you on the app store. If you leave this at a value of 0 (default), then this won't be a criterion used for rating. To tell Armchair that the user has performed a significant event, call the function:
|
||||
|
||||
Armchair.userDidSignificantEvent(canPromptForRating: Bool)
|
||||
```swift
|
||||
Armchair.userDidSignificantEvent(canPromptForRating: Bool)
|
||||
```
|
||||
|
||||
The `daysBeforeReminding` configuration determines how many days Armchair will wait before reminding the user to rate again, should they select the "Remind Me Later" option on the first alert. It defaults to 1 day. A value of 0 will remove the "Remind Me Later" button and disable this feature.
|
||||
|
||||
GETTER: Armchair.daysBeforeReminding() -> UInt
|
||||
SETTER: Armchair.daysBeforeReminding(daysBeforeReminding: UInt)
|
||||
|
||||
```swift
|
||||
// GETTER
|
||||
Armchair.daysBeforeReminding() -> UInt
|
||||
// SETTER
|
||||
Armchair.daysBeforeReminding(daysBeforeReminding: UInt)
|
||||
```
|
||||
|
||||
The `tracksNewVersions` configuration determines whether or not Armchair should track a new app version if detected. By default, Armchair tracks **all** new bundle versions. When it detects a new version, it resets the values saved for usage, significant events, popup shown, user action etc... By setting this to `NO` Armchair will **only** track the version it was initialized with, or the one it last knew about. If this setting is set to `true`, Armchair will reset itself after each new version detection. Its default value is `true`.
|
||||
|
||||
GETTER: Armchair.tracksNewVersions() -> Bool
|
||||
SETTER: Armchair.tracksNewVersions(tracksNewVersions: Bool)
|
||||
```swift
|
||||
// GETTER
|
||||
Armchair.tracksNewVersions() -> Bool
|
||||
// SETTER
|
||||
Armchair.tracksNewVersions(tracksNewVersions: Bool)
|
||||
```
|
||||
|
||||
The `shouldPromptIfRated` configuration determines whether or not to show the review prompt to users who have rated the app once before. This setting is a little like the `tracksNewVersions` setting, but a little less nuclear. Setting this to `false` will cause new users of the app to get the popup, but won't ask users who have already been asked for a popup in the past. This is useful if you release small bug-fix versions and don't want to pester your existing users with popups for every minor version, but want to ensure new users get prompted for a review. For example, you might set this to false for every minor build, then when you push a major version upgrade, leave it as true to ask for a rating again. Its default value is `true`.
|
||||
|
||||
GETTER: Armchair.shouldPromptIfRated() -> Bool
|
||||
SETTER: Armchair.shouldPromptIfRated(shouldPromptIfRated: 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. If set to `false` Armchair will look in its own translation bundle for the translating strings. It's default value is `false`.
|
||||
|
||||
GETTER: Armchair.useMainAppBundleForLocalizations() -> Bool
|
||||
SETTER: Armchair.useMainAppBundleForLocalizations(useMainAppBundleForLocalizations: Bool)
|
||||
|
||||
```swift
|
||||
// GETTER
|
||||
Armchair.shouldPromptIfRated() -> Bool
|
||||
// SETTER
|
||||
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
|
||||
// GETTER
|
||||
Armchair.useMainAppBundleForLocalizations() -> Bool
|
||||
// SETTER
|
||||
Armchair.useMainAppBundleForLocalizations(useMainAppBundleForLocalizations: Bool)
|
||||
```
|
||||
|
||||
##### Affiliate Codes
|
||||
|
||||
The `affiliateCode` configuration is optional and is used to configure with the review URL. If you are an Apple Affiliate, enter your code here. If none is set, the author's code will be used as it is better to be set as something rather than nothing. If you want to thank me for making Armchair, feel free to leave this value at it's default.
|
||||
|
||||
|
||||
GETTER: Armchair.affiliateCode() -> String
|
||||
SETTER: Armchair.affiliateCode(affiliateCode: String)
|
||||
```swift
|
||||
// GETTER
|
||||
Armchair.affiliateCode() -> String
|
||||
// SETTER
|
||||
Armchair.affiliateCode(affiliateCode: String)
|
||||
```
|
||||
|
||||
The `affiliateCampaignCode` configuration is optional and is used to configure the review URL. It provides context to the affiliate code and defaults to "Armchair-\<appID\>".
|
||||
|
||||
GETTER: Armchair.affiliateCampaignCode() -> String
|
||||
SETTER: Armchair.affiliateCampaignCode(affiliateCampaignCode: String)
|
||||
|
||||
```swift
|
||||
// GETTER
|
||||
Armchair.affiliateCampaignCode() -> String
|
||||
// SETTER
|
||||
Armchair.affiliateCampaignCode(affiliateCampaignCode: String)
|
||||
```
|
||||
|
||||
##### Debug Mode
|
||||
|
||||
The `debugEnabled` configuration is useful for testing how your review prompt popup looks and for testing. Setting it to `true` will show the Armchair alert every time by tricking the app into thinking the conditions for a prompt have been met. Calling this function in a production build (determined when `Debug` swift compiler flag is *not* defined) has no effect. In App Store builds, you don't have to worry about accidentally leaving debug on. The default value of `debugEnabled` is `false`.
|
||||
|
||||
GETTER: Armchair.debugEnabled() -> Bool
|
||||
SETTER: Armchair.debugEnabled(debugEnabled: Bool)
|
||||
|
||||
```swift
|
||||
// GETTER
|
||||
Armchair.debugEnabled() -> Bool
|
||||
// SETTER
|
||||
Armchair.debugEnabled(debugEnabled: Bool)
|
||||
```
|
||||
|
||||
##### Logging
|
||||
Armchair allows you to set a closure to capture debug log and to plug in the desired logging framework.
|
||||
|
||||
```swift
|
||||
Armchair.logger(logger: ArmchairLogger)
|
||||
```
|
||||
|
||||
##### iOS Only Configuration
|
||||
|
||||
@@ -240,19 +345,40 @@ These configuration functions only make sense for iOS builds due to their depend
|
||||
|
||||
The `usesAnimation` configuration determines whether or not Armchair uses animation when presenting a modal `SKStoreProductViewController`. Its default value is `true`.
|
||||
|
||||
GETTER: Armchair.usesAnimation() -> Bool
|
||||
SETTER: Armchair.usesAnimation(usesAnimation: Bool)
|
||||
```swift
|
||||
// GETTER
|
||||
Armchair.usesAnimation() -> Bool
|
||||
// SETTER
|
||||
Armchair.usesAnimation(usesAnimation: Bool)
|
||||
```
|
||||
|
||||
The `tintColor` configuration specifies a tint color that is applied to UIAlertController when `usesAlertController` is true. Its default value is `nil`, which means that tint color is not customized.
|
||||
|
||||
```swift
|
||||
// GETTER
|
||||
Armchair.tintColor() -> UIColor?
|
||||
// SETTER
|
||||
Armchair.tintColor(tintColor: UIColor?)
|
||||
```
|
||||
|
||||
The `usesAlertController` configuration determines whether or not Armchair uses a UIAlertController when presenting an alert on iOS 8. By default, we do not use it because the reordering of buttons is not possible in the alert controller as of iOS 8.0. It's default value is `false`. Changing this value does not affect iOS 7 at all.
|
||||
|
||||
GETTER: Armchair.usesAlertController() -> Bool
|
||||
SETTER: Armchair.usesAlertController(usesAnimation: Bool)
|
||||
|
||||
|
||||
```swift
|
||||
// GETTER
|
||||
Armchair.usesAlertController() -> Bool
|
||||
// SETTER
|
||||
Armchair.usesAlertController(usesAnimation: Bool)
|
||||
```
|
||||
|
||||
The `opensInStoreKit` configuration determines if Armchair will open the App Store link inside the App using a `SKStoreProductViewController`. By default, this is `false` on iOS 7, and `true` on iOS 8.
|
||||
|
||||
GETTER: Armchair.opensInStoreKit() -> Bool
|
||||
SETTER: Armchair.opensInStoreKit(opensInStoreKit: Bool)
|
||||
|
||||
|
||||
```swift
|
||||
// GETTER
|
||||
Armchair.opensInStoreKit() -> Bool
|
||||
// SETTER
|
||||
Armchair.opensInStoreKit(opensInStoreKit: Bool)
|
||||
```
|
||||
|
||||
There are 2 reasons why the default is `false` on iOS 7.
|
||||
|
||||
- The SKStoreProductViewController __does not allow the user to write a review__ (as of iOS 7)!
|
||||
@@ -262,73 +388,115 @@ There are 2 reasons why the default is `false` on iOS 7.
|
||||
|
||||
`userDidSignificantEvent(canPromptForRating: Bool)` tells Armchair that the user performed a significant event. A significant event is whatever you want it to be. If your app is used to make VoIP calls, then you might want to call this function whenever the user places a call. If it's a game, you might want to call this whenever the user beats a level boss. If the user has performed enough significant events and used the app enough, you can suppress the rating alert by passing `NO` for `canPromptForRating`. The rating alert will simply be postponed until it is called again with `true` for `canPromptForRating`. The rating alert can also be triggered by `appLaunched:` and `appEnteredForeground:` notifications.
|
||||
|
||||
Armchair.userDidSignificantEvent(canPromptForRating: Bool)
|
||||
```swift
|
||||
Armchair.userDidSignificantEvent(canPromptForRating: Bool)
|
||||
```
|
||||
|
||||
In addition to the above functions that can trigger the presentation of the prompt, there is a closure based variant that allows you to customize whether or not this is an appropriate time to display the prompt.
|
||||
|
||||
Armchair.userDidSignificantEvent(shouldPrompt: ArmchairShouldPromptClosure)
|
||||
|
||||
Read more about these functions below in the [Should-Prompt Closure](#should-prompt-closure) section.
|
||||
```swift
|
||||
Armchair.userDidSignificantEvent(shouldPrompt: ArmchairShouldPromptClosure)
|
||||
```
|
||||
|
||||
Read more about these functions below in the [Should-Prompt Closure](#should-prompt-closure) section.
|
||||
|
||||
`showPrompt()` tells Armchair to show the review prompt alert. The prompt will be showed if there is an internet connection available, the user hasn't already declined to rate, hasn't rated the current version and you are tracking new versions. You could call to show the prompt regardless of Armchair settings, for instance, in the case of some special event in your app like positive feedback given.
|
||||
|
||||
Armchair.showPrompt()
|
||||
```swift
|
||||
Armchair.showPrompt()
|
||||
```
|
||||
|
||||
`showPrompt(ifNecessary: Bool)` tells Armchair to show the review prompt alert if all restrictions have been met. The prompt will be shown if all restrictions are met, there is an internet connection available, the user hasn't declined to rate, hasn't rated current version, and you are tracking new versions. You could call to show the prompt, for instance, in the case of some special event in your app like a user login.
|
||||
`showPromptIfNecessary()` tells Armchair to show the review prompt alert if all restrictions have been met. The prompt will be shown if all restrictions are met, there is an internet connection available, the user hasn't declined to rate, hasn't rated current version, and you are tracking new versions. You could call to show the prompt, for instance, in the case of some special event in your app like a user login.
|
||||
|
||||
Armchair.showPrompt(ifNecessary: Bool)
|
||||
```swift
|
||||
Armchair.showPromptIfNecessary()
|
||||
```
|
||||
|
||||
The `reviewURLString()` function is the review URL string, generated by substituting the `appID`, `affiliateCode` and `affiliateCampaignCode` into the template URL for the current platform.
|
||||
|
||||
Armchair.reviewURLString() -> String
|
||||
```swift
|
||||
Armchair.reviewURLString() -> String
|
||||
```
|
||||
|
||||
`rateApp()` tells Armchair to open the App Store page where the user can specify a rating for the app. It also records the fact that this has happened, so the user won't be prompted again to rate the app for this version. The only case where you should call this directly is if your app has an explicit "Rate this app" command somewhere. In all other cases, don't worry about calling this — instead, just call the other functions listed above, and let Armchair handle the bookkeeping of deciding when to ask the user whether to rate the app.
|
||||
|
||||
Armchair.rateApp()
|
||||
```swift
|
||||
Armchair.rateApp()
|
||||
```
|
||||
|
||||
`ratingConditionsHaveBeenMet()` returns true when all of the setup conditions to display a prompt have been met.
|
||||
|
||||
```swift
|
||||
Armchair.ratingConditionsHaveBeenMet() -> Bool
|
||||
```
|
||||
|
||||
`resetUsageCounters()` resets app usage counters. Calling this method resets UseCount, SignificantEventCount and FirstUseDate (daysUntilPrompt).
|
||||
|
||||
```swift
|
||||
Armchair.resetUsageCounters()
|
||||
```
|
||||
|
||||
`resetAllCounters()` resets all counters. Calling this method resets every value tracked by Armchair.
|
||||
|
||||
```swift
|
||||
Armchair.resetAllCounters()
|
||||
```
|
||||
|
||||
##### iOS Only Functions
|
||||
|
||||
`closeModalPanel()` tells Armchair to immediately close any open rating modal panels for instance, a `SKStoreProductViewController`.
|
||||
|
||||
Armchair.closeModalPanel()
|
||||
```swift
|
||||
Armchair.closeModalPanel()
|
||||
```
|
||||
|
||||
### Closures
|
||||
|
||||
Armchair uses optional closures instead of delegate functions for callbacks. Default is nil for all of them.
|
||||
|
||||
Armchair.onDidDisplayAlert(didDisplayAlertClosure: ArmchairClosure?)
|
||||
Armchair.onDidDeclineToRate(didDeclineToRateClosure: ArmchairClosure?)
|
||||
Armchair.onDidOptToRate(didOptToRateClosure: ArmchairClosure?)
|
||||
Armchair.onDidOptToRemindLater(didOptToRemindLaterClosure: ArmchairClosure?)
|
||||
|
||||
```swift
|
||||
Armchair.onDidDisplayAlert(didDisplayAlertClosure: ArmchairClosure?)
|
||||
Armchair.onDidDeclineToRate(didDeclineToRateClosure: ArmchairClosure?)
|
||||
Armchair.onDidOptToRate(didOptToRateClosure: ArmchairClosure?)
|
||||
Armchair.onDidOptToRemindLater(didOptToRemindLaterClosure: ArmchairClosure?)
|
||||
```
|
||||
|
||||
##### iOS Only Closures
|
||||
|
||||
Armchair.onWillPresentModalView(willPresentModalViewClosure: ArmchairAnimateClosure?)
|
||||
Armchair.onDidDismissModalView(didDismissModalViewClosure: ArmchairAnimateClosure?)
|
||||
```swift
|
||||
Armchair.onWillPresentModalView(willPresentModalViewClosure: ArmchairAnimateClosure?)
|
||||
Armchair.onDidDismissModalView(didDismissModalViewClosure: ArmchairAnimateClosure?)
|
||||
```
|
||||
|
||||
##### Should-Increment Closure
|
||||
|
||||
Armchair.shouldIncrementUseCountClosure(shouldIncrementUseCountClosure: ArmchairShouldIncrementClosure?)
|
||||
```swift
|
||||
Armchair.shouldIncrementUseCountClosure(shouldIncrementUseCountClosure: ArmchairShouldIncrementClosure?)
|
||||
```
|
||||
|
||||
By default Armchair increments the use count every time the app enters the foreground. If you want to suppress this behavior (i.e. not counting a foreground event caused by switching apps during a Facebook login) you can do so with a ArmchairShouldIncrementClosure that returns `false` to ignore a foreground event or `true` to count it as normal.
|
||||
|
||||
##### Should-Prompt Closure
|
||||
|
||||
Armchair allows you to set a closure that is called immediately preceding the display of the popup.
|
||||
|
||||
public typealias ArmchairShouldPromptClosure = (ArmchairTrackingInfo) -> Bool
|
||||
|
||||
|
||||
```swift
|
||||
public typealias ArmchairShouldPromptClosure = (ArmchairTrackingInfo) -> Bool
|
||||
```
|
||||
|
||||
The `ArmchairShouldPromptClosure` passes you the keys and values Armchair used to determine that the prompt should be called (found in the ArmchairTrackingInfo's `info` dictionary), and expects a `Bool` return value on whether or not the prompt should still be displayed. This allows you to have one last chance to do any of your own custom logic to determine whether or not this is an appropriate time to display the prompt.
|
||||
|
||||
Armchair.shouldPromptClosure(shouldPromptClosure: ArmchairShouldPromptClosure?)
|
||||
|
||||
```swift
|
||||
Armchair.shouldPromptClosure(shouldPromptClosure: ArmchairShouldPromptClosure?)
|
||||
```
|
||||
|
||||
In addition to the global `shouldPromptClosure`, the Armchair functions that trigger the presentation of the prompt (`showPrompt(ifNecessary: Bool)` and `userDidSignificantEvent()`) have their own closure based variant that allows you to customize whether or not this is an appropriate time to display the prompt.
|
||||
In addition to the global `shouldPromptClosure`, the Armchair functions that trigger the presentation of the prompt (`showPromptIfNecessary` and `userDidSignificantEvent()`) have their own closure based variant that allows you to customize whether or not this is an appropriate time to display the prompt.
|
||||
|
||||
```swift
|
||||
Armchair.showPrompt(shouldPrompt: ArmchairShouldPromptClosure)
|
||||
Armchair.userDidSignificantEvent(shouldPrompt: ArmchairShouldPromptClosure)
|
||||
```
|
||||
|
||||
Armchair.showPrompt(shouldPrompt: ArmchairShouldPromptClosure)
|
||||
Armchair.userDidSignificantEvent(shouldPrompt: ArmchairShouldPromptClosure)
|
||||
|
||||
When using these functions instead of their `Bool` sister-functions, none of the internal Armchair logic is used to determine whether or not to display the prompt. **Only** your closure is used to decide whether or not it should be presented, based solely on the return value you pass back in the closure. This also means that even the global `shouldPromptClosure()` (if set) will not be called when using these functions.
|
||||
|
||||
**Note:** The `shouldPromptClosure()` is run synchronous and on the main queue, so be sure to handle it appropriately.
|
||||
@@ -337,43 +505,59 @@ When using these functions instead of their `Bool` sister-functions, none of the
|
||||
|
||||
Armchair has sensible defaults for the `NSUserDefaults` keys it uses, but you can customize that here if you want. Get/Set the `NSUserDefaults` keys that store the usage data for Armchair. Default values are all in the form of "\<appID\>_Armchair\<Setting\>"
|
||||
|
||||
GETTER Armchair.keyForArmchairKeyType(keyType: ArmchairKey) -> String
|
||||
SETTER Armchair.setKey(key: NSString, armchairKeyType: ArmchairKey)
|
||||
```swift
|
||||
// GETTER
|
||||
Armchair.keyForArmchairKeyType(keyType: ArmchairKey) -> String
|
||||
// SETTER
|
||||
Armchair.setKey(key: NSString, armchairKeyType: ArmchairKey)
|
||||
```
|
||||
|
||||
You don't have to use NSUserDefaults as your Key/Value store, though Armchair defaults to using it. If you want to sync your ratings and usage stats across all of your User's devices, you may want to use the `NSUbiquitousKeyValueStore` instead. This will ensure that the user won't be prompted to rate the same version of the same app on separate devices.
|
||||
|
||||
GETTER Armchair.userDefaultsObject() -> ArmchairDefaultsObject?
|
||||
SETTER Armchair.userDefaultsObject(userDefaultsObject: ArmchairDefaultsObject?)
|
||||
```swift
|
||||
// GETTER
|
||||
Armchair.userDefaultsObject() -> ArmchairDefaultsObject?
|
||||
// SETTER
|
||||
Armchair.userDefaultsObject(userDefaultsObject: ArmchairDefaultsObject?)
|
||||
```
|
||||
|
||||
The `userDefaultsObject` can be any object that responds to the `ArmchairDefaultsObject` protocol — essentially a stripped-down version of the NSUserDefaults api:
|
||||
|
||||
@objc public protocol ArmchairDefaultsObject {
|
||||
func objectForKey(defaultName: String) -> AnyObject?
|
||||
func setObject(value: AnyObject?, forKey defaultName: String)
|
||||
func removeObjectForKey(defaultName: String)
|
||||
```swift
|
||||
@objc public protocol ArmchairDefaultsObject {
|
||||
func objectForKey(defaultName: String) -> AnyObject?
|
||||
func setObject(value: AnyObject?, forKey defaultName: String)
|
||||
func removeObjectForKey(defaultName: String)
|
||||
|
||||
func stringForKey(defaultName: String) -> String?
|
||||
func integerForKey(defaultName: String) -> Int
|
||||
func doubleForKey(defaultName: String) -> Double
|
||||
func boolForKey(defaultName: String) -> Bool
|
||||
func stringForKey(defaultName: String) -> String?
|
||||
func integerForKey(defaultName: String) -> Int
|
||||
func doubleForKey(defaultName: String) -> Double
|
||||
func boolForKey(defaultName: String) -> Bool
|
||||
|
||||
func setInteger(value: Int, forKey defaultName: String)
|
||||
func setDouble(value: Double, forKey defaultName: String)
|
||||
func setBool(value: Bool, forKey defaultName: String)
|
||||
|
||||
func synchronize() -> Bool
|
||||
}
|
||||
func setInteger(value: Int, forKey defaultName: String)
|
||||
func setDouble(value: Double, forKey defaultName: String)
|
||||
func setBool(value: Bool, forKey defaultName: String)
|
||||
|
||||
func synchronize() -> Bool
|
||||
}
|
||||
```
|
||||
|
||||
So, to use it with iCloud and the `NSUbiquitousKeyValueStore`, set up like so:
|
||||
|
||||
Armchair.userDefaultsObject(NSUbiquitousKeyValueStoreSubclass.defaultStore())
|
||||
|
||||
```swift
|
||||
Armchair.userDefaultsObject(NSUbiquitousKeyValueStoreSubclass.defaultStore())
|
||||
```
|
||||
|
||||
...where you have a subclass that conforms to the protocol.
|
||||
|
||||
|
||||
You can get/set the `keyPrefix` to the keys above that store the usage data for Armchair. The default value is the `appID`, and it is prepended to the keys for key type. Setting a `keyPrefix` prevents different apps using a shared Key/Value store from overwriting each other.
|
||||
|
||||
GETTER Armchair.keyPrefix() -> String
|
||||
SETTER Armchair.keyPrefix(keyPrefix: String)
|
||||
```swift
|
||||
// GETTER
|
||||
Armchair.keyPrefix() -> String
|
||||
// SETTER
|
||||
Armchair.keyPrefix(keyPrefix: String)
|
||||
```
|
||||
|
||||
### Configuration/Usage Examples
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -63,13 +63,6 @@
|
||||
remoteGlobalIDString = E6D8B8B519C7274F001AD043;
|
||||
remoteInfo = Armchair;
|
||||
};
|
||||
E6D8B8BC19C7382B001AD043 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = F8111E4E19A95D7C0040E7D1 /* Armchair.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = E6D8B8B619C7274F001AD043;
|
||||
remoteInfo = ArmchairTests;
|
||||
};
|
||||
E6E5F4C019C8E156008A6C1B /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = F8111E4E19A95D7C0040E7D1 /* Armchair.xcodeproj */;
|
||||
@@ -94,9 +87,9 @@
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
939461E32333725B00C8A00E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
|
||||
939461E42333725B00C8A00E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
|
||||
E60FA81719C9219600179D70 /* logo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = logo.png; sourceTree = "<group>"; };
|
||||
E66F854919D0A7C600AD80EC /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
|
||||
E6A0AF5D19C9C89E00C3A7DC /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/Main.storyboard; sourceTree = "<group>"; };
|
||||
E6C49DC519C23C91006A4544 /* iOS Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "iOS Example.app"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
E6E5F4C219C8E18E008A6C1B /* armchair.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = armchair.jpg; sourceTree = "<group>"; };
|
||||
E6E5F4CC19C8E388008A6C1B /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Icon.png; sourceTree = "<group>"; };
|
||||
@@ -126,7 +119,6 @@
|
||||
E6E5F4C119C8E156008A6C1B /* Armchair.framework */,
|
||||
E6A0AFB319C9D24000C3A7DC /* Armchair.bundle */,
|
||||
E6D06B5619CB412500DE5D11 /* Armchair.bundle */,
|
||||
E6D8B8BD19C7382B001AD043 /* ArmchairTests.xctest */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
@@ -196,21 +188,23 @@
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastSwiftUpdateCheck = 0700;
|
||||
LastUpgradeCheck = 0700;
|
||||
LastUpgradeCheck = 1100;
|
||||
ORGANIZATIONNAME = Armchair;
|
||||
TargetAttributes = {
|
||||
F8111E0419A951050040E7D1 = {
|
||||
CreatedOnToolsVersion = 6.0;
|
||||
DevelopmentTeam = 9H3S97RP4K;
|
||||
LastSwiftMigration = 1100;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = F8111E0019A951050040E7D1 /* Build configuration list for PBXProject "iOS Example" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
developmentRegion = English;
|
||||
developmentRegion = en;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
Base,
|
||||
);
|
||||
mainGroup = F8111DFC19A951050040E7D1;
|
||||
productRefGroup = F8111DFC19A951050040E7D1;
|
||||
@@ -250,13 +244,6 @@
|
||||
remoteRef = E6D8B8BA19C7382B001AD043 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
E6D8B8BD19C7382B001AD043 /* ArmchairTests.xctest */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = wrapper.cfbundle;
|
||||
path = ArmchairTests.xctest;
|
||||
remoteRef = E6D8B8BC19C7382B001AD043 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
E6E5F4C119C8E156008A6C1B /* Armchair.framework */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = wrapper.framework;
|
||||
@@ -317,7 +304,7 @@
|
||||
E66F854819D0A7C600AD80EC /* LaunchScreen.storyboard */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
E66F854919D0A7C600AD80EC /* en */,
|
||||
939461E42333725B00C8A00E /* Base */,
|
||||
);
|
||||
name = LaunchScreen.storyboard;
|
||||
sourceTree = "<group>";
|
||||
@@ -325,7 +312,7 @@
|
||||
F8111E1019A951050040E7D1 /* Main.storyboard */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
E6A0AF5D19C9C89E00C3A7DC /* en */,
|
||||
939461E32333725B00C8A00E /* Base */,
|
||||
);
|
||||
name = Main.storyboard;
|
||||
sourceTree = "<group>";
|
||||
@@ -337,17 +324,28 @@
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
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;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
@@ -356,6 +354,7 @@
|
||||
ENABLE_TESTABILITY = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
@@ -368,11 +367,12 @@
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = iphoneos;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
SWIFT_VERSION = 4.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
};
|
||||
name = Debug;
|
||||
@@ -381,17 +381,28 @@
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
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;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
@@ -399,15 +410,18 @@
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = iphoneos;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
||||
SWIFT_VERSION = 4.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
@@ -416,11 +430,10 @@
|
||||
F8111E2419A951050040E7D1 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
EMBEDDED_CONTENT_CONTAINS_SWIFT = YES;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)";
|
||||
INFOPLIST_FILE = "$(SRCROOT)/Example/Info-iOS.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
@@ -429,23 +442,24 @@
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.armchair.$(PRODUCT_NAME:rfc1034identifier)";
|
||||
PRODUCT_NAME = "iOS Example";
|
||||
PROVISIONING_PROFILE = "";
|
||||
SWIFT_VERSION = 5.0;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
F8111E2519A951050040E7D1 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
EMBEDDED_CONTENT_CONTAINS_SWIFT = YES;
|
||||
INFOPLIST_FILE = "$(SRCROOT)/Example/Info-iOS.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.armchair.$(PRODUCT_NAME:rfc1034identifier)";
|
||||
PRODUCT_NAME = "iOS Example";
|
||||
PROVISIONING_PROFILE = "";
|
||||
SWIFT_VERSION = 5.0;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user