Skip to content

Commit 95df298

Browse files
committed
WatchPuzzle: Version 1.0, 2016-10-27
First release This sample demonstrate how to use SceneKit with watchOS. Refer to this sample if you want to see how to use, configure, and interact with a 3D scene using SceneKit. This project shows you how to load a 3D SceneKit scene, add overlays using SpriteKit and setup gesture recognizer to manipulate the scene graph.
1 parent 9e82bc7 commit 95df298

File tree

26 files changed

+1483
-0
lines changed

26 files changed

+1483
-0
lines changed

WatchPuzzle/LICENSE.txt

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
Sample code project: WatchPuzzle: Using SceneKit and SpriteKit on watchOS
2+
Version: 1.0
3+
4+
IMPORTANT: This Apple software is supplied to you by Apple
5+
Inc. ("Apple") in consideration of your agreement to the following
6+
terms, and your use, installation, modification or redistribution of
7+
this Apple software constitutes acceptance of these terms. If you do
8+
not agree with these terms, please do not use, install, modify or
9+
redistribute this Apple software.
10+
11+
In consideration of your agreement to abide by the following terms, and
12+
subject to these terms, Apple grants you a personal, non-exclusive
13+
license, under Apple's copyrights in this original Apple software (the
14+
"Apple Software"), to use, reproduce, modify and redistribute the Apple
15+
Software, with or without modifications, in source and/or binary forms;
16+
provided that if you redistribute the Apple Software in its entirety and
17+
without modifications, you must retain this notice and the following
18+
text and disclaimers in all such redistributions of the Apple Software.
19+
Neither the name, trademarks, service marks or logos of Apple Inc. may
20+
be used to endorse or promote products derived from the Apple Software
21+
without specific prior written permission from Apple. Except as
22+
expressly stated in this notice, no other rights or licenses, express or
23+
implied, are granted by Apple herein, including but not limited to any
24+
patent rights that may be infringed by your derivative works or by other
25+
works in which the Apple Software may be incorporated.
26+
27+
The Apple Software is provided by Apple on an "AS IS" basis. APPLE
28+
MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
29+
THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
30+
FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
31+
OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
32+
33+
IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
34+
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
35+
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
36+
INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
37+
MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
38+
AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
39+
STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
40+
POSSIBILITY OF SUCH DAMAGE.
41+
42+
Copyright (C) 2016 Apple Inc. All Rights Reserved.

