Skip to content

Commit 7afec33

Browse files
Swift 5 Update
1 parent cbd920f commit 7afec33

File tree

4 files changed

+26
-24
lines changed

4 files changed

+26
-24
lines changed

SimpleClock.xcodeproj/project.pbxproj

+15-13
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@
468468
TargetAttributes = {
469469
7D5CF6B52019C3730032670C = {
470470
CreatedOnToolsVersion = 9.2;
471-
LastSwiftMigration = 1000;
471+
LastSwiftMigration = 1020;
472472
ProvisioningStyle = Automatic;
473473
SystemCapabilities = {
474474
com.apple.Sandbox = {
@@ -478,22 +478,24 @@
478478
};
479479
7D5CF6CC2019C3730032670C = {
480480
CreatedOnToolsVersion = 9.2;
481-
LastSwiftMigration = 1000;
481+
LastSwiftMigration = 1020;
482482
ProvisioningStyle = Automatic;
483483
TestTargetID = 7D5CF6B52019C3730032670C;
484484
};
485485
7D5CF6D72019C3730032670C = {
486486
CreatedOnToolsVersion = 9.2;
487-
LastSwiftMigration = 1000;
487+
LastSwiftMigration = 1020;
488488
ProvisioningStyle = Automatic;
489489
TestTargetID = 7D5CF6B52019C3730032670C;
490490
};
491491
7D8C4A2A21E1C28B00F8ACDB = {
492492
CreatedOnToolsVersion = 10.1;
493+
LastSwiftMigration = 1020;
493494
ProvisioningStyle = Automatic;
494495
};
495496
7DB9B79421F04CB4004E692A = {
496497
CreatedOnToolsVersion = 10.1;
498+
LastSwiftMigration = 1020;
497499
ProvisioningStyle = Automatic;
498500
};
499501
};
@@ -849,7 +851,7 @@
849851
PRODUCT_NAME = "$(TARGET_NAME)";
850852
PROVISIONING_PROFILE_SPECIFIER = "";
851853
SWIFT_OBJC_BRIDGING_HEADER = "SimpleClock/SC-Bridge-Header.h";
852-
SWIFT_VERSION = 4.0;
854+
SWIFT_VERSION = 5.0;
853855
};
854856
name = Debug;
855857
};
@@ -875,7 +877,7 @@
875877
PRODUCT_NAME = "$(TARGET_NAME)";
876878
PROVISIONING_PROFILE_SPECIFIER = "";
877879
SWIFT_OBJC_BRIDGING_HEADER = "SimpleClock/SC-Bridge-Header.h";
878-
SWIFT_VERSION = 4.0;
880+
SWIFT_VERSION = 5.0;
879881
};
880882
name = Release;
881883
};
@@ -890,7 +892,7 @@
890892
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
891893
PRODUCT_BUNDLE_IDENTIFIER = zengtianyu.SimpleClockTests;
892894
PRODUCT_NAME = "$(TARGET_NAME)";
893-
SWIFT_VERSION = 4.2;
895+
SWIFT_VERSION = 5.0;
894896
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SimpleClock.app/Contents/MacOS/SimpleClock";
895897
};
896898
name = Debug;
@@ -906,7 +908,7 @@
906908
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
907909
PRODUCT_BUNDLE_IDENTIFIER = zengtianyu.SimpleClockTests;
908910
PRODUCT_NAME = "$(TARGET_NAME)";
909-
SWIFT_VERSION = 4.2;
911+
SWIFT_VERSION = 5.0;
910912
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SimpleClock.app/Contents/MacOS/SimpleClock";
911913
};
912914
name = Release;
@@ -921,7 +923,7 @@
921923
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
922924
PRODUCT_BUNDLE_IDENTIFIER = zengtianyu.SimpleClockUITests;
923925
PRODUCT_NAME = "$(TARGET_NAME)";
924-
SWIFT_VERSION = 4.2;
926+
SWIFT_VERSION = 5.0;
925927
TEST_TARGET_NAME = SimpleClock;
926928
};
927929
name = Debug;
@@ -936,7 +938,7 @@
936938
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
937939
PRODUCT_BUNDLE_IDENTIFIER = zengtianyu.SimpleClockUITests;
938940
PRODUCT_NAME = "$(TARGET_NAME)";
939-
SWIFT_VERSION = 4.2;
941+
SWIFT_VERSION = 5.0;
940942
TEST_TARGET_NAME = SimpleClock;
941943
};
942944
name = Release;
@@ -958,7 +960,7 @@
958960
PRODUCT_BUNDLE_IDENTIFIER = com.zengtianyu.SimpleClock.SCTimeWidget;
959961
PRODUCT_NAME = "$(TARGET_NAME)";
960962
SKIP_INSTALL = YES;
961-
SWIFT_VERSION = 4.2;
963+
SWIFT_VERSION = 5.0;
962964
};
963965
name = Debug;
964966
};
@@ -978,7 +980,7 @@
978980
PRODUCT_BUNDLE_IDENTIFIER = com.zengtianyu.SimpleClock.SCTimeWidget;
979981
PRODUCT_NAME = "$(TARGET_NAME)";
980982
SKIP_INSTALL = YES;
981-
SWIFT_VERSION = 4.2;
983+
SWIFT_VERSION = 5.0;
982984
};
983985
name = Release;
984986
};
@@ -999,7 +1001,7 @@
9991001
PRODUCT_BUNDLE_IDENTIFIER = com.zengtianyu.SimpleClock.SCCalWidget;
10001002
PRODUCT_NAME = "$(TARGET_NAME)";
10011003
SKIP_INSTALL = YES;
1002-
SWIFT_VERSION = 4.2;
1004+
SWIFT_VERSION = 5.0;
10031005
};
10041006
name = Debug;
10051007
};
@@ -1019,7 +1021,7 @@
10191021
PRODUCT_BUNDLE_IDENTIFIER = com.zengtianyu.SimpleClock.SCCalWidget;
10201022
PRODUCT_NAME = "$(TARGET_NAME)";
10211023
SKIP_INSTALL = YES;
1022-
SWIFT_VERSION = 4.2;
1024+
SWIFT_VERSION = 5.0;
10231025
};
10241026
name = Release;
10251027
};

