Skip to content

Commit c565d2e

Browse files
bsneedBrandon Sneed
andauthored
watchOS basics + refactors (#29)
* Updating example projects. * Added watchOS example * bumped watchOS minimum version to 7.1 from 6.2 * added watchOS lifecycle stuff * removed unnecessary files. * Updated ios/macos lifecycle handlers to account for watchOS changes. * updated startup plugins list. * simplified httpclient. * fixed issue in startupqueue where state was changed too late. * fixed background operation and orphaned connections in segment destination. * fixed erroneous completion success value. * Used the new goofball result type in swift <eyeroll> * Context fixes for macOS. * Disabled objc methods for linux * Removed @objc markers. * Fixed linux build issue. * Cody commentary resolved. Co-authored-by: Brandon Sneed <[email protected]>
1 parent 3fe5dc1 commit c565d2e

File tree

49 files changed

+1939
-415
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1939
-415
lines changed

Examples/apps/BasicExample/BasicExample.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10+
465879BD268A511600180335 /* ConsoleLogger.swift in Sources */ = {isa = PBXBuildFile; fileRef = 465879BC268A511600180335 /* ConsoleLogger.swift */; };
1011
469F7AF9265C25890038E773 /* EventData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 469F7AF8265C25890038E773 /* EventData.swift */; };
1112
46E38365265837EA00BA2502 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46E38364265837EA00BA2502 /* AppDelegate.swift */; };
1213
46E38367265837EA00BA2502 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46E38366265837EA00BA2502 /* SceneDelegate.swift */; };
@@ -19,6 +20,7 @@
1920
/* End PBXBuildFile section */
2021

2122
/* Begin PBXFileReference section */
23+
465879BC268A511600180335 /* ConsoleLogger.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ConsoleLogger.swift; path = ../../../other_plugins/ConsoleLogger.swift; sourceTree = "<group>"; };
2224
4663C72A267A8D6B00ADDD1A /* BasicExample.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = BasicExample.entitlements; sourceTree = "<group>"; };
2325
469F7AF8265C25890038E773 /* EventData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EventData.swift; sourceTree = "<group>"; };
2426
46E38361265837EA00BA2502 /* BasicExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BasicExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -66,6 +68,7 @@
6668
children = (
6769
4663C72A267A8D6B00ADDD1A /* BasicExample.entitlements */,
6870
46E38364265837EA00BA2502 /* AppDelegate.swift */,
71+
465879BC268A511600180335 /* ConsoleLogger.swift */,
6972
46E38366265837EA00BA2502 /* SceneDelegate.swift */,
7073
469F7AF8265C25890038E773 /* EventData.swift */,
7174
46E38368265837EA00BA2502 /* ViewController.swift */,
@@ -164,6 +167,7 @@
164167
46E38369265837EA00BA2502 /* ViewController.swift in Sources */,
165168
46E38365265837EA00BA2502 /* AppDelegate.swift in Sources */,
166169
469F7AF9265C25890038E773 /* EventData.swift in Sources */,
170+
465879BD268A511600180335 /* ConsoleLogger.swift in Sources */,
167171
46E38367265837EA00BA2502 /* SceneDelegate.swift in Sources */,
168172
);
169173
runOnlyForDeploymentPostprocessing = 0;

Examples/apps/BasicExample/BasicExample/AppDelegate.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
2121
.flushInterval(10)
2222

2323
analytics = Analytics(configuration: configuration)
24+
analytics?.add(plugin: ConsoleLogger(name: "consoleLogger"))
2425

