diff --git a/MTMR.xcodeproj/project.pbxproj b/MTMR.xcodeproj/project.pbxproj index 205a4a1..89bdc6e 100644 --- a/MTMR.xcodeproj/project.pbxproj +++ b/MTMR.xcodeproj/project.pbxproj @@ -331,6 +331,7 @@ TargetAttributes = { B082B24E205C7D8000BC04DC = { CreatedOnToolsVersion = 9.2; + LastSwiftMigration = 1000; ProvisioningStyle = Manual; SystemCapabilities = { com.apple.Sandbox = { @@ -340,6 +341,7 @@ }; B082B260205C7D8000BC04DC = { CreatedOnToolsVersion = 9.2; + LastSwiftMigration = 1000; }; }; }; @@ -579,7 +581,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "MTMR/CBridge/TouchBarPrivateApi-Bridging.h"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -601,7 +603,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "MTMR/CBridge/TouchBarPrivateApi-Bridging.h"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; }; name = Release; }; @@ -614,7 +616,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = Toxblh.MTMRTests; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -629,7 +631,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = Toxblh.MTMRTests; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; }; name = Release; }; diff --git a/MTMR/ItemsParsing.swift b/MTMR/ItemsParsing.swift index ad9b2e2..79ea8c9 100644 --- a/MTMR/ItemsParsing.swift +++ b/MTMR/ItemsParsing.swift @@ -69,32 +69,32 @@ class SupportedTypesHolder { }, "volumeDown": { _ in - let imageParameter = GeneralParameter.image(source: NSImage(named: .touchBarVolumeDownTemplate)!) + let imageParameter = GeneralParameter.image(source: NSImage(named: NSImage.touchBarVolumeDownTemplateName)!) return (item: .staticButton(title: ""), action: .hidKey(keycode: NX_KEYTYPE_SOUND_DOWN), longAction: .none, parameters: [.image: imageParameter]) }, "volumeUp": { _ in - let imageParameter = GeneralParameter.image(source: NSImage(named: .touchBarVolumeUpTemplate)!) + let imageParameter = GeneralParameter.image(source: NSImage(named: NSImage.touchBarVolumeUpTemplateName)!) return (item: .staticButton(title: ""), action: .hidKey(keycode: NX_KEYTYPE_SOUND_UP), longAction: .none, parameters: [.image: imageParameter]) }, "mute": { _ in - let imageParameter = GeneralParameter.image(source: NSImage(named: .touchBarAudioOutputMuteTemplate)!) + let imageParameter = GeneralParameter.image(source: NSImage(named: NSImage.touchBarAudioOutputMuteTemplateName)!) return (item: .staticButton(title: ""), action: .hidKey(keycode: NX_KEYTYPE_MUTE), longAction: .none, parameters: [.image: imageParameter]) }, "previous": { _ in - let imageParameter = GeneralParameter.image(source: NSImage(named: .touchBarRewindTemplate)!) + let imageParameter = GeneralParameter.image(source: NSImage(named: NSImage.touchBarRewindTemplateName)!) return (item: .staticButton(title: ""), action: .hidKey(keycode: NX_KEYTYPE_PREVIOUS), longAction: .none, parameters: [.image: imageParameter]) }, "play": { _ in - let imageParameter = GeneralParameter.image(source: NSImage(named: .touchBarPlayPauseTemplate)!) + let imageParameter = GeneralParameter.image(source: NSImage(named: NSImage.touchBarPlayPauseTemplateName)!) return (item: .staticButton(title: ""), action: .hidKey(keycode: NX_KEYTYPE_PLAY), longAction: .none, parameters: [.image: imageParameter]) }, "next": { _ in - let imageParameter = GeneralParameter.image(source: NSImage(named: .touchBarFastForwardTemplate)!) + let imageParameter = GeneralParameter.image(source: NSImage(named: NSImage.touchBarFastForwardTemplateName)!) return (item: .staticButton(title: ""), action: .hidKey(keycode: NX_KEYTYPE_NEXT), longAction: .none, parameters: [.image: imageParameter]) }, diff --git a/MTMR/TouchBarController.swift b/MTMR/TouchBarController.swift index d9f4555..8023bb0 100644 --- a/MTMR/TouchBarController.swift +++ b/MTMR/TouchBarController.swift @@ -101,7 +101,7 @@ class TouchBarController: NSObject, NSTouchBarDelegate { return (item: .staticButton(title: ""), action: .custom(closure: { [weak self] in guard let `self` = self else { return } self.reloadPreset(path: self.lastPresetPath) - }), longAction: .none, parameters: [.width: .width(30), .image: .image(source: (NSImage(named: .stopProgressFreestandingTemplate))!)]) + }), longAction: .none, parameters: [.width: .width(30), .image: .image(source: (NSImage(named: NSImage.stopProgressFreestandingTemplateName))!)]) } if let blackListed = UserDefaults.standard.stringArray(forKey: "com.toxblh.mtmr.blackListedApps") { diff --git a/MTMR/Widgets/BatteryBarItem.swift b/MTMR/Widgets/BatteryBarItem.swift index 008813a..e1dd246 100644 --- a/MTMR/Widgets/BatteryBarItem.swift +++ b/MTMR/Widgets/BatteryBarItem.swift @@ -138,7 +138,7 @@ class BatteryInfo: NSObject { } let newTitle = NSMutableAttributedString(string: title as String, attributes: [.foregroundColor: color, .font: NSFont.systemFont(ofSize: 15), .baselineOffset: 1]) - let newTitleSecond = NSMutableAttributedString(string: timeRemaining as String, attributes: [NSAttributedStringKey.foregroundColor: color, NSAttributedStringKey.font: NSFont.systemFont(ofSize: 8, weight: .regular), NSAttributedStringKey.baselineOffset: 7]) + let newTitleSecond = NSMutableAttributedString(string: timeRemaining as String, attributes: [NSAttributedString.Key.foregroundColor: color, NSAttributedString.Key.font: NSFont.systemFont(ofSize: 8, weight: .regular), NSAttributedString.Key.baselineOffset: 7]) newTitle.append(newTitleSecond) newTitle.setAlignment(.center, range: NSRange(location: 0, length: title.count)) return newTitle diff --git a/MTMR/Widgets/BrightnessViewController.swift b/MTMR/Widgets/BrightnessViewController.swift index 3206c0c..6d67c05 100644 --- a/MTMR/Widgets/BrightnessViewController.swift +++ b/MTMR/Widgets/BrightnessViewController.swift @@ -23,7 +23,7 @@ class BrightnessViewController: NSCustomTouchBarItem { self.view = sliderItem let timer = Timer.scheduledTimer(timeInterval: refreshInterval, target: self, selector: #selector(BrightnessViewController.updateBrightnessSlider), userInfo: nil, repeats: true) - RunLoop.current.add(timer, forMode: RunLoopMode.commonModes) + RunLoop.current.add(timer, forMode: RunLoop.Mode.common) } required init?(coder: NSCoder) {