SimpleClock/CalendarView/LunarCalendarView.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class LunarCalendarView:NSViewController{
6767
}
6868

6969
init(){
70-
super.init(nibName: NSNib.Name(rawValue: "LunarCalendarView"), bundle: nil)
70+
super.init(nibName: "LunarCalendarView", bundle: nil)
7171
commonInit()
7272
}
7373

SimpleClock/ViewController/StopwatchViewController.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ class StopwatchViewController : NSViewController {
6969
minute = 0
7070
TimerLabel.stringValue = "00:00:00"
7171
timer.fireDate = NSDate.init() as Date
72-
NSSound(named: NSSound.Name(rawValue: "Glass.aiff"))?.play()
72+
NSSound(named: "Glass.aiff")?.play()
7373
}else if isPause{
7474
timer.fireDate = NSDate.init() as Date
7575
isPause = false
76-
NSSound(named: NSSound.Name(rawValue: "Pop.aiff"))?.play()
76+
NSSound(named: "Pop.aiff")?.play()
7777
}
7878
}
7979

@@ -82,7 +82,7 @@ class StopwatchViewController : NSViewController {
8282
if isStart {
8383
timer.fireDate = Date.distantFuture
8484
isPause = true
85-
NSSound(named: NSSound.Name(rawValue: "Pop.aiff"))?.play()
85+
NSSound(named: "Pop.aiff")?.play()
8686
}
8787
}
8888

@@ -94,7 +94,7 @@ class StopwatchViewController : NSViewController {
9494
hour = 0
9595
minute = 0
9696
isStart = false
97-
NSSound(named: NSSound.Name(rawValue: "Glass.aiff"))?.play()
97+
NSSound(named: "Glass.aiff")?.play()
9898
}
9999
}
100100
}

SimpleClock/ViewController/TimerViewController.swift

+6-6
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class TimerViewController : NSViewController, NSUserNotificationCenterDelegate{
5757
if TimerText.stringValue == "00:00:00" {
5858
timer.fireDate = Date.distantFuture
5959
TimerText.textColor = NSColor.red
60-
NSSound(named: NSSound.Name(rawValue: "Glass.aiff"))?.play()
60+
NSSound(named: "Glass.aiff")?.play()
6161
let userNotification = NSUserNotification()
6262
userNotification.title = NSLocalizedString("TimeUp", comment: "default")
6363
userNotification.subtitle = String(format: NSLocalizedString("TimeUpA", comment: "default"), total)
@@ -75,7 +75,7 @@ class TimerViewController : NSViewController, NSUserNotificationCenterDelegate{
7575
if hour == 0 && minute == 0 && second == 0{
7676
timer.fireDate = Date.distantFuture
7777
TimerText.textColor = NSColor.red
78-
NSSound(named: NSSound.Name(rawValue: "Glass.aiff"))?.play()
78+
NSSound(named: "Glass.aiff")?.play()
7979
let userNotification = NSUserNotification()
8080
userNotification.title = NSLocalizedString("TimeUp", comment: "default")
8181
userNotification.subtitle = String(format: NSLocalizedString("TimeUpA", comment: "default"), total)
@@ -119,20 +119,20 @@ class TimerViewController : NSViewController, NSUserNotificationCenterDelegate{
119119
Indicater.maxValue = Double(totalSecond)
120120
timer.fireDate = NSDate.init() as Date
121121
TimerText.textColor = NSColor.white
122-
NSSound(named: NSSound.Name(rawValue: "Glass.aiff"))?.play()
122+
NSSound(named: "Glass.aiff")?.play()
123123
runningSec = 0
124124
}else if isPause{
125125
timer.fireDate = NSDate.init() as Date
126126
isPause = false
127-
NSSound(named: NSSound.Name(rawValue: "Pop.aiff"))?.play()
127+
NSSound(named: "Pop.aiff")?.play()
128128
}
129129
}
130130

131131
@IBAction func PauseTimer(_ sender: NSButton) {
132132
if isStart {
133133
isPause = true
134134
timer.fireDate = Date.distantFuture
135-
NSSound(named: NSSound.Name(rawValue: "Pop.aiff"))?.play()
135+
NSSound(named: "Pop.aiff")?.play()
136136
}
137137
}
138138

@@ -147,7 +147,7 @@ class TimerViewController : NSViewController, NSUserNotificationCenterDelegate{
147147
TimerText.stringValue = "00:00:00"
148148
Indicater.doubleValue = 0
149149
TimerText.textColor = NSColor.white
150-
NSSound(named: NSSound.Name(rawValue: "Glass.aiff"))?.play()
150+
NSSound(named: "Glass.aiff")?.play()
151151

152152
let userNotification = NSUserNotification()
153153
userNotification.title = NSLocalizedString("TimeUp", comment: "default")

0 commit comments

Comments
 (0)