2526
return true
2627
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"colors" : [
3+
{
4+
"idiom" : "universal"
5+
}
6+
],
7+
"info" : {
8+
"author" : "xcode",
9+
"version" : 1
10+
}
11+
}
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "watch",
5+
"role" : "notificationCenter",
6+
"scale" : "2x",
7+
"size" : "24x24",
8+
"subtype" : "38mm"
9+
},
10+
{
11+
"idiom" : "watch",
12+
"role" : "notificationCenter",
13+
"scale" : "2x",
14+
"size" : "27.5x27.5",
15+
"subtype" : "42mm"
16+
},
17+
{
18+
"idiom" : "watch",
19+
"role" : "companionSettings",
20+
"scale" : "2x",
21+
"size" : "29x29"
22+
},
23+
{
24+
"idiom" : "watch",
25+
"role" : "companionSettings",
26+
"scale" : "3x",
27+
"size" : "29x29"
28+
},
29+
{
30+
"idiom" : "watch",
31+
"role" : "appLauncher",
32+
"scale" : "2x",
33+
"size" : "40x40",
34+
"subtype" : "38mm"
35+
},
36+
{
37+
"idiom" : "watch",
38+
"role" : "appLauncher",
39+
"scale" : "2x",
40+
"size" : "44x44",
41+
"subtype" : "40mm"
42+
},
43+
{
44+
"idiom" : "watch",
45+
"role" : "appLauncher",
46+
"scale" : "2x",
47+
"size" : "50x50",
48+
"subtype" : "44mm"
49+
},
50+
{
51+
"idiom" : "watch",
52+
"role" : "quickLook",
53+
"scale" : "2x",
54+
"size" : "86x86",
55+
"subtype" : "38mm"
56+
},
57+
{
58+
"idiom" : "watch",
59+
"role" : "quickLook",
60+
"scale" : "2x",
61+
"size" : "98x98",
62+
"subtype" : "42mm"
63+
},
64+
{
65+
"idiom" : "watch",
66+
"role" : "quickLook",
67+
"scale" : "2x",
68+
"size" : "108x108",
69+
"subtype" : "44mm"
70+
},
71+
{
72+
"idiom" : "watch-marketing",
73+
"scale" : "1x",
74+
"size" : "1024x1024"
75+
}
76+
],
77+
"info" : {
78+
"author" : "xcode",
79+
"version" : 1
80+
}
81+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"info" : {
3+
"author" : "xcode",
4+
"version" : 1
5+
}
6+
}
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<document type="com.apple.InterfaceBuilder.WatchKit.Storyboard" version="3.0" toolsVersion="18122" targetRuntime="watchKit" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="AgC-eL-Hgc">
3+
<device id="watch38"/>
4+
<dependencies>
5+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="18093"/>
6+
<plugIn identifier="com.apple.InterfaceBuilder.IBWatchKitPlugin" version="18022"/>
7+
</dependencies>
8+
<scenes>
9+
<!--Interface Controller-->
10+
<scene sceneID="aou-V4-d1y">
11+
<objects>
12+
<controller id="AgC-eL-Hgc" customClass="InterfaceController" customModule="watchOSExample_WatchKit_App" customModuleProvider="target">
13+
<items>
14+
<button width="1" alignment="left" title="Track" id="TX6-Sq-oGR">
15+
<connections>
16+
<action selector="trackTapped" destination="AgC-eL-Hgc" id="AYJ-pO-OhO"/>
17+
</connections>
18+
</button>
19+
<button width="1" alignment="left" title="Identify" id="aKq-dG-sNw">
20+
<connections>
21+
<action selector="identifyTapped" destination="AgC-eL-Hgc" id="Xa4-5D-8LD"/>
22+
</connections>
23+
</button>
24+
<button width="1" alignment="left" title="Screen" id="lsE-gs-pOx">
25+
<connections>
26+
<segue destination="cFB-UF-t5z" kind="push" id="4VG-Pa-2Vx"/>
27+
</connections>
28+
</button>
29+
</items>
30+
</controller>
31+
</objects>
32+
<point key="canvasLocation" x="-5" y="222"/>
33+
</scene>
34+
<!--Some Screen Controller-->
35+
<scene sceneID="Kpw-KN-5lO">
36+
<objects>
37+
<controller id="cFB-UF-t5z" customClass="SomeScreenController" customModule="watchOSExample_WatchKit_Extension">
38+
<items>
39+
<label height="20" alignment="left" verticalAlignment="center" text="Screen Event Sent" id="tqN-Yf-bvb"/>
40+
</items>
41+
</controller>
42+
</objects>
43+
<point key="canvasLocation" x="263" y="132"/>
44+
</scene>
45+
<!--Static Notification Interface Controller-->
46+
<scene sceneID="AEw-b0-oYE">
47+
<objects>
48+
<notificationController id="YCC-NB-fut">
49+
<items>
50+
<label alignment="left" text="Alert Label" numberOfLines="0" id="IdU-wH-bcW"/>
51+
</items>
52+
<notificationCategory key="notificationCategory" identifier="myCategory" id="JfB-70-Muf"/>
53+
<connections>
54+
<outlet property="notificationAlertLabel" destination="IdU-wH-bcW" id="JKC-fr-R95"/>
55+
<segue destination="4sK-HA-Art" kind="relationship" relationship="dynamicNotificationInterface" id="kXh-Jw-8B1"/>
56+
<segue destination="eXb-UN-Cd0" kind="relationship" relationship="dynamicInteractiveNotificationInterface" id="mpB-YA-K8N"/>
57+
</connections>
58+
</notificationController>
59+
</objects>
60+
<point key="canvasLocation" x="95" y="643"/>
61+
</scene>
62+
<!--Notification Controller-->
63+
<scene sceneID="ZPc-GJ-vnh">
64+
<objects>
65+
<controller id="4sK-HA-Art" customClass="NotificationController" customModule="watchOSExample_WatchKit_App" customModuleProvider="target"/>
66+
</objects>
67+
<point key="canvasLocation" x="468" y="643"/>
68+
</scene>
69+
<!--Notification Controller-->
70+
<scene sceneID="Niz-AI-uX2">
71+
<objects>
72+
<controller id="eXb-UN-Cd0" customClass="NotificationController" customModule="watchOSExample_WatchKit_App" customModuleProvider="target"/>
73+
</objects>
74+
<point key="canvasLocation" x="468" y="345"/>
75+
</scene>
76+
</scenes>
77+
</document>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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>$(DEVELOPMENT_LANGUAGE)</string>
7+
<key>CFBundleDisplayName</key>
8+
<string>watchOSExample WatchKit App</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>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
19+
<key>CFBundleShortVersionString</key>
20+
<string>1.0</string>
21+
<key>CFBundleVersion</key>
22+
<string>1</string>
23+
<key>UISupportedInterfaceOrientations</key>
24+
<array>
25+
<string>UIInterfaceOrientationPortrait</string>
26+
<string>UIInterfaceOrientationPortraitUpsideDown</string>
27+
</array>
28+
<key>WKWatchKitApp</key>
29+
<true/>
30+
</dict>
31+
</plist>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "watch",
5+
"scale" : "2x",
6+
"screen-width" : "<=145"
7+
},
8+
{
9+
"idiom" : "watch",
10+
"scale" : "2x",
11+
"screen-width" : ">161"
12+
},
13+
{
14+
"idiom" : "watch",
15+
"scale" : "2x",
16+
"screen-width" : ">145"
17+
},
18+
{
19+
"idiom" : "watch",
20+
"scale" : "2x",
21+
"screen-width" : ">183"
22+
}
23+
],
24+
"info" : {
25+
"author" : "xcode",
26+
"version" : 1
27+
}
28+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"assets" : [
3+
{
4+
"filename" : "Circular.imageset",
5+
"idiom" : "watch",
6+
"role" : "circular"
7+
},
8+
{
9+
"filename" : "Extra Large.imageset",
10+
"idiom" : "watch",
11+
"role" : "extra-large"
12+
},
13+
{
14+
"filename" : "Graphic Bezel.imageset",
15+
"idiom" : "watch",
16+
"role" : "graphic-bezel"
17+
},
18+
{
19+
"filename" : "Graphic Circular.imageset",
20+
"idiom" : "watch",
21+
"role" : "graphic-circular"
22+
},
23+
{
24+
"filename" : "Graphic Corner.imageset",
25+
"idiom" : "watch",
26+
"role" : "graphic-corner"
27+
},
28+
{
29+
"filename" : "Graphic Extra Large.imageset",
30+
"idiom" : "watch",
31+
"role" : "graphic-extra-large"
32+
},
33+
{
34+
"filename" : "Graphic Large Rectangular.imageset",
35+
"idiom" : "watch",
36+
"role" : "graphic-large-rectangular"
37+
},
38+
{
39+
"filename" : "Modular.imageset",
40+
"idiom" : "watch",
41+
"role" : "modular"
42+
},
43+
{
44+
"filename" : "Utilitarian.imageset",
45+
"idiom" : "watch",
46+
"role" : "utilitarian"
47+
}
48+
],
49+
"info" : {
50+
"author" : "xcode",
51+
"version" : 1
52+
}
53+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "watch",
5+
"scale" : "2x",
6+
"screen-width" : "<=145"
7+
},
8+
{
9+
"idiom" : "watch",
10+
"scale" : "2x",
11+
"screen-width" : ">161"
12+
},
13+
{
14+
"idiom" : "watch",
15+
"scale" : "2x",
16+
"screen-width" : ">145"
17+
},
18+
{
19+
"idiom" : "watch",
20+
"scale" : "2x",
21+
"screen-width" : ">183"
22+
}
23+
],
24+
"info" : {
25+
"author" : "xcode",
26+
"version" : 1
27+
}
28+
}

0 commit comments

Comments
 (0)