diff --git a/.swift-version b/.swift-version index bf77d54..819e07a 100644 --- a/.swift-version +++ b/.swift-version @@ -1 +1 @@ -4.2 +5.0 diff --git a/Example/Example.xcodeproj/project.pbxproj b/Example/Example.xcodeproj/project.pbxproj index 8da0434..6a4bfe1 100644 --- a/Example/Example.xcodeproj/project.pbxproj +++ b/Example/Example.xcodeproj/project.pbxproj @@ -139,12 +139,12 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0730; - LastUpgradeCheck = 1000; + LastUpgradeCheck = 1020; ORGANIZATIONNAME = "Clipy Project"; TargetAttributes = { 312C0FC01D13AA0300973348 = { CreatedOnToolsVersion = 7.3.1; - LastSwiftMigration = 0900; + LastSwiftMigration = 1020; }; }; }; @@ -153,6 +153,7 @@ developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( + English, en, Base, ); @@ -236,6 +237,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -291,6 +293,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -345,8 +348,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.clipy-app.Example"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_SWIFT3_OBJC_INFERENCE = Off; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -360,8 +362,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.clipy-app.Example"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_SWIFT3_OBJC_INFERENCE = Off; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Release; }; diff --git a/Lib/KeyHolder.xcodeproj/project.pbxproj b/Lib/KeyHolder.xcodeproj/project.pbxproj index 9acf730..c25d4e3 100644 --- a/Lib/KeyHolder.xcodeproj/project.pbxproj +++ b/Lib/KeyHolder.xcodeproj/project.pbxproj @@ -231,12 +231,12 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0730; - LastUpgradeCheck = 1000; + LastUpgradeCheck = 1020; ORGANIZATIONNAME = "Clipy Project"; TargetAttributes = { 312C0FDA1D13AA1F00973348 = { CreatedOnToolsVersion = 7.3.1; - LastSwiftMigration = 1000; + LastSwiftMigration = 1020; }; 312C0FE41D13AA1F00973348 = { CreatedOnToolsVersion = 7.3.1; @@ -249,6 +249,7 @@ developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( + English, en, ); mainGroup = 312C0FD11D13AA1F00973348; @@ -357,6 +358,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -415,6 +417,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -480,8 +483,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -502,8 +504,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "com.clipy-app.KeyHolder"; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; - SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; }; name = Release; }; diff --git a/Lib/KeyHolder.xcodeproj/xcshareddata/xcschemes/KeyHolder.xcscheme b/Lib/KeyHolder.xcodeproj/xcshareddata/xcschemes/KeyHolder.xcscheme index d99e746..029d192 100644 --- a/Lib/KeyHolder.xcodeproj/xcshareddata/xcschemes/KeyHolder.xcscheme +++ b/Lib/KeyHolder.xcodeproj/xcshareddata/xcschemes/KeyHolder.xcscheme @@ -1,6 +1,6 @@ [NSAttributedString.Key: Any] { +extension RecordView { + fileprivate func modifierTextAttributes(_ modifiers: NSEvent.ModifierFlags, checkModifier: NSEvent.ModifierFlags) -> [NSAttributedString.Key: Any] { let paragraphStyle = NSMutableParagraphStyle() paragraphStyle.alignment = .center paragraphStyle.lineBreakMode = .byTruncatingTail @@ -350,7 +350,7 @@ private extension RecordView { } // MARK: - Recording -public extension RecordView { +extension RecordView { public func beginRecording() -> Bool { if !isEnabled { return false } if isRecording { return true } @@ -391,7 +391,7 @@ public extension RecordView { } // MARK: - Clear Keys -public extension RecordView { +extension RecordView { public func clear() { keyCombo = nil inputModifiers = NSEvent.ModifierFlags(rawValue: 0) @@ -407,24 +407,24 @@ public extension RecordView { } // MARK: - Modifiers -private extension RecordView { - func validateModifiers(_ modifiers: NSEvent.ModifierFlags?) -> Bool { +extension RecordView { + fileprivate func validateModifiers(_ modifiers: NSEvent.ModifierFlags?) -> Bool { guard let modifiers = modifiers else { return false } return KeyTransformer.carbonFlags(from: modifiers) != 0 } } // MARK: - Bool Extension -private extension Bool { - var intValue: Int { +extension Bool { + fileprivate var intValue: Int { return NSNumber(value: self).intValue } } // MARK: - NSColor Extensio // nmacOS 10.14 polyfill -private extension NSColor { - static let controlAccentPolyfill: NSColor = { +extension NSColor { + fileprivate static let controlAccentPolyfill: NSColor = { if #available(macOS 10.14, *) { return NSColor.controlAccentColor } else {