diff --git a/MTMR.xcodeproj/project.pbxproj b/MTMR.xcodeproj/project.pbxproj index e2179bb..4251a02 100644 --- a/MTMR.xcodeproj/project.pbxproj +++ b/MTMR.xcodeproj/project.pbxproj @@ -348,7 +348,7 @@ TargetAttributes = { B082B24E205C7D8000BC04DC = { CreatedOnToolsVersion = 9.2; - LastSwiftMigration = 1020; + LastSwiftMigration = 1000; ProvisioningStyle = Manual; SystemCapabilities = { com.apple.Sandbox = { @@ -358,7 +358,7 @@ }; B082B260205C7D8000BC04DC = { CreatedOnToolsVersion = 9.2; - LastSwiftMigration = 1020; + LastSwiftMigration = 1000; }; }; }; @@ -622,7 +622,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "MTMR/CBridge/TouchBarPrivateApi-Bridging.h"; - SWIFT_VERSION = 5.0; + SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -645,7 +645,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "MTMR/CBridge/TouchBarPrivateApi-Bridging.h"; - SWIFT_VERSION = 5.0; + SWIFT_VERSION = 4.2; }; name = Release; }; @@ -658,7 +658,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = Toxblh.MTMRTests; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 5.0; + SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -673,7 +673,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = Toxblh.MTMRTests; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 5.0; + SWIFT_VERSION = 4.2; }; name = Release; }; diff --git a/MTMR/AppDelegate.swift b/MTMR/AppDelegate.swift index b57c7dc..d6adfe5 100644 --- a/MTMR/AppDelegate.swift +++ b/MTMR/AppDelegate.swift @@ -51,7 +51,7 @@ class AppDelegate: NSObject, NSApplicationDelegate { } if frontmostApplicationIdentifier != nil { - isBlockedApp = blacklistAppIdentifiers.firstIndex(of: frontmostApplicationIdentifier!) != nil + isBlockedApp = blacklistAppIdentifiers.index(of: frontmostApplicationIdentifier!) != nil } else { isBlockedApp = false } @@ -76,7 +76,7 @@ class AppDelegate: NSObject, NSApplicationDelegate { @objc func toggleBlackListedApp(_: Any?) { let appIdentifier = TouchBarController.shared.frontmostApplicationIdentifier if appIdentifier != nil { - if let index = TouchBarController.shared.blacklistAppIdentifiers.firstIndex(of: appIdentifier!) { + if let index = TouchBarController.shared.blacklistAppIdentifiers.index(of: appIdentifier!) { TouchBarController.shared.blacklistAppIdentifiers.remove(at: index) } else { TouchBarController.shared.blacklistAppIdentifiers.append(appIdentifier!) diff --git a/MTMR/TouchBarController.swift b/MTMR/TouchBarController.swift index 2f70d9d..a23ebe8 100644 --- a/MTMR/TouchBarController.swift +++ b/MTMR/TouchBarController.swift @@ -146,7 +146,7 @@ class TouchBarController: NSObject, NSTouchBarDelegate { } func updateActiveApp() { - if frontmostApplicationIdentifier != nil && blacklistAppIdentifiers.firstIndex(of: frontmostApplicationIdentifier!) != nil { + if frontmostApplicationIdentifier != nil && blacklistAppIdentifiers.index(of: frontmostApplicationIdentifier!) != nil { dismissTouchBar() } else { presentTouchBar() diff --git a/MTMR/Widgets/AppScrubberTouchBarItem.swift b/MTMR/Widgets/AppScrubberTouchBarItem.swift index 46a2b8c..8d15966 100644 --- a/MTMR/Widgets/AppScrubberTouchBarItem.swift +++ b/MTMR/Widgets/AppScrubberTouchBarItem.swift @@ -72,7 +72,7 @@ class AppScrubberTouchBarItem: NSCustomTouchBarItem, NSScrubberDelegate, NSScrub func updateRunningApplication() { let newApplications = launchedApplications() - let index = newApplications.firstIndex { + let index = newApplications.index { $0.bundleIdentifier == frontmostApplicationIdentifier } @@ -181,7 +181,7 @@ class AppScrubberTouchBarItem: NSCustomTouchBarItem, NSScrubberDelegate, NSScrub } } else { hf.tap(strong: 6) - if let index = self.persistentAppIdentifiers.firstIndex(of: bundleIdentifier!) { + if let index = self.persistentAppIdentifiers.index(of: bundleIdentifier!) { persistentAppIdentifiers.remove(at: index) } else { persistentAppIdentifiers.append(bundleIdentifier!)