diff --git a/Sources/UXKit/AppKit/NSTableViewCell.swift b/Sources/UXKit/AppKit/NSTableViewCell.swift index 56c4642..bf29fef 100644 --- a/Sources/UXKit/AppKit/NSTableViewCell.swift +++ b/Sources/UXKit/AppKit/NSTableViewCell.swift @@ -1,7 +1,7 @@ // // UXKit // -// Copyright © 2016-2019 ZeeZide GmbH. All rights reserved. +// Copyright © 2016-2023 ZeeZide GmbH. All rights reserved. // #if os(macOS) import Cocoa @@ -43,13 +43,8 @@ let padding : CGFloat = 8.0 let labelPadding : CGFloat = 4.0 - #if swift(>=4.0) - let labelSize = UXFont.systemFontSize + 4.0 - let detailLabelSize = UXFont.smallSystemFontSize - #else - let labelSize = UXFont.systemFontSize() + 4.0 - let detailLabelSize = UXFont.smallSystemFontSize() - #endif + let labelSize = UXFont.systemFontSize + 4.0 + let detailLabelSize = UXFont.smallSystemFontSize //let detailColor = UXColor.secondaryLabelColor // 10.10 let detailColor = UXColor.darkGray diff --git a/Sources/UXKit/AppKit/UXGraphics-AppKit.swift b/Sources/UXKit/AppKit/UXGraphics-AppKit.swift index da49f22..ef77aef 100644 --- a/Sources/UXKit/AppKit/UXGraphics-AppKit.swift +++ b/Sources/UXKit/AppKit/UXGraphics-AppKit.swift @@ -1,7 +1,7 @@ // // UXKit // -// Copyright © 2016-2022 ZeeZide GmbH. All rights reserved. +// Copyright © 2016-2023 ZeeZide GmbH. All rights reserved. // #if os(macOS) import Cocoa @@ -18,11 +18,7 @@ public typealias UXImage = NSImage - #if swift(>=4.0) - public typealias UXEdgeInsets = NSEdgeInsets - #else - public typealias UXEdgeInsets = EdgeInsets - #endif + public typealias UXEdgeInsets = NSEdgeInsets public extension UXColor { diff --git a/Sources/UXKit/AppKit/UXLayout-AppKit.swift b/Sources/UXKit/AppKit/UXLayout-AppKit.swift index 38d777c..f5ae750 100644 --- a/Sources/UXKit/AppKit/UXLayout-AppKit.swift +++ b/Sources/UXKit/AppKit/UXLayout-AppKit.swift @@ -1,7 +1,7 @@ // // UXKit // -// Copyright © 2016-2021 ZeeZide GmbH. All rights reserved. +// Copyright © 2016-2023 ZeeZide GmbH. All rights reserved. // #if os(macOS) import Cocoa @@ -11,25 +11,10 @@ @available(OSX 10.11, *) public typealias UXLayoutGuide = NSLayoutGuide -#if swift(>=4.0) public extension NSStackView { - typealias Alignment = NSLayoutConstraint.Attribute - typealias UXAlignment = NSLayoutConstraint.Attribute - typealias Axis = NSUserInterfaceLayoutOrientation + typealias Alignment = NSLayoutConstraint.Attribute + typealias UXAlignment = NSLayoutConstraint.Attribute + typealias Axis = NSUserInterfaceLayoutOrientation } -#else // Swift 3.2 - public extension NSLayoutConstraint { - public typealias Attribute = NSLayoutAttribute - public typealias Relation = NSLayoutRelation - #if false // crashes 3.2 in Xcode 9 9A235 - Because it exists? in 3.2? But not in 3.1? - public typealias Priority = NSLayoutPriority - #endif - } - public extension NSStackView { - public typealias Distribution = NSStackViewDistribution - public typealias Alignment = NSLayoutAttribute - public typealias UXAlignment = NSLayoutAttribute - } -#endif public typealias UXStackViewAxis = NSUserInterfaceLayoutOrientation #endif diff --git a/Sources/UXKit/AppKit/UXView-AppKit.swift b/Sources/UXKit/AppKit/UXView-AppKit.swift index 4d55200..b19286c 100644 --- a/Sources/UXKit/AppKit/UXView-AppKit.swift +++ b/Sources/UXKit/AppKit/UXView-AppKit.swift @@ -30,12 +30,8 @@ // MARK: - UXUserInterfaceItemIdentification - #if os(macOS) && swift(>=4.0) - public typealias UXUserInterfaceItemIdentifier = - NSUserInterfaceItemIdentifier - #else - public typealias UXUserInterfaceItemIdentifier = String - #endif + public typealias UXUserInterfaceItemIdentifier = + NSUserInterfaceItemIdentifier public typealias UXUserInterfaceItemIdentification = NSUserInterfaceItemIdentification @@ -90,19 +86,11 @@ /// Add UISwitch `isOn` property. The AppKit variant has 3 states. public extension NSButton { - #if swift(>=4.0) - /// Use this instead of `state` for UIKit compatibility. - var isOn: Bool { - set { state = newValue ? .on : .off } - get { return state == .on } - } - #else // Swift 3 - /// Use this instead of `state` for UIKit compatibility. - public var isOn: Bool { - set { state = newValue ? NSOnState : NSOffState } - get { return state == NSOnState } - } - #endif + /// Use this instead of `state` for UIKit compatibility. + var isOn: Bool { + set { state = newValue ? .on : .off } + get { return state == .on } + } } public extension NSTextField { diff --git a/Sources/UXKit/Common/UXIndexPath.swift b/Sources/UXKit/Common/UXIndexPath.swift index f6bc0fb..4800ab9 100644 --- a/Sources/UXKit/Common/UXIndexPath.swift +++ b/Sources/UXKit/Common/UXIndexPath.swift @@ -1,23 +1,23 @@ // // UXKit // -// Copyright © 2016-2017 ZeeZide GmbH. All rights reserved. +// Copyright © 2016-2023 ZeeZide GmbH. All rights reserved. // import Foundation #if os(macOS) - #if swift(>=4.0) - // Hm. It does seem to have it (produces ambiguities). But maybe not. - import AppKit - #else - public extension IndexPath { - - public init(row: Int, section: Int) { - self.init(indexes: [ section, row ]) - } - public var section : Int { return self[0] } - public var row : Int { return self[1] } + import AppKit + + // Hm. It does seem to have it (produces ambiguities). But maybe not. + #if false + public extension IndexPath { + + public init(row: Int, section: Int) { + self.init(indexes: [ section, row ]) } + public var section : Int { return self[0] } + public var row : Int { return self[1] } + } #endif #endif