onevcat 10 rokov pred
rodič
commit
fbe4be3ffb

+ 6 - 6
Kingfisher-Demo WatchKit App/Base.lproj/Interface.storyboard

@@ -5,10 +5,10 @@
         <plugIn identifier="com.apple.InterfaceBuilder.IBWatchKitPlugin" version="3737"/>
         <plugIn identifier="com.apple.InterfaceBuilder.IBWatchKitPlugin" version="3737"/>
     </dependencies>
     </dependencies>
     <scenes>
     <scenes>
-        <!--Interface Controller-->
+        <!--Kingfisher-->
         <scene sceneID="aou-V4-d1y">
         <scene sceneID="aou-V4-d1y">
             <objects>
             <objects>
-                <controller id="AgC-eL-Hgc" customClass="InterfaceController" customModule="Kingfisher_Demo_WatchKit_App" customModuleProvider="target">
+                <controller title="Kingfisher" id="AgC-eL-Hgc" customClass="InterfaceController" customModule="Kingfisher_Demo_WatchKit_App" customModuleProvider="target">
                     <items>
                     <items>
                         <imageView width="136" height="136" alignment="left" id="qqx-yl-rXm"/>
                         <imageView width="136" height="136" alignment="left" id="qqx-yl-rXm"/>
                     </items>
                     </items>
@@ -26,10 +26,10 @@
             </objects>
             </objects>
             <point key="canvasLocation" x="432" y="474"/>
             <point key="canvasLocation" x="432" y="474"/>
         </scene>
         </scene>
-        <!--Interface Controller-->
+        <!--Kingfisher-->
         <scene sceneID="ITU-Ne-cIm">
         <scene sceneID="ITU-Ne-cIm">
             <objects>
             <objects>
-                <controller id="Yjb-zT-nsD" customClass="InterfaceController" customModule="Kingfisher_Demo_WatchKit_App" customModuleProvider="target">
+                <controller title="Kingfisher" id="Yjb-zT-nsD" customClass="InterfaceController" customModule="Kingfisher_Demo_WatchKit_App" customModuleProvider="target">
                     <items>
                     <items>
                         <imageView width="136" height="136" alignment="left" id="FkW-um-dvx"/>
                         <imageView width="136" height="136" alignment="left" id="FkW-um-dvx"/>
                     </items>
                     </items>
@@ -46,10 +46,10 @@
             </objects>
             </objects>
             <point key="canvasLocation" x="880" y="474"/>
             <point key="canvasLocation" x="880" y="474"/>
         </scene>
         </scene>
-        <!--Interface Controller-->
+        <!--Kingfisher-->
         <scene sceneID="zjv-Dg-Ncy">
         <scene sceneID="zjv-Dg-Ncy">
             <objects>
             <objects>
-                <controller id="aIE-iB-3Mc" customClass="InterfaceController" customModule="Kingfisher_Demo_WatchKit_App" customModuleProvider="target">
+                <controller title="Kingfisher" id="aIE-iB-3Mc" customClass="InterfaceController" customModule="Kingfisher_Demo_WatchKit_App" customModuleProvider="target">
                     <items>
                     <items>
                         <imageView width="136" height="136" alignment="left" id="goU-5Y-EJp"/>
                         <imageView width="136" height="136" alignment="left" id="goU-5Y-EJp"/>
                     </items>
                     </items>

+ 5 - 3
Kingfisher-Demo WatchKit Extension/InterfaceController.swift

@@ -12,19 +12,21 @@ import Kingfisher
 
 
 class InterfaceController: WKInterfaceController {
 class InterfaceController: WKInterfaceController {
 
 
+    static var counter: Int = 0
+    
     @IBOutlet weak var imageView: WKInterfaceImage!
     @IBOutlet weak var imageView: WKInterfaceImage!
     
     
     override func awakeWithContext(context: AnyObject?) {
     override func awakeWithContext(context: AnyObject?) {
         super.awakeWithContext(context)
         super.awakeWithContext(context)
-        
+
         // Configure interface objects here.
         // Configure interface objects here.
+        InterfaceController.counter =  InterfaceController.counter + 1
+        imageView.kf_setImageWithURL(NSURL(string: "https://raw.githubusercontent.com/onevcat/Kingfisher/master/images/kingfisher-\(InterfaceController.counter).jpg")!)
     }
     }
 
 
     override func willActivate() {
     override func willActivate() {
         // This method is called when watch view controller is about to be visible to user
         // This method is called when watch view controller is about to be visible to user
         super.willActivate()
         super.willActivate()
-        
-        imageView.kf_setImageWithURL(NSURL(string: "http://onevcat.com/content/images/2014/May/200.jpg")!)
     }
     }
 
 
     override func didDeactivate() {
     override func didDeactivate() {