mirror of
https://github.com/UrbanApps/Armchair.git
synced 2026-03-18 07:24:14 +01:00
Updates for Swift 2
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="6250" systemVersion="14A389" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="8191" systemVersion="14F27" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="6250"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="8191"/>
|
||||
<capability name="box content view" minToolsVersion="7.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="NSApplication">
|
||||
@@ -675,7 +676,7 @@
|
||||
<window title="Mac Example" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" showsToolbarButton="NO" animationBehavior="default" id="QvC-M9-y7g">
|
||||
<windowStyleMask key="styleMask" titled="YES"/>
|
||||
<rect key="contentRect" x="335" y="390" width="400" height="368"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="2560" height="1417"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="1280" height="777"/>
|
||||
<view key="contentView" id="EiT-Mj-1SZ">
|
||||
<rect key="frame" x="0.0" y="0.0" width="400" height="368"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
@@ -692,7 +693,7 @@
|
||||
</imageView>
|
||||
<box autoresizesSubviews="NO" borderType="line" titlePosition="noTitle" translatesAutoresizingMaskIntoConstraints="NO" id="0Gb-KD-yfU">
|
||||
<rect key="frame" x="17" y="250" width="366" height="100"/>
|
||||
<view key="contentView">
|
||||
<view key="contentView" id="bbk-jP-boF">
|
||||
<rect key="frame" x="1" y="1" width="364" height="98"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
@@ -750,13 +751,13 @@
|
||||
</subviews>
|
||||
</view>
|
||||
<constraints>
|
||||
<constraint firstAttribute="centerX" secondItem="YED-uj-VLq" secondAttribute="centerX" id="0D2-Qc-szZ"/>
|
||||
<constraint firstItem="YED-uj-VLq" firstAttribute="top" secondItem="0Gb-KD-yfU" secondAttribute="top" constant="-13" id="0dP-ks-bhc"/>
|
||||
<constraint firstItem="yGG-Wr-1xP" firstAttribute="top" secondItem="YED-uj-VLq" secondAttribute="bottom" constant="-11" id="FTY-wK-gxK"/>
|
||||
<constraint firstItem="YED-uj-VLq" firstAttribute="leading" secondItem="jkm-ga-2sM" secondAttribute="leading" constant="-45" id="V7U-7Z-CIK"/>
|
||||
<constraint firstItem="jkm-ga-2sM" firstAttribute="bottom" secondItem="yGG-Wr-1xP" secondAttribute="bottom" id="WZR-Hf-JcJ"/>
|
||||
<constraint firstAttribute="centerX" secondItem="YED-uj-VLq" secondAttribute="centerX" id="D1u-uE-BYQ"/>
|
||||
<constraint firstItem="yGG-Wr-1xP" firstAttribute="top" secondItem="YED-uj-VLq" secondAttribute="bottom" constant="-11" id="HED-pQ-Syb"/>
|
||||
<constraint firstItem="YED-uj-VLq" firstAttribute="leading" secondItem="jkm-ga-2sM" secondAttribute="leading" constant="-45" id="Krx-CK-vgG"/>
|
||||
<constraint firstItem="YED-uj-VLq" firstAttribute="top" secondItem="0Gb-KD-yfU" secondAttribute="top" constant="-13" id="Yxh-EJ-Gft"/>
|
||||
<constraint firstAttribute="height" constant="94" id="aN9-Sz-28k"/>
|
||||
<constraint firstItem="yGG-Wr-1xP" firstAttribute="trailing" secondItem="YED-uj-VLq" secondAttribute="trailing" constant="-30" id="iUR-We-Kf1"/>
|
||||
<constraint firstItem="yGG-Wr-1xP" firstAttribute="trailing" secondItem="YED-uj-VLq" secondAttribute="trailing" constant="-30" id="kVF-vs-OfD"/>
|
||||
<constraint firstItem="jkm-ga-2sM" firstAttribute="bottom" secondItem="yGG-Wr-1xP" secondAttribute="bottom" id="sDl-pK-HF9"/>
|
||||
</constraints>
|
||||
<color key="borderColor" name="textColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="fillColor" name="textColor" catalog="System" colorSpace="catalog"/>
|
||||
|
||||
@@ -5,11 +5,21 @@
|
||||
"size" : "29x29",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "29x29",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "40x40",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "40x40",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "60x60",
|
||||
|
||||
@@ -3,43 +3,30 @@
|
||||
{
|
||||
"orientation" : "portrait",
|
||||
"idiom" : "ipad",
|
||||
"minimum-system-version" : "7.0",
|
||||
"extent" : "full-screen",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"orientation" : "landscape",
|
||||
"idiom" : "ipad",
|
||||
"minimum-system-version" : "7.0",
|
||||
"extent" : "full-screen",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"orientation" : "landscape",
|
||||
"idiom" : "ipad",
|
||||
"minimum-system-version" : "7.0",
|
||||
"extent" : "full-screen",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"orientation" : "portrait",
|
||||
"idiom" : "iphone",
|
||||
"minimum-system-version" : "7.0",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"orientation" : "portrait",
|
||||
"idiom" : "iphone",
|
||||
"minimum-system-version" : "7.0",
|
||||
"subtype" : "retina4",
|
||||
"scale" : "2x"
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"orientation" : "portrait",
|
||||
"idiom" : "ipad",
|
||||
"minimum-system-version" : "7.0",
|
||||
"extent" : "full-screen",
|
||||
"scale" : "1x"
|
||||
"minimum-system-version" : "7.0",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"orientation" : "landscape",
|
||||
"idiom" : "ipad",
|
||||
"extent" : "full-screen",
|
||||
"minimum-system-version" : "7.0",
|
||||
"scale" : "2x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<key>CFBundleIconFile</key>
|
||||
<string></string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.armchair.$(PRODUCT_NAME:rfc1034identifier)</string>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleLocalizations</key>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<key>CFBundleIcons~ipad</key>
|
||||
<dict/>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.armchair.$(PRODUCT_NAME:rfc1034identifier)</string>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleLocalizations</key>
|
||||
|
||||
@@ -55,7 +55,7 @@ extension ViewController {
|
||||
|
||||
// Only set it if we are using Armchair localizations
|
||||
if !Armchair.useMainAppBundleForLocalizations() {
|
||||
var currentLocalization: NSString = NSBundle.mainBundle().preferredLocalizations[0] as! NSString
|
||||
let currentLocalization: NSString = NSBundle.mainBundle().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 {
|
||||
@@ -74,7 +74,7 @@ extension ViewController {
|
||||
#endif
|
||||
}
|
||||
|
||||
@IBAction func presentStandardPrompt(AnyObject) {
|
||||
@IBAction func presentStandardPrompt(_: AnyObject) {
|
||||
resetAppReviewManager()
|
||||
|
||||
// The AppID is the only required setup
|
||||
@@ -92,7 +92,7 @@ extension ViewController {
|
||||
Armchair.userDidSignificantEvent(true)
|
||||
}
|
||||
|
||||
@IBAction func presentCustomizedPrompt(AnyObject) {
|
||||
@IBAction func presentCustomizedPrompt(_: AnyObject) {
|
||||
resetAppReviewManager()
|
||||
|
||||
// The AppID is the only required setup
|
||||
@@ -150,23 +150,23 @@ extension ViewController {
|
||||
Armchair.affiliateCampaignCode("Armchair-ExampleApp")
|
||||
|
||||
// Armchair is block based, so setup some blocks on events
|
||||
Armchair.onDidDeclineToRate() { println("[Example App] The user just declined to rate") }
|
||||
Armchair.onDidDisplayAlert() { println("[Example App] We just displayed the rating prompt") }
|
||||
Armchair.onDidOptToRate() { println("[Example App] The user just opted to rate") }
|
||||
Armchair.onDidOptToRemindLater({ println("[Example App] The user just opted to remind later") })
|
||||
Armchair.onDidDeclineToRate() { print("[Example App] The user just declined to rate") }
|
||||
Armchair.onDidDisplayAlert() { print("[Example App] We just displayed the rating prompt") }
|
||||
Armchair.onDidOptToRate() { print("[Example App] The user just opted to rate") }
|
||||
Armchair.onDidOptToRemindLater({ print("[Example App] The user just opted to remind later") })
|
||||
#if os(iOS)
|
||||
Armchair.onWillPresentModalView({ println("[Example App] About to present the modal view. Animated: \($0)") })
|
||||
Armchair.onDidDismissModalView({ println("[Example App] Just dismissed the modal view. Animated: \($0)") })
|
||||
Armchair.onWillPresentModalView({ print("[Example App] About to present the modal view. Animated: \($0)") })
|
||||
Armchair.onDidDismissModalView({ print("[Example App] Just dismissed the modal view. Animated: \($0)") })
|
||||
#endif
|
||||
// Armchair has sensible defaults for the NSUserDefault keys it uses, but you can customize that here
|
||||
Armchair.setKey("kSettingsSignificantEventTally", ArmchairKey.SignificantEventCount)
|
||||
Armchair.setKey("kSettingsSignificantEventTally", armchairKeyType: ArmchairKey.SignificantEventCount)
|
||||
|
||||
// You can also call it with a block to circumvent any of Armchair should rate logic.
|
||||
Armchair.userDidSignificantEvent({
|
||||
(trackingInfo: ArmchairTrackingInfo) -> (Bool) in
|
||||
// the trackingInfo.info dictionary has all the keys/value Armchair uses to determine whether or not to show a prompt
|
||||
|
||||
println("[Example App] \(trackingInfo)")
|
||||
print("[Example App] \(trackingInfo)")
|
||||
|
||||
return true
|
||||
})
|
||||
@@ -186,7 +186,7 @@ extension ViewController {
|
||||
}
|
||||
|
||||
#if os(iOS)
|
||||
@IBAction func presentStoreKitPrompt(AnyObject) {
|
||||
@IBAction func presentStoreKitPrompt(_: AnyObject) {
|
||||
resetAppReviewManager()
|
||||
|
||||
// The AppID is the only required setup
|
||||
@@ -212,7 +212,7 @@ extension ViewController {
|
||||
Armchair.resetDefaults()
|
||||
}
|
||||
|
||||
@IBAction func openUrbanApps(AnyObject) {
|
||||
@IBAction func openUrbanApps(_: AnyObject) {
|
||||
if let url = NSURL(string: "http://urbanapps.com") {
|
||||
#if os(iOS)
|
||||
UIApplication.sharedApplication().openURL(url)
|
||||
|
||||
Reference in New Issue
Block a user