From 45802b2fbac185302e2c32633800140f9be247f6 Mon Sep 17 00:00:00 2001 From: ZEO Date: Tue, 12 Sep 2017 11:10:59 +0800 Subject: [PATCH] update to Swift 4 --- FlatButton.xcodeproj/project.pbxproj | 10 +++-- .../UserInterfaceState.xcuserstate | Bin 0 -> 30647 bytes .../xcschemes/FlatButton.xcscheme | 2 + .../xcschemes/xcschememanagement.plist | 19 +++++++++ FlatButton/FlatButton.swift | 40 +++++++++--------- 5 files changed, 48 insertions(+), 23 deletions(-) create mode 100644 FlatButton.xcodeproj/project.xcworkspace/xcuserdata/zeo.xcuserdatad/UserInterfaceState.xcuserstate create mode 100644 FlatButton.xcodeproj/xcuserdata/zeo.xcuserdatad/xcschemes/xcschememanagement.plist diff --git a/FlatButton.xcodeproj/project.pbxproj b/FlatButton.xcodeproj/project.pbxproj index 781d2bb..081ba03 100644 --- a/FlatButton.xcodeproj/project.pbxproj +++ b/FlatButton.xcodeproj/project.pbxproj @@ -249,7 +249,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; @@ -275,7 +275,7 @@ PRODUCT_BUNDLE_IDENTIFIER = org.cindori.FlatButton; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; @@ -328,6 +328,7 @@ SDKROOT = macosx; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -370,6 +371,7 @@ MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 4.0; }; name = Release; }; @@ -383,7 +385,7 @@ MACOSX_DEPLOYMENT_TARGET = 10.10; PRODUCT_BUNDLE_IDENTIFIER = "org.cindori.FlatButton-Example"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -397,7 +399,7 @@ MACOSX_DEPLOYMENT_TARGET = 10.10; PRODUCT_BUNDLE_IDENTIFIER = "org.cindori.FlatButton-Example"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; }; name = Release; }; diff --git a/FlatButton.xcodeproj/project.xcworkspace/xcuserdata/zeo.xcuserdatad/UserInterfaceState.xcuserstate b/FlatButton.xcodeproj/project.xcworkspace/xcuserdata/zeo.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000000000000000000000000000000000000..0856bd2616959f1ced3c433196b9d41c285e8b59 GIT binary patch literal 30647 zcmeIbcVJXS_Xd3D-rc=-Q#U=KWCJ9dx~ZGqd#{^pdN!NQrbtL)HUUDBxrl&bLoA3W zB%z2Rh>9XbiYOwANEK1BpopLdh=5qWGrQRoNPOSl_ww=ACo0LkGjq><=9zQOoHH}G zuDzvM-x(NqltL6uF_eH3QX+A^SXbsgRo9_!Zfh-bZ>zgUr|s02yK6eMP0et**uAr@ z-IhZ0S8lYS@1%AoS7e5!=1 zq^hV|s)=f*?xEVK4r(eji^3F7EvBBJmQYVpPf<@(&rnOL7pN7~Dry6@k$RQdM7>76 zPHm=kQoE?#)L!a6YCrV}b%^?$Iz@d!eMx;qouGSE=8rYt(h>2K5(0NQgKj zMpnokIUq+g2Du|Iob)l(f8k&PJ;?Z1mKbnUgK=aX3^ekG2o*-Fqi=IwDNX%8<}m)PUb!4eP%!NA#;E^ z!F<7d%Y4V2WzI9#n48Q$0!qLL1OlPJM&KwICm1i7An*_b2|@*tf+#_(AWjf3$QBd` zRDx1Lr9ds1ENBzx1)YLvg6V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&l$n)Tlv$P8l-ZSyEAuW3EDJ7E zl!cYWmL-%Wm8F)YmsON$%i7Dj%BGjiEW>4U%jT8MFI!die%X<-AIi>^T`0R)cDd|o z+4ZuUWq+5Wa{F?}a+mV4<>Skx<>lp#<@c38SiYisPxUR8%Hb=2kXU z&Z=Bm`DW#w%Fimlul%j@TIC;=e^pUcOqHlgT;*IfrfOW3v}!`tq$-apuPUFa{HkeH z&sXiPI$Ld3Ew2u%POi?V&aTd@R#ul(msXcotE*e9@2`HkdUf@d>Z8>ssz0y(vij@l zZ)@yp#@9@&@u=~t@u>-~Nvg@H$*#$*DX1y0nO-xyW_iuJn)NjsYBtquui0O7pypuB zp_-F57i)e~o2l*8aq47st9qJxhI+Poj{0eJpL)G|qxv=VX7v{JZuMUEKJ|X}N9u#> z6Y6i&7itByHnn4F$Je^mPO6pF2Gj=ChSY}DM$|^tmeqFEF0I{EyR~*(?T*?HYd@|% zRC}cMSnY}0^R?G&Z`S^$fs@WOLXDNiPUEO?(Tvr2X#zAsnh;H>CPovlNz|lh(lq&+ zDveg7(==+DHSHR`rb{zjGedK~=5ftp%@dj@H9eYDnl+krn)R9unzuCDH9IwXG(Zq(6r)^(0`&UItz#??)#lht|E`PRwn;_EW%%IjL| z7S{FEt*Lvl?&Z1-b^GcL)t#vOPAk&dYVEa7+A-Sk+F)&{HbNV%jngJ*GqrizLT#~D zrPXR1v`yN{+UeSv+SyvHU8G&AU8a3ryF$A~yG^@8yGy%Adq8_o`>FPb_KSK^y?K3T leO!HgeRKU|^)J?Mt>0Pyo*|}6(X{bzag*_H)Bo%D{Xfcd2}%F} literal 0 HcmV?d00001 diff --git a/FlatButton.xcodeproj/xcshareddata/xcschemes/FlatButton.xcscheme b/FlatButton.xcodeproj/xcshareddata/xcschemes/FlatButton.xcscheme index 3ad1f4f..bb5edf1 100644 --- a/FlatButton.xcodeproj/xcshareddata/xcschemes/FlatButton.xcscheme +++ b/FlatButton.xcodeproj/xcshareddata/xcschemes/FlatButton.xcscheme @@ -26,6 +26,7 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + language = "" shouldUseLaunchSchemeArgsEnv = "YES"> @@ -45,6 +46,7 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" diff --git a/FlatButton.xcodeproj/xcuserdata/zeo.xcuserdatad/xcschemes/xcschememanagement.plist b/FlatButton.xcodeproj/xcuserdata/zeo.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..eacd4fe --- /dev/null +++ b/FlatButton.xcodeproj/xcuserdata/zeo.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,19 @@ + + + + + SchemeUserState + + FlatButton-Example.xcscheme + + orderHint + 1 + + FlatButton.xcscheme_^#shared#^_ + + orderHint + 0 + + + + diff --git a/FlatButton/FlatButton.swift b/FlatButton/FlatButton.swift index 97f904d..09542f8 100644 --- a/FlatButton/FlatButton.swift +++ b/FlatButton/FlatButton.swift @@ -28,7 +28,7 @@ internal extension CALayer { internal extension NSColor { internal func tintedColor() -> NSColor { var h = CGFloat(), s = CGFloat(), b = CGFloat(), a = CGFloat() - let rgbColor = usingColorSpaceName(NSCalibratedRGBColorSpace) + let rgbColor = usingColorSpaceName(NSColorSpaceName.calibratedRGB) rgbColor?.getHue(&h, saturation: &s, brightness: &b, alpha: &a) return NSColor(hue: h, saturation: s, brightness: b == 0 ? 0.2 : b * 0.8, alpha: a) } @@ -43,7 +43,7 @@ open class FlatButton: NSButton, CALayerDelegate { internal var mouseDown = Bool() @IBInspectable public var momentary: Bool = true { didSet { - animateColor(state == NSOnState) + animateColor(state == .on) } } @IBInspectable public var onAnimationDuration: Double = 0 @@ -51,13 +51,13 @@ open class FlatButton: NSButton, CALayerDelegate { @IBInspectable public var glowRadius: CGFloat = 0 { didSet { containerLayer.shadowRadius = glowRadius - animateColor(state == NSOnState) + animateColor(state == .on) } } @IBInspectable public var glowOpacity: Float = 0 { didSet { containerLayer.shadowOpacity = glowOpacity - animateColor(state == NSOnState) + animateColor(state == .on) } } @IBInspectable public var cornerRadius: CGFloat = 4 { @@ -72,42 +72,42 @@ open class FlatButton: NSButton, CALayerDelegate { } @IBInspectable public var borderColor: NSColor = NSColor.darkGray { didSet { - animateColor(state == NSOnState) + animateColor(state == .on) } } @IBInspectable public var activeBorderColor: NSColor = NSColor.white { didSet { - animateColor(state == NSOnState) + animateColor(state == .on) } } @IBInspectable public var buttonColor: NSColor = NSColor.darkGray { didSet { - animateColor(state == NSOnState) + animateColor(state == .on) } } @IBInspectable public var activeButtonColor: NSColor = NSColor.white { didSet { - animateColor(state == NSOnState) + animateColor(state == .on) } } @IBInspectable public var iconColor: NSColor = NSColor.gray { didSet { - animateColor(state == NSOnState) + animateColor(state == .on) } } @IBInspectable public var activeIconColor: NSColor = NSColor.black { didSet { - animateColor(state == NSOnState) + animateColor(state == .on) } } @IBInspectable public var textColor: NSColor = NSColor.gray { didSet { - animateColor(state == NSOnState) + animateColor(state == .on) } } @IBInspectable public var activeTextColor: NSColor = NSColor.gray { didSet { - animateColor(state == NSOnState) + animateColor(state == .on) } } @@ -194,7 +194,7 @@ open class FlatButton: NSButton, CALayerDelegate { } func positionTitleAndImage() { - let attributes = [NSFontAttributeName: font as Any] + let attributes = [NSAttributedStringKey.font: font as Any] let titleSize = title.size(withAttributes: attributes) var titleRect = NSMakeRect(0, 0, titleSize.width, titleSize.height) var imageRect = iconLayer.frame @@ -315,10 +315,11 @@ open class FlatButton: NSButton, CALayerDelegate { // MARK: Interaction public func setOn(_ isOn: Bool) { - let nextState = isOn ? NSOnState : NSOffState +// let nextState = isOn ? .on : .off + let nextState = isOn ? NSControl.StateValue.on : NSControl.StateValue.off if nextState != state { state = nextState - animateColor(state == NSOnState) + animateColor(state == .on) } } @@ -329,19 +330,19 @@ open class FlatButton: NSButton, CALayerDelegate { override open func mouseDown(with event: NSEvent) { if isEnabled { mouseDown = true - setOn(state == NSOnState ? false : true) + setOn(state == .on ? false : true) } } override open func mouseEntered(with event: NSEvent) { if mouseDown { - setOn(state == NSOnState ? false : true) + setOn(state == .on ? false : true) } } override open func mouseExited(with event: NSEvent) { if mouseDown { - setOn(state == NSOnState ? false : true) + setOn(state == .on ? false : true) mouseDown = false } } @@ -350,7 +351,7 @@ open class FlatButton: NSButton, CALayerDelegate { if mouseDown { mouseDown = false if momentary { - setOn(state == NSOnState ? false : true) + setOn(state == .on ? false : true) } _ = target?.perform(action, with: self) } @@ -386,3 +387,4 @@ open class FlatButton: NSButton, CALayerDelegate { } +