From 0d84b3b1a56cb3e299fe3a96aee32e78346e30ba Mon Sep 17 00:00:00 2001 From: Matan Mashraki Date: Tue, 18 Jun 2019 15:27:46 +0300 Subject: [PATCH] Upgraded to Swift 5 --- Auto Dark.xcodeproj/project.pbxproj | 5 +++-- Auto Dark/DarkMode.swift | 1 + Auto Dark/Info.plist | 4 ++-- Auto Dark/Logger.swift | 4 ++-- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Auto Dark.xcodeproj/project.pbxproj b/Auto Dark.xcodeproj/project.pbxproj index 14b819b..7bce3b2 100644 --- a/Auto Dark.xcodeproj/project.pbxproj +++ b/Auto Dark.xcodeproj/project.pbxproj @@ -121,6 +121,7 @@ TargetAttributes = { 905E4A7421A19E2500D1DBC7 = { CreatedOnToolsVersion = 10.1; + LastSwiftMigration = 1020; SystemCapabilities = { com.apple.Sandbox = { enabled = 0; @@ -322,7 +323,7 @@ MACOSX_DEPLOYMENT_TARGET = 10.14; PRODUCT_BUNDLE_IDENTIFIER = "com.matan.Auto-Dark"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -342,7 +343,7 @@ MACOSX_DEPLOYMENT_TARGET = 10.14; PRODUCT_BUNDLE_IDENTIFIER = "com.matan.Auto-Dark"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; }; name = Release; }; diff --git a/Auto Dark/DarkMode.swift b/Auto Dark/DarkMode.swift index 4693dea..89e6639 100644 --- a/Auto Dark/DarkMode.swift +++ b/Auto Dark/DarkMode.swift @@ -50,6 +50,7 @@ struct DarkMode { static func toggle(force: Bool? = nil) { let value = force.map(String.init) ?? "not dark mode" let command = "\(prefix) set dark mode to \(value)" + Logger.log("Setting dark mode to \(value)") runAppleScript(command) } diff --git a/Auto Dark/Info.plist b/Auto Dark/Info.plist index de81869..10d67fb 100644 --- a/Auto Dark/Info.plist +++ b/Auto Dark/Info.plist @@ -17,9 +17,9 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.4.2 + 1.5 CFBundleVersion - 12 + 14 LSApplicationCategoryType public.app-category.utilities LSMinimumSystemVersion diff --git a/Auto Dark/Logger.swift b/Auto Dark/Logger.swift index e1aa674..d772d71 100644 --- a/Auto Dark/Logger.swift +++ b/Auto Dark/Logger.swift @@ -33,8 +33,8 @@ struct Logger { Gets a message, prints it and appends it to the log. - Parameters: - - message: The message to save. - - withTime: Includes the time of the message if true. + - message: The message to save. + - withTime: Includes the time of the message if true. */ static func log(_ message: String, withTime: Bool = true) { let save = withTime ? getTime() + " " + message : message