Skip to content
Permalink
Browse files

Initial Commit

  • Loading branch information...
cnstoll committed Dec 7, 2014
1 parent 963e21c commit 65e6d5ba99e7cf2b67f4fbf5d59738dc81069a98
Showing with 1,796 additions and 3 deletions.
  1. +3 −1 .gitignore
  2. +62 −0 Example/MMWormhole/MMWormhole Watch App/Images.xcassets/AppIcon.appiconset/Contents.json
  3. +24 −0 Example/MMWormhole/MMWormhole Watch App/Images.xcassets/LaunchImage.launchimage/Contents.json
  4. +35 −0 Example/MMWormhole/MMWormhole Watch App/Info.plist
  5. +38 −0 Example/MMWormhole/MMWormhole Watch App/Interface.storyboard
  6. +20 −0 Example/MMWormhole/MMWormhole WatchKit Extension/Images.xcassets/MyImage.imageset/Contents.json
  7. +38 −0 Example/MMWormhole/MMWormhole WatchKit Extension/Info.plist
  8. +14 −0 Example/MMWormhole/MMWormhole WatchKit Extension/InterfaceController.h
  9. +69 −0 Example/MMWormhole/MMWormhole WatchKit Extension/InterfaceController.m
  10. +10 −0 Example/MMWormhole/MMWormhole WatchKit Extension/MMWormhole WatchKit Extension.entitlements
  11. +741 −0 Example/MMWormhole/MMWormhole.xcodeproj/project.pbxproj
  12. +7 −0 Example/MMWormhole/MMWormhole.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  13. BIN Example/MMWormhole/MMWormhole/.DS_Store
  14. +17 −0 Example/MMWormhole/MMWormhole/AppDelegate.h
  15. +45 −0 Example/MMWormhole/MMWormhole/AppDelegate.m
  16. +41 −0 Example/MMWormhole/MMWormhole/Base.lproj/LaunchScreen.xib
  17. +81 −0 Example/MMWormhole/MMWormhole/Base.lproj/Main.storyboard
  18. +38 −0 Example/MMWormhole/MMWormhole/Images.xcassets/AppIcon.appiconset/Contents.json
  19. +40 −0 Example/MMWormhole/MMWormhole/Info.plist
  20. +10 −0 Example/MMWormhole/MMWormhole/MMWormhole.entitlements
  21. +15 −0 Example/MMWormhole/MMWormhole/ViewController.h
  22. +55 −0 Example/MMWormhole/MMWormhole/ViewController.m
  23. +16 −0 Example/MMWormhole/MMWormhole/main.m
  24. +24 −0 Example/MMWormhole/MMWormholeTests/Info.plist
  25. +40 −0 Example/MMWormhole/MMWormholeTests/MMWormholeTests.m
  26. +13 −2 README.md
  27. +99 −0 Source/MMWormhole.h
  28. +201 −0 Source/MMWormhole.m
@@ -16,11 +16,13 @@ DerivedData
*.hmap
*.ipa
*.xcuserstate

# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control
#
# Pods/
.DS_Store
Example/.DS_Store
Example/MMWormhole/.DS_Store
@@ -0,0 +1,62 @@
{
"images" : [
{
"size" : "14.5x14.5",
"idiom" : "watch",
"scale" : "2x",
"role" : "notificationCenter",
"subtype" : "38mm"
},
{
"size" : "18x18",
"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"
}
}
@@ -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"
}
}
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>MMWormhole</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>com.mutualmobile.MMWormhole.watchapp</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>
<key>WKCompanionAppBundleIdentifier</key>
<string>com.mutualmobile.MMWormhole</string>
<key>WKWatchKitApp</key>
<true/>
</dict>
</plist>
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder.WatchKit.Storyboard" version="3.0" toolsVersion="6221" systemVersion="14B25" targetRuntime="watchKit" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="AgC-eL-Hgc">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6213"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBWatchKitPlugin" version="3734"/>
</dependencies>
<scenes>
<!--Interface Controller-->
<scene sceneID="aou-V4-d1y">
<objects>
<controller id="AgC-eL-Hgc" customClass="InterfaceController">
<items>
<label width="1" height="25" alignment="left" textAlignment="center" id="fPy-st-ZLc"/>
<button width="1" alignment="left" title="1" id="EpJ-Dk-fge">
<connections>
<action selector="didTapOne:" destination="AgC-eL-Hgc" id="3XP-oy-ibF"/>
</connections>
</button>
<button width="1" alignment="left" title="2" id="omn-1v-Qti">
<connections>
<action selector="didTapTwo:" destination="AgC-eL-Hgc" id="zLb-qt-FIc"/>
</connections>
</button>
<button width="1" alignment="left" title="3" id="L8P-lC-Jbi">
<connections>
<action selector="didTapThree:" destination="AgC-eL-Hgc" id="Roj-gg-ng4"/>
</connections>
</button>
</items>
<connections>
<outlet property="selectionLabel" destination="fPy-st-ZLc" id="j5q-1E-9da"/>
</connections>
</controller>
</objects>
<point key="canvasLocation" x="950" y="582"/>
</scene>
</scenes>
</document>
@@ -0,0 +1,20 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>MMWormhole WatchKit Extension</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>com.mutualmobile.MMWormhole.watchkitextension</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionAttributes</key>
<dict>
<key>WKAppBundleIdentifier</key>
<string>com.mutualmobile.MMWormhole.watchapp</string>
</dict>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.watchkit</string>
</dict>
<key>RemoteInterfacePrincipalClass</key>
<string>InterfaceController</string>
</dict>
</plist>
@@ -0,0 +1,14 @@
//
// InterfaceController.h
// MMWormhole WatchKit Extension
//
// Created by Conrad Stoll on 12/6/14.
// Copyright (c) 2014 Conrad Stoll. All rights reserved.
//

#import <WatchKit/WatchKit.h>
#import <Foundation/Foundation.h>

@interface InterfaceController : WKInterfaceController

@end
@@ -0,0 +1,69 @@
//
// InterfaceController.m
// MMWormhole WatchKit Extension
//
// Created by Conrad Stoll on 12/6/14.
// Copyright (c) 2014 Conrad Stoll. All rights reserved.
//

#import "InterfaceController.h"

#import "MMWormhole.h"

@interface InterfaceController()

@property (nonatomic, strong) MMWormhole *wormhole;
@property (nonatomic, weak) IBOutlet WKInterfaceLabel *selectionLabel;
@end


@implementation InterfaceController

- (instancetype)initWithContext:(id)context {
self = [super initWithContext:context];
if (self){
// Initialize the wormhole
self.wormhole = [[MMWormhole alloc] initWithApplicationGroupIdentifier:@"group.com.mutualmobile.wormhole"
optionalDirectory:@"wormhole"];

// Obtain an initial value for the selection message from the wormhole
id messageObject = [self.wormhole messageWithIdentifier:@"selection"];
NSString *string = [messageObject valueForKey:@"selectionString"];

if (string != nil) {
[self.selectionLabel setText:string];
}

// Listen for changes to the selection message. The selection message contains a string value
// identified by the selectionString key. Note that the type of the key is included in the
// name of the key.
[self.wormhole listenForMessageWithIdentifier:@"selection" completion:^(id messageObject) {
NSString *string = [messageObject valueForKey:@"selectionString"];

if (string != nil) {
[self.selectionLabel setText:string];
}
}];
}
return self;
}


// Pass messages each time a button is tapped using the identifier button
// The messages contain a single number value with the buttonNumber key
- (IBAction)didTapOne:(id)sender {
[self.wormhole passMessageObject:@{@"buttonNumber" : @(1)} identifier:@"button"];
}

- (IBAction)didTapTwo:(id)sender {
[self.wormhole passMessageObject:@{@"buttonNumber" : @(2)} identifier:@"button"];
}

- (IBAction)didTapThree:(id)sender {
[self.wormhole passMessageObject:@{@"buttonNumber" : @(3)} identifier:@"button"];
}

@end



@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.application-groups</key>
<array>
<string>group.com.mutualmobile.wormhole</string>
</array>
</dict>
</plist>

0 comments on commit 65e6d5b

Please sign in to comment.
You can’t perform that action at this time.