Browse Source

Added custom background and UI activity indicator

Andrea Bizzotto 10 years ago
parent
commit
f25d9d87fe

BIN
SwiftyStoreDemo/Assets.xcassets/Background.imageset/Background.png


+ 21 - 0
SwiftyStoreDemo/Assets.xcassets/Background.imageset/Contents.json

@@ -0,0 +1,21 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "Background.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

+ 6 - 0
SwiftyStoreDemo/Assets.xcassets/Contents.json

@@ -0,0 +1,6 @@
+{
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

+ 3 - 2
SwiftyStoreDemo/Base.lproj/LaunchScreen.storyboard

@@ -1,7 +1,8 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8150" systemVersion="15A204g" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8191" systemVersion="14E11f" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
     <dependencies>
     <dependencies>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8122"/>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8154"/>
     </dependencies>
     </dependencies>
     <scenes>
     <scenes>
         <!--View Controller-->
         <!--View Controller-->

+ 60 - 26
SwiftyStoreDemo/Base.lproj/Main.storyboard

@@ -17,36 +17,47 @@
                         <rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
                         <rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <subviews>
                         <subviews>
+                            <imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="Background" translatesAutoresizingMaskIntoConstraints="NO" id="JDz-7n-4vD" userLabel="Background">
+                                <rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
+                            </imageView>
+                            <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="R2x-3P-rjx" userLabel="Opaque">
+                                <rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
+                                <color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.29999999999999999" colorSpace="custom" customColorSpace="sRGB"/>
+                            </view>
                             <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="FII-Z2-VOo" userLabel="Purchases Holder">
                             <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="FII-Z2-VOo" userLabel="Purchases Holder">
-                                <rect key="frame" x="166" y="70" width="268" height="112.5"/>
+                                <rect key="frame" x="159" y="194" width="282" height="112.5"/>
                                 <subviews>
                                 <subviews>
                                     <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="C8u-2D-Dst" userLabel="ProductHolder1">
                                     <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="C8u-2D-Dst" userLabel="ProductHolder1">
-                                        <rect key="frame" x="0.0" y="0.0" width="84" height="112.5"/>
+                                        <rect key="frame" x="0.0" y="0.0" width="91" height="112.5"/>
                                         <subviews>
                                         <subviews>
                                             <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Product 1" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="uz9-cT-1WH">
                                             <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Product 1" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="uz9-cT-1WH">
-                                                <rect key="frame" x="0.0" y="0.0" width="84" height="20.5"/>
+                                                <rect key="frame" x="0.0" y="0.0" width="91" height="20.5"/>
                                                 <fontDescription key="fontDescription" type="system" pointSize="17"/>
                                                 <fontDescription key="fontDescription" type="system" pointSize="17"/>
-                                                <color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
+                                                <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
                                                 <nil key="highlightedColor"/>
                                                 <nil key="highlightedColor"/>
                                             </label>
                                             </label>
                                             <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="miS-cF-iGP">
                                             <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="miS-cF-iGP">
-                                                <rect key="frame" x="0.0" y="35" width="84" height="36"/>
-                                                <fontDescription key="fontDescription" type="system" pointSize="20"/>
-                                                <state key="normal" title="Get Info"/>
+                                                <rect key="frame" x="0.0" y="35" width="91" height="36"/>
+                                                <fontDescription key="fontDescription" type="boldSystem" pointSize="20"/>
+                                                <state key="normal" title="Get Info">
+                                                    <color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                                                </state>
                                                 <connections>
                                                 <connections>
                                                     <action selector="getInfo1" destination="BYZ-38-t0r" eventType="touchUpInside" id="uBH-iw-Ywz"/>
                                                     <action selector="getInfo1" destination="BYZ-38-t0r" eventType="touchUpInside" id="uBH-iw-Ywz"/>
                                                 </connections>
                                                 </connections>
                                             </button>
                                             </button>
                                             <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="DnE-MP-9Li">
                                             <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="DnE-MP-9Li">
-                                                <rect key="frame" x="0.0" y="76" width="84" height="36"/>
-                                                <fontDescription key="fontDescription" type="system" pointSize="20"/>
-                                                <state key="normal" title="Purchase"/>
+                                                <rect key="frame" x="0.0" y="76" width="91" height="36"/>
+                                                <fontDescription key="fontDescription" type="boldSystem" pointSize="20"/>
+                                                <state key="normal" title="Purchase">
+                                                    <color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                                                </state>
                                                 <connections>
                                                 <connections>
                                                     <action selector="purchase1" destination="BYZ-38-t0r" eventType="touchUpInside" id="oEV-gi-Mfe"/>
                                                     <action selector="purchase1" destination="BYZ-38-t0r" eventType="touchUpInside" id="oEV-gi-Mfe"/>
                                                 </connections>
                                                 </connections>
                                             </button>
                                             </button>
                                         </subviews>
                                         </subviews>
-                                        <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                                        <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
                                         <constraints>
                                         <constraints>
                                             <constraint firstItem="DnE-MP-9Li" firstAttribute="top" secondItem="miS-cF-iGP" secondAttribute="bottom" constant="5" id="9xW-r1-sYh"/>
                                             <constraint firstItem="DnE-MP-9Li" firstAttribute="top" secondItem="miS-cF-iGP" secondAttribute="bottom" constant="5" id="9xW-r1-sYh"/>
                                             <constraint firstAttribute="bottom" secondItem="miS-cF-iGP" secondAttribute="bottom" id="NIo-yq-z4d"/>
                                             <constraint firstAttribute="bottom" secondItem="miS-cF-iGP" secondAttribute="bottom" id="NIo-yq-z4d"/>
@@ -75,32 +86,36 @@
                                         </variation>
                                         </variation>
                                     </view>
                                     </view>
                                     <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="oS1-xb-Emp" userLabel="ProductHolder2">
                                     <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="oS1-xb-Emp" userLabel="ProductHolder2">
-                                        <rect key="frame" x="184" y="0.0" width="84" height="112.5"/>
+                                        <rect key="frame" x="191" y="0.0" width="91" height="112.5"/>
                                         <subviews>
                                         <subviews>
                                             <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Product 2" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="6UI-uh-w5n">
                                             <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Product 2" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="6UI-uh-w5n">
-                                                <rect key="frame" x="0.0" y="0.0" width="84" height="20.5"/>
+                                                <rect key="frame" x="0.0" y="0.0" width="91" height="20.5"/>
                                                 <fontDescription key="fontDescription" type="system" pointSize="17"/>
                                                 <fontDescription key="fontDescription" type="system" pointSize="17"/>
-                                                <color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
+                                                <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
                                                 <nil key="highlightedColor"/>
                                                 <nil key="highlightedColor"/>
                                             </label>
                                             </label>
                                             <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="L02-jg-tgd">
                                             <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="L02-jg-tgd">
-                                                <rect key="frame" x="0.0" y="35" width="84" height="36"/>
-                                                <fontDescription key="fontDescription" type="system" pointSize="20"/>
-                                                <state key="normal" title="Get Info"/>
+                                                <rect key="frame" x="0.0" y="35" width="91" height="36"/>
+                                                <fontDescription key="fontDescription" type="boldSystem" pointSize="20"/>
+                                                <state key="normal" title="Get Info">
+                                                    <color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                                                </state>
                                                 <connections>
                                                 <connections>
                                                     <action selector="getInfo2" destination="BYZ-38-t0r" eventType="touchUpInside" id="vnQ-wj-iaC"/>
                                                     <action selector="getInfo2" destination="BYZ-38-t0r" eventType="touchUpInside" id="vnQ-wj-iaC"/>
                                                 </connections>
                                                 </connections>
                                             </button>
                                             </button>
                                             <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="XP6-KY-8rd">
                                             <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="XP6-KY-8rd">
-                                                <rect key="frame" x="0.0" y="76" width="84" height="36"/>
-                                                <fontDescription key="fontDescription" type="system" pointSize="20"/>
-                                                <state key="normal" title="Purchase"/>
+                                                <rect key="frame" x="0.0" y="76" width="91" height="36"/>
+                                                <fontDescription key="fontDescription" type="boldSystem" pointSize="20"/>
+                                                <state key="normal" title="Purchase">
+                                                    <color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                                                </state>
                                                 <connections>
                                                 <connections>
                                                     <action selector="purchase2" destination="BYZ-38-t0r" eventType="touchUpInside" id="1VN-sv-h1e"/>
                                                     <action selector="purchase2" destination="BYZ-38-t0r" eventType="touchUpInside" id="1VN-sv-h1e"/>
                                                 </connections>
                                                 </connections>
                                             </button>
                                             </button>
                                         </subviews>
                                         </subviews>
-                                        <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                                        <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
                                         <constraints>
                                         <constraints>
                                             <constraint firstAttribute="trailing" secondItem="6UI-uh-w5n" secondAttribute="trailing" id="03a-NV-XOi"/>
                                             <constraint firstAttribute="trailing" secondItem="6UI-uh-w5n" secondAttribute="trailing" id="03a-NV-XOi"/>
                                             <constraint firstAttribute="trailing" secondItem="L02-jg-tgd" secondAttribute="trailing" id="7JI-OP-Nya"/>
                                             <constraint firstAttribute="trailing" secondItem="L02-jg-tgd" secondAttribute="trailing" id="7JI-OP-Nya"/>
@@ -127,7 +142,7 @@
                                         </variation>
                                         </variation>
                                     </view>
                                     </view>
                                 </subviews>
                                 </subviews>
-                                <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                                <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
                                 <constraints>
                                 <constraints>
                                     <constraint firstAttribute="bottom" secondItem="oS1-xb-Emp" secondAttribute="bottom" id="7cE-EF-yfA"/>
                                     <constraint firstAttribute="bottom" secondItem="oS1-xb-Emp" secondAttribute="bottom" id="7cE-EF-yfA"/>
                                     <constraint firstItem="oS1-xb-Emp" firstAttribute="leading" secondItem="C8u-2D-Dst" secondAttribute="trailing" constant="100" id="C1j-40-kYE"/>
                                     <constraint firstItem="oS1-xb-Emp" firstAttribute="leading" secondItem="C8u-2D-Dst" secondAttribute="trailing" constant="100" id="C1j-40-kYE"/>
@@ -139,9 +154,11 @@
                                 </constraints>
                                 </constraints>
                             </view>
                             </view>
                             <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="CG8-Ue-vcg">
                             <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="CG8-Ue-vcg">
-                                <rect key="frame" x="217" y="232.5" width="167" height="36"/>
-                                <fontDescription key="fontDescription" type="system" pointSize="20"/>
-                                <state key="normal" title="Restore Purchases"/>
+                                <rect key="frame" x="210" y="346.5" width="181" height="36"/>
+                                <fontDescription key="fontDescription" type="boldSystem" pointSize="20"/>
+                                <state key="normal" title="Restore Purchases">
+                                    <color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                                </state>
                                 <connections>
                                 <connections>
                                     <action selector="restorePurchases" destination="BYZ-38-t0r" eventType="touchUpInside" id="ulP-6V-3dz"/>
                                     <action selector="restorePurchases" destination="BYZ-38-t0r" eventType="touchUpInside" id="ulP-6V-3dz"/>
                                 </connections>
                                 </connections>
@@ -150,10 +167,24 @@
                         <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
                         <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
                         <constraints>
                         <constraints>
                             <constraint firstItem="FII-Z2-VOo" firstAttribute="top" secondItem="y3c-jy-aDJ" secondAttribute="bottom" constant="50" id="5RH-5E-DHg"/>
                             <constraint firstItem="FII-Z2-VOo" firstAttribute="top" secondItem="y3c-jy-aDJ" secondAttribute="bottom" constant="50" id="5RH-5E-DHg"/>
+                            <constraint firstAttribute="trailing" secondItem="JDz-7n-4vD" secondAttribute="trailing" id="GBV-Mt-YQc"/>
+                            <constraint firstItem="JDz-7n-4vD" firstAttribute="top" secondItem="8bC-Xf-vdC" secondAttribute="top" id="GlE-OZ-BQY"/>
+                            <constraint firstItem="wfy-db-euE" firstAttribute="top" secondItem="R2x-3P-rjx" secondAttribute="bottom" id="JpO-AG-cGD"/>
+                            <constraint firstAttribute="trailing" secondItem="R2x-3P-rjx" secondAttribute="trailing" id="Pyv-8m-m9C"/>
+                            <constraint firstItem="FII-Z2-VOo" firstAttribute="centerY" secondItem="8bC-Xf-vdC" secondAttribute="centerY" constant="-50" id="SHm-Hf-pUS"/>
                             <constraint firstItem="CG8-Ue-vcg" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="U3y-1n-HiO"/>
                             <constraint firstItem="CG8-Ue-vcg" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="U3y-1n-HiO"/>
-                            <constraint firstItem="CG8-Ue-vcg" firstAttribute="top" secondItem="FII-Z2-VOo" secondAttribute="bottom" constant="50" id="ZEX-Nc-VGE"/>
+                            <constraint firstItem="R2x-3P-rjx" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leading" id="U9f-il-AMN"/>
+                            <constraint firstItem="wfy-db-euE" firstAttribute="top" secondItem="JDz-7n-4vD" secondAttribute="bottom" id="Uxb-Hz-CCC"/>
+                            <constraint firstItem="CG8-Ue-vcg" firstAttribute="top" secondItem="FII-Z2-VOo" secondAttribute="bottom" constant="40" id="ZEX-Nc-VGE"/>
+                            <constraint firstItem="JDz-7n-4vD" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leading" id="eKg-Cq-0M3"/>
+                            <constraint firstItem="R2x-3P-rjx" firstAttribute="top" secondItem="8bC-Xf-vdC" secondAttribute="top" id="gD0-3o-Ni3"/>
                             <constraint firstItem="FII-Z2-VOo" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="x6e-Ni-abV"/>
                             <constraint firstItem="FII-Z2-VOo" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="x6e-Ni-abV"/>
                         </constraints>
                         </constraints>
+                        <variation key="default">
+                            <mask key="constraints">
+                                <exclude reference="5RH-5E-DHg"/>
+                            </mask>
+                        </variation>
                     </view>
                     </view>
                 </viewController>
                 </viewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
@@ -161,4 +192,7 @@
             <point key="canvasLocation" x="308" y="374"/>
             <point key="canvasLocation" x="308" y="374"/>
         </scene>
         </scene>
     </scenes>
     </scenes>
+    <resources>
+        <image name="Background" width="375" height="667"/>
+    </resources>
 </document>
 </document>

+ 2 - 0
SwiftyStoreDemo/Info.plist

@@ -36,5 +36,7 @@
 		<string>UIInterfaceOrientationLandscapeLeft</string>
 		<string>UIInterfaceOrientationLandscapeLeft</string>
 		<string>UIInterfaceOrientationLandscapeRight</string>
 		<string>UIInterfaceOrientationLandscapeRight</string>
 	</array>
 	</array>
+	<key>UIViewControllerBasedStatusBarAppearance</key>
+	<true/>
 </dict>
 </dict>
 </plist>
 </plist>

+ 31 - 0
SwiftyStoreDemo/NetworkActivityIndicatorManager.swift

@@ -0,0 +1,31 @@
+//
+//  NetworkActivityIndicatorManager.swift
+//  SwiftyStoreKit
+//
+//  Created by Andrea Bizzotto on 28/09/2015.
+//  Copyright © 2015 musevisions. All rights reserved.
+//
+
+import UIKit
+
+class NetworkActivityIndicatorManager: NSObject {
+
+    private static var loadingCount = 0
+    
+    class func networkOperationStarted() {
+        
+        if loadingCount == 0 {
+            UIApplication.sharedApplication().networkActivityIndicatorVisible = true
+        }
+        loadingCount++
+    }
+    
+    class func networkOperationFinished() {
+        if loadingCount > 0 {
+            loadingCount--
+        }
+        if loadingCount == 0 {
+            UIApplication.sharedApplication().networkActivityIndicatorVisible = false
+        }
+    }
+}

+ 10 - 0
SwiftyStoreDemo/ViewController.swift

@@ -42,7 +42,9 @@ class ViewController: UIViewController {
     }
     }
     func getInfo(no: String) {
     func getInfo(no: String) {
         
         
+        NetworkActivityIndicatorManager.networkOperationStarted()
         SwiftyStoreKit.retrieveProductInfo(AppBundleId + ".purchase" + no) { result in
         SwiftyStoreKit.retrieveProductInfo(AppBundleId + ".purchase" + no) { result in
+            NetworkActivityIndicatorManager.networkOperationFinished()
             
             
             switch result {
             switch result {
             case .Success(let product):
             case .Success(let product):
@@ -58,7 +60,9 @@ class ViewController: UIViewController {
     
     
     func purchase(no: String) {
     func purchase(no: String) {
         
         
+        NetworkActivityIndicatorManager.networkOperationStarted()
         SwiftyStoreKit.purchaseProduct(AppBundleId + ".purchase" + no) { result in
         SwiftyStoreKit.purchaseProduct(AppBundleId + ".purchase" + no) { result in
+            NetworkActivityIndicatorManager.networkOperationFinished()
             
             
             switch result {
             switch result {
             case .Success(let productId):
             case .Success(let productId):
@@ -82,7 +86,9 @@ class ViewController: UIViewController {
     }
     }
     @IBAction func restorePurchases() {
     @IBAction func restorePurchases() {
         
         
+        NetworkActivityIndicatorManager.networkOperationStarted()
         SwiftyStoreKit.restorePurchases() { result in
         SwiftyStoreKit.restorePurchases() { result in
+            NetworkActivityIndicatorManager.networkOperationFinished()
             switch result {
             switch result {
             case .Success(let productId):
             case .Success(let productId):
                 self.showMessage("Purchases Restored", message: "All purchases have been restored")
                 self.showMessage("Purchases Restored", message: "All purchases have been restored")
@@ -98,5 +104,9 @@ class ViewController: UIViewController {
             }
             }
         }
         }
     }
     }
+    
+    override func preferredStatusBarStyle() -> UIStatusBarStyle {
+        return .LightContent
+    }
 }
 }
 
 

+ 8 - 0
SwiftyStoreKit.xcodeproj/project.pbxproj

@@ -18,6 +18,7 @@
 		6502F63A1B985C9E004E342D /* InAppProductPurchaseRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6502F6221B98586A004E342D /* InAppProductPurchaseRequest.swift */; settings = {ASSET_TAGS = (); }; };
 		6502F63A1B985C9E004E342D /* InAppProductPurchaseRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6502F6221B98586A004E342D /* InAppProductPurchaseRequest.swift */; settings = {ASSET_TAGS = (); }; };
 		6502F63B1B985CA1004E342D /* InAppProductQueryRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6502F6231B98586A004E342D /* InAppProductQueryRequest.swift */; settings = {ASSET_TAGS = (); }; };
 		6502F63B1B985CA1004E342D /* InAppProductQueryRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6502F6231B98586A004E342D /* InAppProductQueryRequest.swift */; settings = {ASSET_TAGS = (); }; };
 		6502F63C1B985CA4004E342D /* SwiftyStoreKit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6502F6241B98586A004E342D /* SwiftyStoreKit.swift */; settings = {ASSET_TAGS = (); }; };
 		6502F63C1B985CA4004E342D /* SwiftyStoreKit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6502F6241B98586A004E342D /* SwiftyStoreKit.swift */; settings = {ASSET_TAGS = (); }; };
+		65C1B5DF1BB9DE9B00F7BF4E /* NetworkActivityIndicatorManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65C1B5DE1BB9DE9B00F7BF4E /* NetworkActivityIndicatorManager.swift */; settings = {ASSET_TAGS = (); }; };
 /* End PBXBuildFile section */
 /* End PBXBuildFile section */
 
 
 /* Begin PBXContainerItemProxy section */
 /* Begin PBXContainerItemProxy section */
@@ -58,6 +59,7 @@
 		6502F62D1B985C40004E342D /* SwiftyStoreKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SwiftyStoreKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
 		6502F62D1B985C40004E342D /* SwiftyStoreKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SwiftyStoreKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
 		6502F62F1B985C40004E342D /* SwiftyStoreKit.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SwiftyStoreKit.h; sourceTree = "<group>"; };
 		6502F62F1B985C40004E342D /* SwiftyStoreKit.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SwiftyStoreKit.h; sourceTree = "<group>"; };
 		6502F6311B985C40004E342D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
 		6502F6311B985C40004E342D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
+		65C1B5DE1BB9DE9B00F7BF4E /* NetworkActivityIndicatorManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NetworkActivityIndicatorManager.swift; sourceTree = "<group>"; };
 /* End PBXFileReference section */
 /* End PBXFileReference section */
 
 
 /* Begin PBXFrameworksBuildPhase section */
 /* Begin PBXFrameworksBuildPhase section */
@@ -118,6 +120,7 @@
 				6502F6181B985858004E342D /* Main.storyboard */,
 				6502F6181B985858004E342D /* Main.storyboard */,
 				6502F61A1B985858004E342D /* Info.plist */,
 				6502F61A1B985858004E342D /* Info.plist */,
 				6502F61B1B985858004E342D /* ViewController.swift */,
 				6502F61B1B985858004E342D /* ViewController.swift */,
+				65C1B5DE1BB9DE9B00F7BF4E /* NetworkActivityIndicatorManager.swift */,
 			);
 			);
 			path = SwiftyStoreDemo;
 			path = SwiftyStoreDemo;
 			sourceTree = "<group>";
 			sourceTree = "<group>";
@@ -236,6 +239,7 @@
 			files = (
 			files = (
 				6502F6211B985858004E342D /* ViewController.swift in Sources */,
 				6502F6211B985858004E342D /* ViewController.swift in Sources */,
 				6502F61C1B985858004E342D /* AppDelegate.swift in Sources */,
 				6502F61C1B985858004E342D /* AppDelegate.swift in Sources */,
+				65C1B5DF1BB9DE9B00F7BF4E /* NetworkActivityIndicatorManager.swift in Sources */,
 			);
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			runOnlyForDeploymentPostprocessing = 0;
 		};
 		};
@@ -370,6 +374,7 @@
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
 				PRODUCT_BUNDLE_IDENTIFIER = com.musevisions.iOS.SwiftyStoreDemo;
 				PRODUCT_BUNDLE_IDENTIFIER = com.musevisions.iOS.SwiftyStoreDemo;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				PRODUCT_NAME = "$(TARGET_NAME)";
+				TARGETED_DEVICE_FAMILY = 1;
 			};
 			};
 			name = Debug;
 			name = Debug;
 		};
 		};
