mirror of
https://github.com/sindresorhus/touch-bar-simulator
synced 2025-03-02 14:07:14 +00:00
Upgrade to Swift 4.2
This commit is contained in:
parent
81cac0e617
commit
c4ccc52bb8
3 changed files with 14 additions and 14 deletions
|
@ -346,7 +346,7 @@
|
|||
E3FE2CBE1E726CE800C6713A = {
|
||||
CreatedOnToolsVersion = 8.2.1;
|
||||
DevelopmentTeam = YG56YK5RN5;
|
||||
LastSwiftMigration = 0900;
|
||||
LastSwiftMigration = "";
|
||||
ProvisioningStyle = Automatic;
|
||||
SystemCapabilities = {
|
||||
com.apple.HardenedRuntime = {
|
||||
|
@ -539,8 +539,7 @@
|
|||
SWIFT_COMPILATION_MODE = singlefile;
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Touch Bar Simulator/Touch Bar Simulator-Bridging-Header.h";
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
|
||||
SWIFT_VERSION = 4.0;
|
||||
SWIFT_VERSION = 4.2;
|
||||
VALID_ARCHS = x86_64;
|
||||
};
|
||||
name = Debug;
|
||||
|
@ -573,8 +572,7 @@
|
|||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
REEXPORTED_LIBRARY_PATHS = "";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Touch Bar Simulator/Touch Bar Simulator-Bridging-Header.h";
|
||||
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
|
||||
SWIFT_VERSION = 4.0;
|
||||
SWIFT_VERSION = 4.2;
|
||||
VALID_ARCHS = x86_64;
|
||||
};
|
||||
name = Release;
|
||||
|
|
|
@ -3,7 +3,7 @@ import Sparkle
|
|||
|
||||
private let defaults = UserDefaults.standard
|
||||
|
||||
final class AppDelegate: NSObject, NSApplicationDelegate, NSWindowDelegate {
|
||||
final class AppDelegate: NSObject, NSApplicationDelegate {
|
||||
let controller = IDETouchBarSimulatorHostWindowController.simulatorHostWindowController()!
|
||||
lazy var window: NSWindow = self.controller.window!
|
||||
lazy var toolbarView: NSView = self.window.toolbarView!
|
||||
|
@ -17,7 +17,9 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSWindowDelegate {
|
|||
|
||||
func applicationDidFinishLaunching(_ notification: Notification) {
|
||||
NSApp.servicesProvider = self
|
||||
|
||||
window.delegate = self
|
||||
window.alphaValue = CGFloat(defaults.double(forKey: "windowTransparency"))
|
||||
|
||||
_ = SUUpdater()
|
||||
|
||||
|
@ -27,10 +29,6 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSWindowDelegate {
|
|||
)
|
||||
}
|
||||
|
||||
func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func makeScreenshotButton() -> NSButton {
|
||||
let button = NSButton()
|
||||
button.image = #imageLiteral(resourceName: "ScreenshotButton")
|
||||
|
@ -43,13 +41,11 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSWindowDelegate {
|
|||
}
|
||||
|
||||
func makeTransparencySlider() -> ToolbarSlider {
|
||||
let transparency = defaults.double(forKey: "windowTransparency")
|
||||
let slider = ToolbarSlider()
|
||||
slider.frame = CGRect(x: toolbarView.frame.width - 150, y: 4, width: 120, height: 11)
|
||||
slider.action = #selector(setTransparency)
|
||||
slider.minValue = 0.5
|
||||
slider.doubleValue = transparency
|
||||
window.alphaValue = CGFloat(transparency)
|
||||
slider.doubleValue = defaults.double(forKey: "windowTransparency")
|
||||
return slider
|
||||
}
|
||||
|
||||
|
@ -70,3 +66,9 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSWindowDelegate {
|
|||
window.setIsVisible(!window.isVisible)
|
||||
}
|
||||
}
|
||||
|
||||
extension AppDelegate: NSWindowDelegate {
|
||||
func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ $ brew update && brew cask install touch-bar-simulator
|
|||
```
|
||||
|
||||
|
||||
*Requires macOS 10.13 or later.*
|
||||
*Requires macOS 10.14 or later.*
|
||||
|
||||
|
||||
## Screenshot
|
||||
|
|
Loading…
Add table
Reference in a new issue