WatchPuzzle/README.md

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# WatchPuzzle: Using SceneKit and SpriteKit on watchOS
2+
3+
This sample demonstrate how to use SceneKit with watchOS. Refer to this sample if you want to see how to use, configure, and interact with a 3D scene using SceneKit. This project shows you how to load a 3D SceneKit scene, add overlays using SpriteKit and setup gesture recognizer to manipulate the scene graph.
4+
5+
## Requirements
6+
7+
### Build
8+
9+
Xcode 8.0 or later; iOS 10.0 SDK or later; watchOS 3.0 SDK or later
10+
11+
### Runtime
12+
13+
iOS 10.0 or later; watchOS 3.0 or later
14+
15+
Copyright (C) 2016 Apple Inc. All rights reserved.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
{
2+
"images" : [
3+
{
4+
"size" : "24x24",
5+
"idiom" : "watch",
6+
"scale" : "2x",
7+
"role" : "notificationCenter",
8+
"subtype" : "38mm"
9+
},
10+
{
11+
"size" : "27.5x27.5",
12+
"idiom" : "watch",
13+
"scale" : "2x",
14+
"role" : "notificationCenter",
15+
"subtype" : "42mm"
16+
},
17+
{
18+
"size" : "29x29",
19+
"idiom" : "watch",
20+
"role" : "companionSettings",
21+
"scale" : "2x"
22+
},
23+
{
24+
"size" : "29x29",
25+
"idiom" : "watch",
26+
"role" : "companionSettings",
27+
"scale" : "3x"
28+
},
29+
{
30+
"size" : "40x40",
31+
"idiom" : "watch",
32+
"scale" : "2x",
33+
"role" : "appLauncher",
34+
"subtype" : "38mm"
35+
},
36+
{
37+
"size" : "86x86",
38+
"idiom" : "watch",
39+
"scale" : "2x",
40+
"role" : "quickLook",
41+
"subtype" : "38mm"
42+
},
43+
{
44+
"size" : "98x98",
45+
"idiom" : "watch",
46+
"scale" : "2x",
47+
"role" : "quickLook",
48+
"subtype" : "42mm"
49+
}
50+
],
51+
"info" : {
52+
"version" : 1,
53+
"author" : "xcode"
54+
}
55+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<document type="com.apple.InterfaceBuilder.WatchKit.Storyboard" version="3.0" toolsVersion="11138" systemVersion="16A195a" targetRuntime="watchKit" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="AgC-eL-Hgc">
3+
<dependencies>
4+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11110"/>
5+
<plugIn identifier="com.apple.InterfaceBuilder.IBWatchKitPlugin" version="11056"/>
6+
</dependencies>
7+
<scenes>
8+
<!--Interface Controller-->
9+
<scene sceneID="aou-V4-d1y">
10+
<objects>
11+
<controller id="AgC-eL-Hgc" customClass="InterfaceController" customModule="WatchPuzzle_WatchKit_App" customModuleProvider="target">
12+
<items>
13+
<sceneKitScene alignment="left" scene="art.scnassets/sample.scn" id="qs4-XW-IwS">
14+
<gestureRecognizers>
15+
<tapGestureRecognizer id="ASd-9z-djZ">
16+
<precedingGestureRecognizers/>
17+
<connections>
18+
<action selector="handleTapWithSender:" destination="AgC-eL-Hgc" id="JWh-J9-MO0"/>
19+
</connections>
20+
</tapGestureRecognizer>
21+
<panGestureRecognizer id="nFd-7z-s2H">
22+
<precedingGestureRecognizers/>
23+
<connections>
24+
<action selector="handlePanWithPanGesture:" destination="AgC-eL-Hgc" id="OMn-BI-nfw"/>
25+
</connections>
26+
</panGestureRecognizer>
27+
</gestureRecognizers>
28+
</sceneKitScene>
29+
</items>
30+
<connections>
31+
<outlet property="sceneInterface" destination="qs4-XW-IwS" id="GMU-wT-5qk"/>
32+
</connections>
33+
</controller>
34+
</objects>
35+
</scene>
36+
</scenes>
37+
</document>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>en</string>
7+
<key>CFBundleDisplayName</key>
8+
<string>WatchPuzzle</string>
9+
<key>CFBundleExecutable</key>
10+
<string>$(EXECUTABLE_NAME)</string>
11+
<key>CFBundleIdentifier</key>
12+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
13+
<key>CFBundleInfoDictionaryVersion</key>
14+
<string>6.0</string>
15+
<key>CFBundleName</key>
16+
<string>$(PRODUCT_NAME)</string>
17+
<key>CFBundlePackageType</key>
18+
<string>APPL</string>
19+
<key>CFBundleShortVersionString</key>
20+
<string>1.0</string>
21+
<key>CFBundleSignature</key>
22+
<string>????</string>
23+
<key>CFBundleVersion</key>
24+
<string>1</string>
25+
<key>UISupportedInterfaceOrientations</key>
26+
<array>
27+
<string>UIInterfaceOrientationPortrait</string>
28+
<string>UIInterfaceOrientationPortraitUpsideDown</string>
29+
</array>
30+
<key>WKCompanionAppBundleIdentifier</key>
31+
<string>com.example.apple-samplecode.WatchPuzzle</string>
32+
<key>WKWatchKitApp</key>
33+
<true/>
34+
</dict>
35+
</plist>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "watch",
5+
"scale" : "2x"
6+
},
7+
{
8+
"idiom" : "watch",
9+
"scale" : "2x",
10+
"screen-width" : "<=145"
11+
},
12+
{
13+
"idiom" : "watch",
14+
"scale" : "2x",
15+
"screen-width" : ">145"
16+
}
17+
],
18+
"info" : {
19+
"version" : 1,
20+
"author" : "xcode"
21+
}
22+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"assets" : [
3+
{
4+
"idiom" : "watch",
5+
"filename" : "Circular.imageset",
6+
"role" : "circular"
7+
},
8+
{
9+
"idiom" : "watch",
10+
"filename" : "Modular.imageset",
11+
"role" : "modular"
12+
},
13+
{
14+
"idiom" : "watch",
15+
"filename" : "Utilitarian.imageset",
16+
"role" : "utilitarian"
17+
}
18+
],
19+
"info" : {
20+
"version" : 1,
21+
"author" : "xcode"
22+
}
23+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "watch",
5+
"scale" : "2x"
6+
},
7+
{
8+
"idiom" : "watch",
9+
"scale" : "2x",
10+
"screen-width" : "<=145"
11+
},
12+
{
13+
"idiom" : "watch",
14+
"scale" : "2x",
15+
"screen-width" : ">145"
16+
}
17+
],
18+
"info" : {
19+
"version" : 1,
20+
"author" : "xcode"
21+
}
22+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "watch",
5+
"scale" : "2x"
6+
},
7+
{
8+
"idiom" : "watch",
9+
"scale" : "2x",
10+
"screen-width" : "<=145"
11+
},
12+
{
13+
"idiom" : "watch",
14+
"scale" : "2x",
15+
"screen-width" : ">145"
16+
}
17+
],
18+
"info" : {
19+
"version" : 1,
20+
"author" : "xcode"
21+
}
22+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/*
2+
Copyright (C) 2016 Apple Inc. All Rights Reserved.
3+
See LICENSE.txt for this sample’s licensing information
4+
5+
Abstract:
6+
The WatchOS implementation of the app extension delegate.
7+
*/
8+
9+
import WatchKit
10+
11+
class ExtensionDelegate: NSObject, WKExtensionDelegate {
12+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>en</string>
7+
<key>CFBundleDisplayName</key>
8+
<string>WatchPuzzle WatchKit Extension</string>
9+
<key>CFBundleExecutable</key>
10+
<string>$(EXECUTABLE_NAME)</string>
11+
<key>CFBundleIdentifier</key>
12+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
13+
<key>CFBundleInfoDictionaryVersion</key>
14+
<string>6.0</string>
15+
<key>CFBundleName</key>
16+
<string>$(PRODUCT_NAME)</string>
17+
<key>CFBundlePackageType</key>
18+
<string>XPC!</string>
19+
<key>CFBundleShortVersionString</key>
20+
<string>1.0</string>
21+
<key>CFBundleSignature</key>
22+
<string>????</string>
23+
<key>CFBundleVersion</key>
24+
<string>1</string>
25+
<key>NSExtension</key>
26+
<dict>
27+
<key>NSExtensionAttributes</key>
28+
<dict>
29+
<key>WKAppBundleIdentifier</key>
30+
<string>com.example.apple-samplecode.WatchPuzzle.watchkitapp</string>
31+
</dict>
32+
<key>NSExtensionPointIdentifier</key>
33+
<string>com.apple.watchkit</string>
34+
</dict>
35+
<key>WKExtensionDelegateClassName</key>
36+
<string>$(PRODUCT_MODULE_NAME).ExtensionDelegate</string>
37+
</dict>
38+
</plist>

0 commit comments

Comments
 (0)