From 0cac62e30fe3f706f0c046e2060fb8010544e928 Mon Sep 17 00:00:00 2001 From: Kristina Thai Date: Sun, 18 Jan 2015 17:29:09 -0800 Subject: [PATCH] Counter project --- README.md | 10 +- .../AppIcon.appiconset/Contents.json | 62 ++ .../LaunchImage.launchimage/Contents.json | 24 + WatchKitCounterDemo WatchKit App/Info.plist | 35 + .../Interface.storyboard | 51 ++ .../MyImage.imageset/Contents.json | 20 + .../Info.plist | 38 + .../InterfaceController.h | 17 + .../InterfaceController.m | 85 +++ .../PushNotificationPayload.apns | 16 + WatchKitCounterDemo.xcodeproj/project.pbxproj | 677 ++++++++++++++++++ WatchKitCounterDemo/AppDelegate.h | 17 + WatchKitCounterDemo/AppDelegate.m | 45 ++ .../Base.lproj/LaunchScreen.xib | 41 ++ .../Base.lproj/Main.storyboard | 65 ++ .../AppIcon.appiconset/Contents.json | 68 ++ WatchKitCounterDemo/Info.plist | 47 ++ WatchKitCounterDemo/ViewController.h | 17 + WatchKitCounterDemo/ViewController.m | 37 + WatchKitCounterDemo/main.m | 16 + WatchKitCounterDemoTests/Info.plist | 24 + .../WatchKitCounterDemoTests.m | 40 ++ 22 files changed, 1451 insertions(+), 1 deletion(-) create mode 100644 WatchKitCounterDemo WatchKit App/Images.xcassets/AppIcon.appiconset/Contents.json create mode 100644 WatchKitCounterDemo WatchKit App/Images.xcassets/LaunchImage.launchimage/Contents.json create mode 100644 WatchKitCounterDemo WatchKit App/Info.plist create mode 100644 WatchKitCounterDemo WatchKit App/Interface.storyboard create mode 100644 WatchKitCounterDemo WatchKit Extension/Images.xcassets/MyImage.imageset/Contents.json create mode 100644 WatchKitCounterDemo WatchKit Extension/Info.plist create mode 100644 WatchKitCounterDemo WatchKit Extension/InterfaceController.h create mode 100644 WatchKitCounterDemo WatchKit Extension/InterfaceController.m create mode 100644 WatchKitCounterDemo WatchKit Extension/PushNotificationPayload.apns create mode 100644 WatchKitCounterDemo.xcodeproj/project.pbxproj create mode 100644 WatchKitCounterDemo/AppDelegate.h create mode 100644 WatchKitCounterDemo/AppDelegate.m create mode 100644 WatchKitCounterDemo/Base.lproj/LaunchScreen.xib create mode 100644 WatchKitCounterDemo/Base.lproj/Main.storyboard create mode 100644 WatchKitCounterDemo/Images.xcassets/AppIcon.appiconset/Contents.json create mode 100644 WatchKitCounterDemo/Info.plist create mode 100644 WatchKitCounterDemo/ViewController.h create mode 100644 WatchKitCounterDemo/ViewController.m create mode 100644 WatchKitCounterDemo/main.m create mode 100644 WatchKitCounterDemoTests/Info.plist create mode 100644 WatchKitCounterDemoTests/WatchKitCounterDemoTests.m diff --git a/README.md b/README.md index 1902cea..bee05a8 100644 --- a/README.md +++ b/README.md @@ -1 +1,9 @@ -# WatchKitCounter2WayCom +WatchKitCounter2WayComm +=================== +Demo of 2 way communication between an Apple Watch app and it's parent iOS app. Information can be passed to the iOS app, which then "replies" back with a response to the watch extension and updates the UI for the watch app. This is an add-on to my original [Send Data to Parent iOS App tutorial](http://www.kristinathai.com/send-data-to-parent-ios-app/). + +See full 2 way communication tutorial on http://www.kristinathai.com/watchkit-tutorial-communicate-from-parent-app-back-to-watch-via-reply + + + + diff --git a/WatchKitCounterDemo WatchKit App/Images.xcassets/AppIcon.appiconset/Contents.json b/WatchKitCounterDemo WatchKit App/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..2c30f48 --- /dev/null +++ b/WatchKitCounterDemo WatchKit App/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,62 @@ +{ + "images" : [ + { + "size" : "22x22", + "idiom" : "watch", + "scale" : "2x", + "role" : "notificationCenter", + "subtype" : "38mm" + }, + { + "size" : "27.5x27.5", + "idiom" : "watch", + "scale" : "2x", + "role" : "notificationCenter", + "subtype" : "42mm" + }, + { + "size" : "29x29", + "idiom" : "watch", + "role" : "companionSettings", + "scale" : "2x" + }, + { + "size" : "29.3x29.3", + "idiom" : "watch", + "role" : "companionSettings", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "watch", + "scale" : "2x", + "role" : "appLauncher", + "subtype" : "38mm" + }, + { + "size" : "44x44", + "idiom" : "watch", + "scale" : "2x", + "role" : "appLauncher", + "subtype" : "42mm" + }, + { + "size" : "86x86", + "idiom" : "watch", + "scale" : "2x", + "role" : "quickLook", + "subtype" : "38mm" + }, + { + "size" : "98x98", + "idiom" : "watch", + "scale" : "2x", + "role" : "quickLook", + "subtype" : "42mm" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/WatchKitCounterDemo WatchKit App/Images.xcassets/LaunchImage.launchimage/Contents.json b/WatchKitCounterDemo WatchKit App/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..1030b8f --- /dev/null +++ b/WatchKitCounterDemo WatchKit App/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,24 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "watch", + "extent" : "full-screen", + "minimum-system-version" : "8.0", + "subtype" : "38mm", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "watch", + "extent" : "full-screen", + "minimum-system-version" : "8.0", + "subtype" : "42mm", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/WatchKitCounterDemo WatchKit App/Info.plist b/WatchKitCounterDemo WatchKit App/Info.plist new file mode 100644 index 0000000..3908dbf --- /dev/null +++ b/WatchKitCounterDemo WatchKit App/Info.plist @@ -0,0 +1,35 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + WatchKitCounterDemo + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + kristina.WatchKitCounterDemo.watchkitapp + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + + WKCompanionAppBundleIdentifier + kristina.WatchKitCounterDemo + WKWatchKitApp + + + diff --git a/WatchKitCounterDemo WatchKit App/Interface.storyboard b/WatchKitCounterDemo WatchKit App/Interface.storyboard new file mode 100644 index 0000000..77e397c --- /dev/null +++ b/WatchKitCounterDemo WatchKit App/Interface.storyboard @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WatchKitCounterDemo WatchKit Extension/Images.xcassets/MyImage.imageset/Contents.json b/WatchKitCounterDemo WatchKit Extension/Images.xcassets/MyImage.imageset/Contents.json new file mode 100644 index 0000000..f8f827e --- /dev/null +++ b/WatchKitCounterDemo WatchKit Extension/Images.xcassets/MyImage.imageset/Contents.json @@ -0,0 +1,20 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/WatchKitCounterDemo WatchKit Extension/Info.plist b/WatchKitCounterDemo WatchKit Extension/Info.plist new file mode 100644 index 0000000..65b161b --- /dev/null +++ b/WatchKitCounterDemo WatchKit Extension/Info.plist @@ -0,0 +1,38 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + WatchKitCounterDemo WatchKit Extension + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + kristina.WatchKitCounterDemo.watchkitextension + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + XPC! + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + NSExtension + + NSExtensionAttributes + + WKAppBundleIdentifier + kristina.WatchKitCounterDemo.watchkitapp + + NSExtensionPointIdentifier + com.apple.watchkit + + RemoteInterfacePrincipalClass + InterfaceController + + diff --git a/WatchKitCounterDemo WatchKit Extension/InterfaceController.h b/WatchKitCounterDemo WatchKit Extension/InterfaceController.h new file mode 100644 index 0000000..313c6ac --- /dev/null +++ b/WatchKitCounterDemo WatchKit Extension/InterfaceController.h @@ -0,0 +1,17 @@ +// +// InterfaceController.h +// WatchKitCounterDemo WatchKit Extension +// +// Created by Thai, Kristina on 12/10/14. +// Copyright (c) 2014 Kristina Thai. All rights reserved. +// + +#import +#import + +@interface InterfaceController : WKInterfaceController + +@property (weak, nonatomic) IBOutlet WKInterfaceLabel *counterLabel; +@property (weak, nonatomic) IBOutlet WKInterfaceLabel *savedNotificationLabel; + +@end diff --git a/WatchKitCounterDemo WatchKit Extension/InterfaceController.m b/WatchKitCounterDemo WatchKit Extension/InterfaceController.m new file mode 100644 index 0000000..78910df --- /dev/null +++ b/WatchKitCounterDemo WatchKit Extension/InterfaceController.m @@ -0,0 +1,85 @@ +// +// InterfaceController.m +// WatchKitCounterDemo WatchKit Extension +// +// Created by Thai, Kristina on 12/10/14. +// Copyright (c) 2014 Kristina Thai. All rights reserved. +// + +#import "InterfaceController.h" + + +@interface InterfaceController() + +@property (nonatomic, assign) int counter; +@end + +@implementation InterfaceController + +- (void)awakeWithContext:(id)context { + [super awakeWithContext:context]; + + // Configure interface objects here. + NSLog(@"%@ awakeWithContext", self); + self.counter = 0; +} + +- (void)willActivate { + // This method is called when watch view controller is about to be visible to user + NSLog(@"%@ will activate", self); +} + +- (void)didDeactivate { + // This method is called when watch view controller is no longer visible + NSLog(@"%@ did deactivate", self); +} + +#pragma mark - Button actions + +- (IBAction)incrementCounter { + [self hideSaveNotificationLabel]; + + self.counter++; + [self setCounterLabelText]; +} +- (IBAction)saveCounter { + //Send count to parent application + NSString *counterString = [NSString stringWithFormat:@"%d", self.counter]; + NSDictionary *applicationData = [[NSDictionary alloc] initWithObjects:@[counterString] forKeys:@[@"counterValue"]]; + + //Handle reciever in app delegate of parent app + [WKInterfaceController openParentApplication:applicationData reply:^(NSDictionary *replyInfo, NSError *error) { + + int reply = [[replyInfo objectForKey:@"response"] intValue]; + + //Show and change text for hidden save notification label + [self.savedNotificationLabel setText:[NSString stringWithFormat:@"Saved %d", reply]]; + [self showSaveNotificationLabel]; + }]; + +} +- (IBAction)clearCounter { + [self hideSaveNotificationLabel]; + + self.counter = 0; + [self setCounterLabelText]; +} + +#pragma mark - Helper methods + +- (void)setCounterLabelText { + [self.counterLabel setText:[NSString stringWithFormat:@"%d", self.counter]]; +} + +- (void)hideSaveNotificationLabel { + [self.savedNotificationLabel setAlpha:0]; +} + +-(void)showSaveNotificationLabel { + [self.savedNotificationLabel setAlpha:1]; +} + +@end + + + diff --git a/WatchKitCounterDemo WatchKit Extension/PushNotificationPayload.apns b/WatchKitCounterDemo WatchKit Extension/PushNotificationPayload.apns new file mode 100644 index 0000000..90a96ce --- /dev/null +++ b/WatchKitCounterDemo WatchKit Extension/PushNotificationPayload.apns @@ -0,0 +1,16 @@ +{ + "aps": { + "alert": "Test message", + "title": "Optional title", + "category": "myCategory" + }, + + "WatchKit Simulator Actions": [ + { + "title": "First Button", + "identifier": "firstButtonAction" + } + ], + + "customKey": "Use this file to define a testing payload for your notifications. The aps dictionary specifies the category, alert text and title. The WatchKit Simulator Actions array can provide info for one or more action buttons in addition to the standard Dismiss button. Any other top level keys are custom payload. If you have multiple such JSON files in your project, you'll be able to select them when choosing to debug the notification interface of your Watch App." +} diff --git a/WatchKitCounterDemo.xcodeproj/project.pbxproj b/WatchKitCounterDemo.xcodeproj/project.pbxproj new file mode 100644 index 0000000..b5e7325 --- /dev/null +++ b/WatchKitCounterDemo.xcodeproj/project.pbxproj @@ -0,0 +1,677 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + C2030C861A391EC30029CB14 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = C2030C851A391EC30029CB14 /* main.m */; }; + C2030C891A391EC30029CB14 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = C2030C881A391EC30029CB14 /* AppDelegate.m */; }; + C2030C8C1A391EC30029CB14 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C2030C8B1A391EC30029CB14 /* ViewController.m */; }; + C2030C8F1A391EC30029CB14 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C2030C8D1A391EC30029CB14 /* Main.storyboard */; }; + C2030C911A391EC30029CB14 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C2030C901A391EC30029CB14 /* Images.xcassets */; }; + C2030C941A391EC30029CB14 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = C2030C921A391EC30029CB14 /* LaunchScreen.xib */; }; + C2030CA01A391EC30029CB14 /* WatchKitCounterDemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C2030C9F1A391EC30029CB14 /* WatchKitCounterDemoTests.m */; }; + C2030CB41A391EEC0029CB14 /* InterfaceController.m in Sources */ = {isa = PBXBuildFile; fileRef = C2030CB31A391EEC0029CB14 /* InterfaceController.m */; }; + C2030CB91A391EEC0029CB14 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C2030CB81A391EEC0029CB14 /* Images.xcassets */; }; + C2030CBD1A391EEC0029CB14 /* WatchKitCounterDemo WatchKit App.app in Resources */ = {isa = PBXBuildFile; fileRef = C2030CBC1A391EEC0029CB14 /* WatchKitCounterDemo WatchKit App.app */; }; + C2030CC41A391EEC0029CB14 /* Interface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C2030CC31A391EEC0029CB14 /* Interface.storyboard */; }; + C2030CC61A391EEC0029CB14 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C2030CC51A391EEC0029CB14 /* Images.xcassets */; }; + C2030CC91A391EEC0029CB14 /* WatchKitCounterDemo WatchKit Extension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = C2030CAD1A391EEC0029CB14 /* WatchKitCounterDemo WatchKit Extension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + C2030C9A1A391EC30029CB14 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C2030C781A391EC30029CB14 /* Project object */; + proxyType = 1; + remoteGlobalIDString = C2030C7F1A391EC30029CB14; + remoteInfo = WatchKitCounterDemo; + }; + C2030CBE1A391EEC0029CB14 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C2030C781A391EC30029CB14 /* Project object */; + proxyType = 1; + remoteGlobalIDString = C2030CBB1A391EEC0029CB14; + remoteInfo = "WatchKitCounterDemo WatchKit App"; + }; + C2030CC71A391EEC0029CB14 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C2030C781A391EC30029CB14 /* Project object */; + proxyType = 1; + remoteGlobalIDString = C2030CAC1A391EEC0029CB14; + remoteInfo = "WatchKitCounterDemo WatchKit Extension"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + C2030CD01A391EEC0029CB14 /* Embed App Extensions */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 13; + files = ( + C2030CC91A391EEC0029CB14 /* WatchKitCounterDemo WatchKit Extension.appex in Embed App Extensions */, + ); + name = "Embed App Extensions"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + C2030C801A391EC30029CB14 /* WatchKitCounterDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = WatchKitCounterDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; + C2030C841A391EC30029CB14 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + C2030C851A391EC30029CB14 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + C2030C871A391EC30029CB14 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + C2030C881A391EC30029CB14 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + C2030C8A1A391EC30029CB14 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + C2030C8B1A391EC30029CB14 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + C2030C8E1A391EC30029CB14 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + C2030C901A391EC30029CB14 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + C2030C931A391EC30029CB14 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; + C2030C991A391EC30029CB14 /* WatchKitCounterDemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = WatchKitCounterDemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + C2030C9E1A391EC30029CB14 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + C2030C9F1A391EC30029CB14 /* WatchKitCounterDemoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = WatchKitCounterDemoTests.m; sourceTree = ""; }; + C2030CAD1A391EEC0029CB14 /* WatchKitCounterDemo WatchKit Extension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = "WatchKitCounterDemo WatchKit Extension.appex"; sourceTree = BUILT_PRODUCTS_DIR; }; + C2030CB01A391EEC0029CB14 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + C2030CB11A391EEC0029CB14 /* PushNotificationPayload.apns */ = {isa = PBXFileReference; lastKnownFileType = text; path = PushNotificationPayload.apns; sourceTree = ""; }; + C2030CB21A391EEC0029CB14 /* InterfaceController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = InterfaceController.h; sourceTree = ""; }; + C2030CB31A391EEC0029CB14 /* InterfaceController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = InterfaceController.m; sourceTree = ""; }; + C2030CB81A391EEC0029CB14 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + C2030CBC1A391EEC0029CB14 /* WatchKitCounterDemo WatchKit App.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "WatchKitCounterDemo WatchKit App.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + C2030CC21A391EEC0029CB14 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + C2030CC31A391EEC0029CB14 /* Interface.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Interface.storyboard; sourceTree = ""; }; + C2030CC51A391EEC0029CB14 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + C2030C7D1A391EC30029CB14 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C2030C961A391EC30029CB14 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C2030CAA1A391EEC0029CB14 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + C2030C771A391EC30029CB14 = { + isa = PBXGroup; + children = ( + C2030C821A391EC30029CB14 /* WatchKitCounterDemo */, + C2030C9C1A391EC30029CB14 /* WatchKitCounterDemoTests */, + C2030CAE1A391EEC0029CB14 /* WatchKitCounterDemo WatchKit Extension */, + C2030CC01A391EEC0029CB14 /* WatchKitCounterDemo WatchKit App */, + C2030C811A391EC30029CB14 /* Products */, + ); + sourceTree = ""; + }; + C2030C811A391EC30029CB14 /* Products */ = { + isa = PBXGroup; + children = ( + C2030C801A391EC30029CB14 /* WatchKitCounterDemo.app */, + C2030C991A391EC30029CB14 /* WatchKitCounterDemoTests.xctest */, + C2030CAD1A391EEC0029CB14 /* WatchKitCounterDemo WatchKit Extension.appex */, + C2030CBC1A391EEC0029CB14 /* WatchKitCounterDemo WatchKit App.app */, + ); + name = Products; + sourceTree = ""; + }; + C2030C821A391EC30029CB14 /* WatchKitCounterDemo */ = { + isa = PBXGroup; + children = ( + C2030C871A391EC30029CB14 /* AppDelegate.h */, + C2030C881A391EC30029CB14 /* AppDelegate.m */, + C2030C8A1A391EC30029CB14 /* ViewController.h */, + C2030C8B1A391EC30029CB14 /* ViewController.m */, + C2030C8D1A391EC30029CB14 /* Main.storyboard */, + C2030C901A391EC30029CB14 /* Images.xcassets */, + C2030C921A391EC30029CB14 /* LaunchScreen.xib */, + C2030C831A391EC30029CB14 /* Supporting Files */, + ); + path = WatchKitCounterDemo; + sourceTree = ""; + }; + C2030C831A391EC30029CB14 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + C2030C841A391EC30029CB14 /* Info.plist */, + C2030C851A391EC30029CB14 /* main.m */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + C2030C9C1A391EC30029CB14 /* WatchKitCounterDemoTests */ = { + isa = PBXGroup; + children = ( + C2030C9F1A391EC30029CB14 /* WatchKitCounterDemoTests.m */, + C2030C9D1A391EC30029CB14 /* Supporting Files */, + ); + path = WatchKitCounterDemoTests; + sourceTree = ""; + }; + C2030C9D1A391EC30029CB14 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + C2030C9E1A391EC30029CB14 /* Info.plist */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + C2030CAE1A391EEC0029CB14 /* WatchKitCounterDemo WatchKit Extension */ = { + isa = PBXGroup; + children = ( + C2030CB21A391EEC0029CB14 /* InterfaceController.h */, + C2030CB31A391EEC0029CB14 /* InterfaceController.m */, + C2030CB81A391EEC0029CB14 /* Images.xcassets */, + C2030CAF1A391EEC0029CB14 /* Supporting Files */, + ); + path = "WatchKitCounterDemo WatchKit Extension"; + sourceTree = ""; + }; + C2030CAF1A391EEC0029CB14 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + C2030CB01A391EEC0029CB14 /* Info.plist */, + C2030CB11A391EEC0029CB14 /* PushNotificationPayload.apns */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + C2030CC01A391EEC0029CB14 /* WatchKitCounterDemo WatchKit App */ = { + isa = PBXGroup; + children = ( + C2030CC31A391EEC0029CB14 /* Interface.storyboard */, + C2030CC51A391EEC0029CB14 /* Images.xcassets */, + C2030CC11A391EEC0029CB14 /* Supporting Files */, + ); + path = "WatchKitCounterDemo WatchKit App"; + sourceTree = ""; + }; + C2030CC11A391EEC0029CB14 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + C2030CC21A391EEC0029CB14 /* Info.plist */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + C2030C7F1A391EC30029CB14 /* WatchKitCounterDemo */ = { + isa = PBXNativeTarget; + buildConfigurationList = C2030CA31A391EC30029CB14 /* Build configuration list for PBXNativeTarget "WatchKitCounterDemo" */; + buildPhases = ( + C2030C7C1A391EC30029CB14 /* Sources */, + C2030C7D1A391EC30029CB14 /* Frameworks */, + C2030C7E1A391EC30029CB14 /* Resources */, + C2030CD01A391EEC0029CB14 /* Embed App Extensions */, + ); + buildRules = ( + ); + dependencies = ( + C2030CC81A391EEC0029CB14 /* PBXTargetDependency */, + ); + name = WatchKitCounterDemo; + productName = WatchKitCounterDemo; + productReference = C2030C801A391EC30029CB14 /* WatchKitCounterDemo.app */; + productType = "com.apple.product-type.application"; + }; + C2030C981A391EC30029CB14 /* WatchKitCounterDemoTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = C2030CA61A391EC30029CB14 /* Build configuration list for PBXNativeTarget "WatchKitCounterDemoTests" */; + buildPhases = ( + C2030C951A391EC30029CB14 /* Sources */, + C2030C961A391EC30029CB14 /* Frameworks */, + C2030C971A391EC30029CB14 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + C2030C9B1A391EC30029CB14 /* PBXTargetDependency */, + ); + name = WatchKitCounterDemoTests; + productName = WatchKitCounterDemoTests; + productReference = C2030C991A391EC30029CB14 /* WatchKitCounterDemoTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + C2030CAC1A391EEC0029CB14 /* WatchKitCounterDemo WatchKit Extension */ = { + isa = PBXNativeTarget; + buildConfigurationList = C2030CCD1A391EEC0029CB14 /* Build configuration list for PBXNativeTarget "WatchKitCounterDemo WatchKit Extension" */; + buildPhases = ( + C2030CA91A391EEC0029CB14 /* Sources */, + C2030CAA1A391EEC0029CB14 /* Frameworks */, + C2030CAB1A391EEC0029CB14 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + C2030CBF1A391EEC0029CB14 /* PBXTargetDependency */, + ); + name = "WatchKitCounterDemo WatchKit Extension"; + productName = "WatchKitCounterDemo WatchKit Extension"; + productReference = C2030CAD1A391EEC0029CB14 /* WatchKitCounterDemo WatchKit Extension.appex */; + productType = "com.apple.product-type.watchkit-extension"; + }; + C2030CBB1A391EEC0029CB14 /* WatchKitCounterDemo WatchKit App */ = { + isa = PBXNativeTarget; + buildConfigurationList = C2030CCA1A391EEC0029CB14 /* Build configuration list for PBXNativeTarget "WatchKitCounterDemo WatchKit App" */; + buildPhases = ( + C2030CBA1A391EEC0029CB14 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "WatchKitCounterDemo WatchKit App"; + productName = "WatchKitCounterDemo WatchKit App"; + productReference = C2030CBC1A391EEC0029CB14 /* WatchKitCounterDemo WatchKit App.app */; + productType = "com.apple.product-type.application.watchapp"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + C2030C781A391EC30029CB14 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0620; + ORGANIZATIONNAME = "Kristina Thai"; + TargetAttributes = { + C2030C7F1A391EC30029CB14 = { + CreatedOnToolsVersion = 6.2; + }; + C2030C981A391EC30029CB14 = { + CreatedOnToolsVersion = 6.2; + TestTargetID = C2030C7F1A391EC30029CB14; + }; + C2030CAC1A391EEC0029CB14 = { + CreatedOnToolsVersion = 6.2; + }; + C2030CBB1A391EEC0029CB14 = { + CreatedOnToolsVersion = 6.2; + }; + }; + }; + buildConfigurationList = C2030C7B1A391EC30029CB14 /* Build configuration list for PBXProject "WatchKitCounterDemo" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = C2030C771A391EC30029CB14; + productRefGroup = C2030C811A391EC30029CB14 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + C2030C7F1A391EC30029CB14 /* WatchKitCounterDemo */, + C2030C981A391EC30029CB14 /* WatchKitCounterDemoTests */, + C2030CAC1A391EEC0029CB14 /* WatchKitCounterDemo WatchKit Extension */, + C2030CBB1A391EEC0029CB14 /* WatchKitCounterDemo WatchKit App */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + C2030C7E1A391EC30029CB14 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C2030C8F1A391EC30029CB14 /* Main.storyboard in Resources */, + C2030C941A391EC30029CB14 /* LaunchScreen.xib in Resources */, + C2030C911A391EC30029CB14 /* Images.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C2030C971A391EC30029CB14 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C2030CAB1A391EEC0029CB14 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C2030CB91A391EEC0029CB14 /* Images.xcassets in Resources */, + C2030CBD1A391EEC0029CB14 /* WatchKitCounterDemo WatchKit App.app in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C2030CBA1A391EEC0029CB14 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C2030CC41A391EEC0029CB14 /* Interface.storyboard in Resources */, + C2030CC61A391EEC0029CB14 /* Images.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + C2030C7C1A391EC30029CB14 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C2030C8C1A391EC30029CB14 /* ViewController.m in Sources */, + C2030C891A391EC30029CB14 /* AppDelegate.m in Sources */, + C2030C861A391EC30029CB14 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C2030C951A391EC30029CB14 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C2030CA01A391EC30029CB14 /* WatchKitCounterDemoTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C2030CA91A391EEC0029CB14 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C2030CB41A391EEC0029CB14 /* InterfaceController.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + C2030C9B1A391EC30029CB14 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = C2030C7F1A391EC30029CB14 /* WatchKitCounterDemo */; + targetProxy = C2030C9A1A391EC30029CB14 /* PBXContainerItemProxy */; + }; + C2030CBF1A391EEC0029CB14 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = C2030CBB1A391EEC0029CB14 /* WatchKitCounterDemo WatchKit App */; + targetProxy = C2030CBE1A391EEC0029CB14 /* PBXContainerItemProxy */; + }; + C2030CC81A391EEC0029CB14 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = C2030CAC1A391EEC0029CB14 /* WatchKitCounterDemo WatchKit Extension */; + targetProxy = C2030CC71A391EEC0029CB14 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + C2030C8D1A391EC30029CB14 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + C2030C8E1A391EC30029CB14 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + C2030C921A391EC30029CB14 /* LaunchScreen.xib */ = { + isa = PBXVariantGroup; + children = ( + C2030C931A391EC30029CB14 /* Base */, + ); + name = LaunchScreen.xib; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + C2030CA11A391EC30029CB14 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + 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 = 8.2; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + C2030CA21A391EC30029CB14 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + 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 = 8.2; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + C2030CA41A391EC30029CB14 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = WatchKitCounterDemo/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + C2030CA51A391EC30029CB14 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = WatchKitCounterDemo/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + C2030CA71A391EC30029CB14 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + ); + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = WatchKitCounterDemoTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/WatchKitCounterDemo.app/WatchKitCounterDemo"; + }; + name = Debug; + }; + C2030CA81A391EC30029CB14 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + ); + INFOPLIST_FILE = WatchKitCounterDemoTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/WatchKitCounterDemo.app/WatchKitCounterDemo"; + }; + name = Release; + }; + C2030CCB1A391EEC0029CB14 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + IBSC_MODULE = WatchKitCounterDemo_WatchKit_Extension; + INFOPLIST_FILE = "WatchKitCounterDemo WatchKit App/Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = 4; + "TARGETED_DEVICE_FAMILY[sdk=iphonesimulator*]" = "1,4"; + }; + name = Debug; + }; + C2030CCC1A391EEC0029CB14 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + IBSC_MODULE = WatchKitCounterDemo_WatchKit_Extension; + INFOPLIST_FILE = "WatchKitCounterDemo WatchKit App/Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = 4; + "TARGETED_DEVICE_FAMILY[sdk=iphonesimulator*]" = "1,4"; + }; + name = Release; + }; + C2030CCE1A391EEC0029CB14 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "WatchKitCounterDemo WatchKit Extension/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; + PRODUCT_NAME = "${TARGET_NAME}"; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + C2030CCF1A391EEC0029CB14 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = "WatchKitCounterDemo WatchKit Extension/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; + PRODUCT_NAME = "${TARGET_NAME}"; + SKIP_INSTALL = YES; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + C2030C7B1A391EC30029CB14 /* Build configuration list for PBXProject "WatchKitCounterDemo" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C2030CA11A391EC30029CB14 /* Debug */, + C2030CA21A391EC30029CB14 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C2030CA31A391EC30029CB14 /* Build configuration list for PBXNativeTarget "WatchKitCounterDemo" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C2030CA41A391EC30029CB14 /* Debug */, + C2030CA51A391EC30029CB14 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C2030CA61A391EC30029CB14 /* Build configuration list for PBXNativeTarget "WatchKitCounterDemoTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C2030CA71A391EC30029CB14 /* Debug */, + C2030CA81A391EC30029CB14 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C2030CCA1A391EEC0029CB14 /* Build configuration list for PBXNativeTarget "WatchKitCounterDemo WatchKit App" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C2030CCB1A391EEC0029CB14 /* Debug */, + C2030CCC1A391EEC0029CB14 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C2030CCD1A391EEC0029CB14 /* Build configuration list for PBXNativeTarget "WatchKitCounterDemo WatchKit Extension" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C2030CCE1A391EEC0029CB14 /* Debug */, + C2030CCF1A391EEC0029CB14 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = C2030C781A391EC30029CB14 /* Project object */; +} diff --git a/WatchKitCounterDemo/AppDelegate.h b/WatchKitCounterDemo/AppDelegate.h new file mode 100644 index 0000000..b3e3228 --- /dev/null +++ b/WatchKitCounterDemo/AppDelegate.h @@ -0,0 +1,17 @@ +// +// AppDelegate.h +// WatchKitCounterDemo +// +// Created by Thai, Kristina on 12/10/14. +// Copyright (c) 2014 Kristina Thai. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + + +@end + diff --git a/WatchKitCounterDemo/AppDelegate.m b/WatchKitCounterDemo/AppDelegate.m new file mode 100644 index 0000000..6eeac90 --- /dev/null +++ b/WatchKitCounterDemo/AppDelegate.m @@ -0,0 +1,45 @@ +// +// AppDelegate.m +// WatchKitCounterDemo +// +// Created by Thai, Kristina on 12/10/14. +// Copyright (c) 2014 Kristina Thai. All rights reserved. +// + +#import "AppDelegate.h" +#import "ViewController.h" + +@interface AppDelegate () +@property (strong, nonatomic) NSMutableArray *tempCounterData; +@end + +@implementation AppDelegate + +- (void)application:(UIApplication *)application handleWatchKitExtensionRequest:(NSDictionary *)userInfo reply:(void(^)(NSDictionary *replyInfo))reply { + + NSString *counterValue = [userInfo objectForKey:@"counterValue"]; + NSDictionary *replyDict = @{@"response": counterValue}; + + reply(replyDict); + + if (!self.tempCounterData) { + self.tempCounterData = [[NSMutableArray alloc] init]; + } + + [self.tempCounterData addObject:counterValue]; + + //Add the new counter value and reload the table view + AppDelegate *tmpDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate]; + ViewController *vc = (ViewController *)((UINavigationController*)tmpDelegate.window.rootViewController).visibleViewController; + + vc.counterData = self.tempCounterData; + [vc.mainTableView reloadData]; + +} + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + // Override point for customization after application launch. + return YES; +} + +@end diff --git a/WatchKitCounterDemo/Base.lproj/LaunchScreen.xib b/WatchKitCounterDemo/Base.lproj/LaunchScreen.xib new file mode 100644 index 0000000..9ce8bfa --- /dev/null +++ b/WatchKitCounterDemo/Base.lproj/LaunchScreen.xib @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WatchKitCounterDemo/Base.lproj/Main.storyboard b/WatchKitCounterDemo/Base.lproj/Main.storyboard new file mode 100644 index 0000000..f9ed963 --- /dev/null +++ b/WatchKitCounterDemo/Base.lproj/Main.storyboard @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WatchKitCounterDemo/Images.xcassets/AppIcon.appiconset/Contents.json b/WatchKitCounterDemo/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..36d2c80 --- /dev/null +++ b/WatchKitCounterDemo/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,68 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "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", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/WatchKitCounterDemo/Info.plist b/WatchKitCounterDemo/Info.plist new file mode 100644 index 0000000..780c296 --- /dev/null +++ b/WatchKitCounterDemo/Info.plist @@ -0,0 +1,47 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + kristina.$(PRODUCT_NAME:rfc1034identifier) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/WatchKitCounterDemo/ViewController.h b/WatchKitCounterDemo/ViewController.h new file mode 100644 index 0000000..99a1838 --- /dev/null +++ b/WatchKitCounterDemo/ViewController.h @@ -0,0 +1,17 @@ +// +// ViewController.h +// WatchKitCounterDemo +// +// Created by Thai, Kristina on 12/10/14. +// Copyright (c) 2014 Kristina Thai. All rights reserved. +// + +#import + +@interface ViewController : UIViewController + +@property (strong, nonatomic) NSMutableArray *counterData; +@property (weak, nonatomic) IBOutlet UITableView *mainTableView; + +@end + diff --git a/WatchKitCounterDemo/ViewController.m b/WatchKitCounterDemo/ViewController.m new file mode 100644 index 0000000..de15cc5 --- /dev/null +++ b/WatchKitCounterDemo/ViewController.m @@ -0,0 +1,37 @@ +// +// ViewController.m +// WatchKitCounterDemo +// +// Created by Thai, Kristina on 12/10/14. +// Copyright (c) 2014 Kristina Thai. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + + [self.mainTableView reloadData]; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { + return self.counterData.count; +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + static NSString *cellIdentifier = @"CounterCell"; + UITableViewCell *cell = [self.mainTableView dequeueReusableCellWithIdentifier:cellIdentifier forIndexPath:indexPath]; + + NSString *counterValueString = [self.counterData objectAtIndex:indexPath.row]; + cell.textLabel.text = counterValueString; + + return cell; +} + +@end diff --git a/WatchKitCounterDemo/main.m b/WatchKitCounterDemo/main.m new file mode 100644 index 0000000..61e2b1b --- /dev/null +++ b/WatchKitCounterDemo/main.m @@ -0,0 +1,16 @@ +// +// main.m +// WatchKitCounterDemo +// +// Created by Thai, Kristina on 12/10/14. +// Copyright (c) 2014 Kristina Thai. All rights reserved. +// + +#import +#import "AppDelegate.h" + +int main(int argc, char * argv[]) { + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/WatchKitCounterDemoTests/Info.plist b/WatchKitCounterDemoTests/Info.plist new file mode 100644 index 0000000..8e8cab7 --- /dev/null +++ b/WatchKitCounterDemoTests/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + kristina.$(PRODUCT_NAME:rfc1034identifier) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/WatchKitCounterDemoTests/WatchKitCounterDemoTests.m b/WatchKitCounterDemoTests/WatchKitCounterDemoTests.m new file mode 100644 index 0000000..af0d147 --- /dev/null +++ b/WatchKitCounterDemoTests/WatchKitCounterDemoTests.m @@ -0,0 +1,40 @@ +// +// WatchKitCounterDemoTests.m +// WatchKitCounterDemoTests +// +// Created by Thai, Kristina on 12/10/14. +// Copyright (c) 2014 Kristina Thai. All rights reserved. +// + +#import +#import + +@interface WatchKitCounterDemoTests : XCTestCase + +@end + +@implementation WatchKitCounterDemoTests + +- (void)setUp { + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown { + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample { + // This is an example of a functional test case. + XCTAssert(YES, @"Pass"); +} + +- (void)testPerformanceExample { + // This is an example of a performance test case. + [self measureBlock:^{ + // Put the code you want to measure the time of here. + }]; +} + +@end