@@ -383,6 +388,7 @@
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
 				PRODUCT_BUNDLE_IDENTIFIER = com.musevisions.iOS.SwiftyStoreDemo;
 				PRODUCT_BUNDLE_IDENTIFIER = com.musevisions.iOS.SwiftyStoreDemo;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				PRODUCT_NAME = "$(TARGET_NAME)";
+				TARGETED_DEVICE_FAMILY = 1;
 			};
 			};
 			name = Release;
 			name = Release;
 		};
 		};
@@ -447,6 +453,7 @@
 				6502F6121B985833004E342D /* Release */,
 				6502F6121B985833004E342D /* Release */,
 			);
 			);
 			defaultConfigurationIsVisible = 0;
 			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Release;
 		};
 		};
 		6502F6361B985C40004E342D /* Build configuration list for PBXNativeTarget "SwiftyStoreKit" */ = {
 		6502F6361B985C40004E342D /* Build configuration list for PBXNativeTarget "SwiftyStoreKit" */ = {
 			isa = XCConfigurationList;
 			isa = XCConfigurationList;
@@ -455,6 +462,7 @@
 				6502F6381B985C40004E342D /* Release */,
 				6502F6381B985C40004E342D /* Release */,
 			);
 			);
 			defaultConfigurationIsVisible = 0;
 			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Release;
 		};
 		};
 /* End XCConfigurationList section */
 /* End XCConfigurationList section */
 	};
 	};

+ 20 - 4
SwiftyStoreKit.xcodeproj/xcuserdata/andrea.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -10,12 +10,28 @@
             ignoreCount = "0"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             continueAfterRunningActions = "No"
             filePath = "SwiftyStoreDemo/ViewController.swift"
             filePath = "SwiftyStoreDemo/ViewController.swift"
-            timestampString = "462971595.760173"
+            timestampString = "465166210.600471"
             startingColumnNumber = "9223372036854775807"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "57"
-            endingLineNumber = "57"
-            landmarkName = "purchase(_:)"
+            startingLineNumber = "59"
+            endingLineNumber = "59"
+            landmarkName = "getInfo(_:)"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "SwiftyStoreDemo/ViewController.swift"
+            timestampString = "465166210.600471"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "109"
+            endingLineNumber = "109"
+            landmarkName = "preferredStatusBarStyle()"
             landmarkType = "5">
             landmarkType = "5">
          </BreakpointContent>
          </BreakpointContent>
       </BreakpointProxy>
       </BreakpointProxy>