Skip to content

Commit a3eb368

Browse files
AkshayAkshay
authored andcommitted
Convergence
1 parent b2959b5 commit a3eb368

File tree

4 files changed

+24
-20
lines changed

4 files changed

+24
-20
lines changed

Sample/OCKSample.xcodeproj/project.pbxproj

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,7 @@
777777
SDKROOT = watchos;
778778
SKIP_INSTALL = YES;
779779
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
780-
SWIFT_VERSION = 4.0;
780+
SWIFT_VERSION = 3.0;
781781
TARGETED_DEVICE_FAMILY = 4;
782782
WATCHOS_DEPLOYMENT_TARGET = 3.0;
783783
};
@@ -799,7 +799,7 @@
799799
SKIP_INSTALL = YES;
800800
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
801801
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
802-
SWIFT_VERSION = 4.0;
802+
SWIFT_VERSION = 3.0;
803803
TARGETED_DEVICE_FAMILY = 4;
804804
WATCHOS_DEPLOYMENT_TARGET = 3.0;
805805
};
@@ -821,7 +821,7 @@
821821
SDKROOT = watchos;
822822
SKIP_INSTALL = YES;
823823
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
824-
SWIFT_VERSION = 4.0;
824+
SWIFT_VERSION = 3.0;
825825
TARGETED_DEVICE_FAMILY = 4;
826826
WATCHOS_DEPLOYMENT_TARGET = 3.0;
827827
};
@@ -843,7 +843,7 @@
843843
SDKROOT = watchos;
844844
SKIP_INSTALL = YES;
845845
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
846-
SWIFT_VERSION = 4.0;
846+
SWIFT_VERSION = 3.0;
847847
TARGETED_DEVICE_FAMILY = 4;
848848
WATCHOS_DEPLOYMENT_TARGET = 3.0;
849849
};
@@ -900,6 +900,7 @@
900900
ONLY_ACTIVE_ARCH = YES;
901901
SDKROOT = iphoneos;
902902
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
903+
SWIFT_VERSION = 3.0;
903904
};
904905
name = Debug;
905906
};
@@ -947,6 +948,7 @@
947948
MTL_ENABLE_DEBUG_INFO = NO;
948949
SDKROOT = iphoneos;
949950
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
951+
SWIFT_VERSION = 3.0;
950952
VALIDATE_PRODUCT = YES;
951953
};
952954
name = Release;
@@ -963,7 +965,7 @@
963965
PRODUCT_BUNDLE_IDENTIFIER = "com.example.apple-samplecode.CareKit";
964966
PRODUCT_NAME = "$(TARGET_NAME)";
965967
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
966-
SWIFT_VERSION = 4.0;
968+
SWIFT_VERSION = 3.0;
967969
TARGETED_DEVICE_FAMILY = "1,2";
968970
};
969971
name = Debug;
@@ -981,7 +983,7 @@
981983
PRODUCT_NAME = "$(TARGET_NAME)";
982984
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
983985
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
984-
SWIFT_VERSION = 4.0;
986+
SWIFT_VERSION = 3.0;
985987
TARGETED_DEVICE_FAMILY = "1,2";
986988
};
987989
name = Release;

Sample/OCKSampleWatch Extension/InterfaceController.swift

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,15 @@ class InterfaceController: WKInterfaceController {
5555

5656
override func awake(withContext context: Any?) {
5757
super.awake(withContext: context)
58-
session.delegate = self
59-
session.activate()
58+
session().delegate = self
59+
session().activate()
6060
}
6161

6262
override func willActivate() {
6363
self.setTitle("")
6464

65-
if session.activationState != .activated {
66-
session.activate()
65+
if session().activationState != .activated {
66+
session().activate()
6767
} else {
6868
loadData()
6969
}
@@ -84,7 +84,7 @@ class InterfaceController: WKInterfaceController {
8484
}
8585

8686
func didLosePhoneConnection() {
87-
guard session.activationState != .activated else {
87+
guard session().activationState != .activated else {
8888
return
8989
}
9090

@@ -229,7 +229,7 @@ class InterfaceController: WKInterfaceController {
229229

230230
func updateDataStoreEvent(withActivityIdentifier activityIdentifier : String, atIndex eventIndex : Int, toCompletedState completedState : Bool) {
231231

232-
if !session.isReachable {
232+
if !session().isReachable {
233233
didLosePhoneConnection()
234234
return
235235
}
@@ -246,7 +246,7 @@ class InterfaceController: WKInterfaceController {
246246
updateComplications(withCompletionPercentage: nil)
247247

248248
encoder.finishEncoding()
249-
session.sendMessageData(data as Data, replyHandler: {data in
249+
session().sendMessageData(data as Data, replyHandler: {data in
250250
let decoder = NSKeyedUnarchiver(forReadingWith: data)
251251
if decoder.decodeBool(forKey: "success") {
252252
} else {
@@ -262,8 +262,8 @@ class InterfaceController: WKInterfaceController {
262262
}
263263

264264
func messagingErrorHandler(_ error : Error) {
265-
NSLog("error: \(error)\nsession reachable = \(session.isReachable)")
266-
if session.activationState != .activated {
265+
NSLog("error: \(error)\nsession reachable = \(session().isReachable)")
266+
if session().activationState != .activated {
267267
didLosePhoneConnection()
268268
} else {
269269
loadData()
@@ -278,12 +278,12 @@ class InterfaceController: WKInterfaceController {
278278
// MARK: Fetching Data
279279

280280
func getAllData() {
281-
if session.activationState == .activated {
281+
if session().activationState == .activated {
282282
let data = NSMutableData()
283283
let encoder = NSKeyedArchiver(forWritingWith: data)
284284
encoder.encode("getAllData", forKey: "type")
285285
encoder.finishEncoding()
286-
session.sendMessageData(data as Data, replyHandler: {(data) in
286+
session().sendMessageData(data as Data, replyHandler: {(data) in
287287
let decoder = NSKeyedUnarchiver(forReadingWith: data)
288288
defer {
289289
decoder.finishDecoding()

dependency

Submodule dependency updated 425 files

testing/OCKTest/OCKTest.xcodeproj/project.pbxproj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,7 @@
477477
ONLY_ACTIVE_ARCH = YES;
478478
SDKROOT = iphoneos;
479479
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
480+
SWIFT_VERSION = 3.0;
480481
TARGETED_DEVICE_FAMILY = "1,2";
481482
};
482483
name = Debug;
@@ -524,6 +525,7 @@
524525
MTL_ENABLE_DEBUG_INFO = NO;
525526
SDKROOT = iphoneos;
526527
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
528+
SWIFT_VERSION = 3.0;
527529
TARGETED_DEVICE_FAMILY = "1,2";
528530
VALIDATE_PRODUCT = YES;
529531
};
@@ -540,7 +542,7 @@
540542
PRODUCT_BUNDLE_IDENTIFIER = org.carekit.OCKTest;
541543
PRODUCT_NAME = OCKTest;
542544
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
543-
SWIFT_VERSION = 4.0;
545+
SWIFT_VERSION = 3.0;
544546
TARGETED_DEVICE_FAMILY = "1,2";
545547
};
546548
name = Debug;
@@ -556,7 +558,7 @@
556558
PRODUCT_BUNDLE_IDENTIFIER = org.carekit.OCKTest;
557559
PRODUCT_NAME = OCKTest;
558560
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
559-
SWIFT_VERSION = 4.0;
561+
SWIFT_VERSION = 3.0;
560562
TARGETED_DEVICE_FAMILY = "1,2";
561563
};
562564
name = Release;

0 commit comments

Comments
 (0)