Skip to content

Commit 0156e22

Browse files
committed
Updated for Swift 4.2.
1 parent 370afb6 commit 0156e22

File tree

163 files changed

+1327
-7609
lines changed

Some content is hidden

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

163 files changed

+1327
-7609
lines changed

Project37/Project37 WatchKit Extension/InterfaceController.swift

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,41 +12,41 @@ import WatchConnectivity
1212

1313

1414
class InterfaceController: WKInterfaceController, WCSessionDelegate {
15-
@IBOutlet var welcomeText: WKInterfaceLabel!
16-
@IBOutlet var hideButton: WKInterfaceButton!
17-
15+
@IBOutlet var welcomeText: WKInterfaceLabel!
16+
@IBOutlet var hideButton: WKInterfaceButton!
17+
1818
override func awake(withContext context: Any?) {
1919
super.awake(withContext: context)
2020

2121
// Configure interface objects here.
2222
}
23-
23+
2424
override func willActivate() {
2525
// This method is called when watch view controller is about to be visible to user
2626
super.willActivate()
27-
28-
if WCSession.isSupported() {
29-
let session = WCSession.default
30-
session.delegate = self
31-
session.activate()
32-
}
27+
28+
if WCSession.isSupported() {
29+
let session = WCSession.default
30+
session.delegate = self
31+
session.activate()
32+
}
3333
}
34-
34+
3535
override func didDeactivate() {
3636
// This method is called when watch view controller is no longer visible
3737
super.didDeactivate()
3838
}
39-
40-
@IBAction func hideWelcomeText() {
41-
welcomeText.setHidden(true)
42-
hideButton.setHidden(true)
43-
}
44-
45-
func session(_ session: WCSession, activationDidCompleteWith activationState: WCSessionActivationState, error: Error?) {
46-
47-
}
48-
49-
func session(_ session: WCSession, didReceiveMessage message: [String : Any]) {
50-
WKInterfaceDevice().play(.click)
51-
}
39+
40+
@IBAction func hideWelcomeText() {
41+
welcomeText.setHidden(true)
42+
hideButton.setHidden(true)
43+
}
44+
45+
func session(_ session: WCSession, activationDidCompleteWith activationState: WCSessionActivationState, error: Error?) {
46+
47+
}
48+
49+
func session(_ session: WCSession, didReceiveMessage message: [String : Any]) {
50+
WKInterfaceDevice().play(.click)
51+
}
5252
}

Project37/Project37.xcodeproj/project.pbxproj

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@
424424
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
425425
GCC_WARN_UNUSED_FUNCTION = YES;
426426
GCC_WARN_UNUSED_VARIABLE = YES;
427-
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
427+
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
428428
MTL_ENABLE_DEBUG_INFO = YES;
429429
ONLY_ACTIVE_ARCH = YES;
430430
SDKROOT = iphoneos;
@@ -476,7 +476,7 @@
476476
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
477477
GCC_WARN_UNUSED_FUNCTION = YES;
478478
GCC_WARN_UNUSED_VARIABLE = YES;
479-
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
479+
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
480480
MTL_ENABLE_DEBUG_INFO = NO;
481481
SDKROOT = iphoneos;
482482
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
@@ -496,7 +496,7 @@
496496
SDKROOT = watchos;
497497
SKIP_INSTALL = YES;
498498
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
499-
SWIFT_VERSION = 4.0;
499+
SWIFT_VERSION = 4.2;
500500
TARGETED_DEVICE_FAMILY = 4;
501501
WATCHOS_DEPLOYMENT_TARGET = 3.0;
502502
};
@@ -514,7 +514,7 @@
514514
SDKROOT = watchos;
515515
SKIP_INSTALL = YES;
516516
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
517-
SWIFT_VERSION = 4.0;
517+
SWIFT_VERSION = 4.2;
518518
TARGETED_DEVICE_FAMILY = 4;
519519
WATCHOS_DEPLOYMENT_TARGET = 3.0;
520520
};
@@ -532,7 +532,7 @@
532532
PRODUCT_NAME = "$(TARGET_NAME)";
533533
SDKROOT = watchos;
534534
SKIP_INSTALL = YES;
535-
SWIFT_VERSION = 3.0;
535+
SWIFT_VERSION = 4.2;
536536
TARGETED_DEVICE_FAMILY = 4;
537537
WATCHOS_DEPLOYMENT_TARGET = 3.0;
538538
};
@@ -550,7 +550,7 @@
550550
PRODUCT_NAME = "$(TARGET_NAME)";
551551
SDKROOT = watchos;
552552
SKIP_INSTALL = YES;
553-
SWIFT_VERSION = 3.0;
553+
SWIFT_VERSION = 4.2;
554554
TARGETED_DEVICE_FAMILY = 4;
555555
WATCHOS_DEPLOYMENT_TARGET = 3.0;
556556
};
@@ -566,7 +566,7 @@
566566
PRODUCT_BUNDLE_IDENTIFIER = com.hackingwithswift.Project37;
567567
PRODUCT_NAME = "$(TARGET_NAME)";
568568
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
569-
SWIFT_VERSION = 4.0;
569+
SWIFT_VERSION = 4.2;
570570
};
571571
name = Debug;
572572
};
@@ -580,7 +580,7 @@
580580
PRODUCT_BUNDLE_IDENTIFIER = com.hackingwithswift.Project37;
581581
PRODUCT_NAME = "$(TARGET_NAME)";
582582
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
583-
SWIFT_VERSION = 4.0;
583+
SWIFT_VERSION = 4.2;
584584
};
585585
name = Release;
586586
};

Project37/Project37/AppDelegate.swift

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -10,37 +10,37 @@ import UIKit
1010

1111
@UIApplicationMain
1212
class AppDelegate: UIResponder, UIApplicationDelegate {
13-
14-
var window: UIWindow?
15-
16-
17-
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
18-
// Override point for customization after application launch.
19-
return true
20-
}
21-
22-
func applicationWillResignActive(_ application: UIApplication) {
23-
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
24-
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
25-
}
26-
27-
func applicationDidEnterBackground(_ application: UIApplication) {
28-
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
29-
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
30-
}
31-
32-
func applicationWillEnterForeground(_ application: UIApplication) {
33-
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
34-
}
35-
36-
func applicationDidBecomeActive(_ application: UIApplication) {
37-
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
38-
}
39-
40-
func applicationWillTerminate(_ application: UIApplication) {
41-
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
42-
}
43-
44-
13+
14+
var window: UIWindow?
15+
16+
17+
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
18+
// Override point for customization after application launch.
19+
return true
20+
}
21+
22+
func applicationWillResignActive(_ application: UIApplication) {
23+
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
24+
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
25+
}
26+
27+
func applicationDidEnterBackground(_ application: UIApplication) {
28+
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
29+
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
30+
}
31+
32+
func applicationWillEnterForeground(_ application: UIApplication) {
33+
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
34+
}
35+
36+
func applicationDidBecomeActive(_ application: UIApplication) {
37+
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
38+
}
39+
40+
func applicationWillTerminate(_ application: UIApplication) {
41+
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
42+
}
43+
44+
4545
}
4646

0 commit comments

Comments
 (0)