diff --git a/Examples/Locksmith iOS Example/Locksmith Extension/InterfaceController.swift b/Examples/Locksmith iOS Example/Locksmith Extension/InterfaceController.swift index 811d1b3..d730b88 100644 --- a/Examples/Locksmith iOS Example/Locksmith Extension/InterfaceController.swift +++ b/Examples/Locksmith iOS Example/Locksmith Extension/InterfaceController.swift @@ -17,7 +17,7 @@ class InterfaceController: WKInterfaceController, WCSessionDelegate { super.willActivate() if (WCSession.isSupported()) { - let session = WCSession.default() + let session = WCSession.default session.delegate = self session.activate() } @@ -43,7 +43,7 @@ class InterfaceController: WKInterfaceController, WCSessionDelegate { // ReadableSecureStorable lets us read the account from the keychain let result = account.readFromSecureStore() - print("Watch app: \(result), \(result?.data)") + print("Watch app: \(String(describing: result)), \(String(describing: result?.data))") // DeleteableSecureStorable lets us delete the account from the keychain try! account.deleteFromSecureStore() diff --git a/Examples/Locksmith iOS Example/Locksmith iOS Example.xcodeproj/project.pbxproj b/Examples/Locksmith iOS Example/Locksmith iOS Example.xcodeproj/project.pbxproj index a6db2d0..d7f20b8 100644 --- a/Examples/Locksmith iOS Example/Locksmith iOS Example.xcodeproj/project.pbxproj +++ b/Examples/Locksmith iOS Example/Locksmith iOS Example.xcodeproj/project.pbxproj @@ -93,18 +93,12 @@ 0E13A9AA1BA3EE8700A06FF9 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 0E13A9AD1BA3EE8700A06FF9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 0E13A9AF1BA3EE8700A06FF9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 15FCF62F6935D11C671F41FF /* Pods_app.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_app.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 1D62CFE6D2814693AE03CF5C /* Pods_watch.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_watch.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 379DD1E5C8CDE5ABD6E50A38 /* Pods-watch.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-watch.release.xcconfig"; path = "Pods/Target Support Files/Pods-watch/Pods-watch.release.xcconfig"; sourceTree = ""; }; - 74E67F961D2CBE4F8D171223 /* Pods-watch.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-watch.debug.xcconfig"; path = "Pods/Target Support Files/Pods-watch/Pods-watch.debug.xcconfig"; sourceTree = ""; }; - 8D5C601685F38F2EA6AA2CA0 /* Pods-app.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-app.release.xcconfig"; path = "Pods/Target Support Files/Pods-app/Pods-app.release.xcconfig"; sourceTree = ""; }; E3DD3B201D84354F00A59312 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; E3DD3B221D84354F00A59312 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; E3DD3B251D84354F00A59312 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; E3DD3B271D84354F00A59312 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; E3DD3B2A1D84354F00A59312 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; E3DD3B2C1D84354F00A59312 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - FFB6EBF2507E751B53E55514 /* Pods-app.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-app.debug.xcconfig"; path = "Pods/Target Support Files/Pods-app/Pods-app.debug.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -156,7 +150,6 @@ 056F2A7F1BA42E3C00B24B65 /* Locksmith Extension */, E3DD3B1F1D84354F00A59312 /* Test Host */, 0E13A9A11BA3EE8700A06FF9 /* Products */, - 74B88A8534E794C2027D6B3D /* Pods */, D1E3110F9ED1A0EE737E7A37 /* Frameworks */, ); sourceTree = ""; @@ -184,24 +177,11 @@ path = "Locksmith iOS Example"; sourceTree = ""; }; - 74B88A8534E794C2027D6B3D /* Pods */ = { - isa = PBXGroup; - children = ( - FFB6EBF2507E751B53E55514 /* Pods-app.debug.xcconfig */, - 8D5C601685F38F2EA6AA2CA0 /* Pods-app.release.xcconfig */, - 74E67F961D2CBE4F8D171223 /* Pods-watch.debug.xcconfig */, - 379DD1E5C8CDE5ABD6E50A38 /* Pods-watch.release.xcconfig */, - ); - name = Pods; - sourceTree = ""; - }; D1E3110F9ED1A0EE737E7A37 /* Frameworks */ = { isa = PBXGroup; children = ( 056F2A951BA4300700B24B65 /* Locksmith.framework */, 056F2A931BA42FFC00B24B65 /* Locksmith.framework */, - 15FCF62F6935D11C671F41FF /* Pods_app.framework */, - 1D62CFE6D2814693AE03CF5C /* Pods_watch.framework */, ); name = Frameworks; sourceTree = ""; @@ -283,7 +263,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0800; - LastUpgradeCheck = 0900; + LastUpgradeCheck = 1020; ORGANIZATIONNAME = "Matthew Palmer"; TargetAttributes = { 056F2A6E1BA42E3C00B24B65 = { @@ -291,15 +271,17 @@ }; 056F2A7A1BA42E3C00B24B65 = { CreatedOnToolsVersion = 7.0; + LastSwiftMigration = 1020; }; 0E13A99F1BA3EE8700A06FF9 = { CreatedOnToolsVersion = 7.0; + LastSwiftMigration = 1020; }; }; }; buildConfigurationList = 0E13A99B1BA3EE8600A06FF9 /* Build configuration list for PBXProject "Locksmith iOS Example" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, @@ -459,7 +441,6 @@ }; 056F2A8C1BA42E3C00B24B65 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 74E67F961D2CBE4F8D171223 /* Pods-watch.debug.xcconfig */; buildSettings = { INFOPLIST_FILE = "Locksmith Extension/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; @@ -467,7 +448,7 @@ PRODUCT_NAME = "${TARGET_NAME}"; SDKROOT = watchos; SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 4; WATCHOS_DEPLOYMENT_TARGET = 2.0; }; @@ -475,7 +456,6 @@ }; 056F2A8D1BA42E3C00B24B65 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 379DD1E5C8CDE5ABD6E50A38 /* Pods-watch.release.xcconfig */; buildSettings = { INFOPLIST_FILE = "Locksmith Extension/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; @@ -484,7 +464,7 @@ SDKROOT = watchos; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 4; WATCHOS_DEPLOYMENT_TARGET = 2.0; }; @@ -494,6 +474,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -502,12 +483,14 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; @@ -547,6 +530,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -555,12 +539,14 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; @@ -592,7 +578,6 @@ }; 0E13A9B31BA3EE8700A06FF9 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = FFB6EBF2507E751B53E55514 /* Pods-app.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; INFOPLIST_FILE = "Locksmith iOS Example/Info.plist"; @@ -600,13 +585,12 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "net.matthewpalmer.Locksmith-iOS-Example"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 5.0; }; name = Debug; }; 0E13A9B41BA3EE8700A06FF9 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 8D5C601685F38F2EA6AA2CA0 /* Pods-app.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; INFOPLIST_FILE = "Locksmith iOS Example/Info.plist"; @@ -615,7 +599,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "net.matthewpalmer.Locksmith-iOS-Example"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 5.0; }; name = Release; }; diff --git a/Examples/Locksmith iOS Example/Locksmith iOS Example.xcodeproj/xcshareddata/xcschemes/Locksmith iOS Example.xcscheme b/Examples/Locksmith iOS Example/Locksmith iOS Example.xcodeproj/xcshareddata/xcschemes/Locksmith iOS Example.xcscheme index 9d10204..e56ad8b 100644 --- a/Examples/Locksmith iOS Example/Locksmith iOS Example.xcodeproj/xcshareddata/xcschemes/Locksmith iOS Example.xcscheme +++ b/Examples/Locksmith iOS Example/Locksmith iOS Example.xcodeproj/xcshareddata/xcschemes/Locksmith iOS Example.xcscheme @@ -1,6 +1,6 @@ @@ -46,7 +45,6 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" diff --git a/Examples/Locksmith iOS Example/Locksmith iOS Example/AppDelegate.swift b/Examples/Locksmith iOS Example/Locksmith iOS Example/AppDelegate.swift index f6747c4..0066737 100644 --- a/Examples/Locksmith iOS Example/Locksmith iOS Example/AppDelegate.swift +++ b/Examples/Locksmith iOS Example/Locksmith iOS Example/AppDelegate.swift @@ -13,7 +13,7 @@ import Locksmith class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool { + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { struct TwitterAccount: ReadableSecureStorable, CreateableSecureStorable, DeleteableSecureStorable, GenericPasswordSecureStorable { let username: String let password: String @@ -35,7 +35,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { // ReadableSecureStorable lets us read the account from the keychain let result = account.readFromSecureStore() - print("iOS app: \(result), \(result?.data)") + print("iOS app: \(String(describing: result)), \(String(describing: result?.data))") // DeleteableSecureStorable lets us delete the account from the keychain try! account.deleteFromSecureStore() diff --git a/Examples/Locksmith iOS Example/Locksmith/Assets.xcassets/AppIcon.appiconset/Contents.json b/Examples/Locksmith iOS Example/Locksmith/Assets.xcassets/AppIcon.appiconset/Contents.json index 2a9dea2..6c0f2b4 100644 --- a/Examples/Locksmith iOS Example/Locksmith/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/Examples/Locksmith iOS Example/Locksmith/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -37,8 +37,15 @@ "size" : "44x44", "idiom" : "watch", "scale" : "2x", - "role" : "longLook", - "subtype" : "42mm" + "role" : "appLauncher", + "subtype" : "40mm" + }, + { + "size" : "50x50", + "idiom" : "watch", + "scale" : "2x", + "role" : "appLauncher", + "subtype" : "44mm" }, { "size" : "86x86", @@ -53,10 +60,22 @@ "scale" : "2x", "role" : "quickLook", "subtype" : "42mm" + }, + { + "size" : "108x108", + "idiom" : "watch", + "scale" : "2x", + "role" : "quickLook", + "subtype" : "44mm" + }, + { + "idiom" : "watch-marketing", + "size" : "1024x1024", + "scale" : "1x" } ], "info" : { "version" : 1, "author" : "xcode" } -} +} \ No newline at end of file diff --git a/Locksmith.xcodeproj/project.pbxproj b/Locksmith.xcodeproj/project.pbxproj index 0567ef8..03c456d 100644 --- a/Locksmith.xcodeproj/project.pbxproj +++ b/Locksmith.xcodeproj/project.pbxproj @@ -407,12 +407,12 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0800; - LastUpgradeCheck = 0900; + LastUpgradeCheck = 1020; ORGANIZATIONNAME = "Mathew Palmer"; TargetAttributes = { 0EC25C581BA385AA004191AF = { CreatedOnToolsVersion = 7.0; - LastSwiftMigration = 0900; + LastSwiftMigration = 1020; }; 0EC25C611BA385AB004191AF = { CreatedOnToolsVersion = 7.0; @@ -427,6 +427,7 @@ }; 0EC25CA61BA39C9F004191AF = { CreatedOnToolsVersion = 7.0; + LastSwiftMigration = 1020; }; E3DD3B331D84356500A59312 = { CreatedOnToolsVersion = 8.0; @@ -445,7 +446,7 @@ }; buildConfigurationList = BFFB19CA1A4870A300CCFFC3 /* Build configuration list for PBXProject "Locksmith" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, @@ -662,7 +663,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "net.matthewpalmer.Locksmith-iOS"; PRODUCT_NAME = Locksmith; SKIP_INSTALL = YES; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -685,7 +686,7 @@ PRODUCT_NAME = Locksmith; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Release; }; @@ -701,7 +702,6 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "net.matthewpalmer.Locksmith-iOSTests"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Test Host.app/Test Host"; }; name = Debug; @@ -719,7 +719,6 @@ PRODUCT_BUNDLE_IDENTIFIER = "net.matthewpalmer.Locksmith-iOSTests"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 4.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Test Host.app/Test Host"; }; name = Release; @@ -744,7 +743,6 @@ PRODUCT_NAME = Locksmith; SDKROOT = macosx; SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; }; name = Debug; }; @@ -769,7 +767,6 @@ SDKROOT = macosx; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 3.0; }; name = Release; }; @@ -787,7 +784,6 @@ PRODUCT_BUNDLE_IDENTIFIER = "net.matthewpalmer.Locksmith-OS-XTests"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; - SWIFT_VERSION = 3.0; }; name = Debug; }; @@ -806,7 +802,6 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 3.0; }; name = Release; }; @@ -827,7 +822,7 @@ PRODUCT_NAME = Locksmith; SDKROOT = watchos; SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 4; WATCHOS_DEPLOYMENT_TARGET = 2.0; }; @@ -852,7 +847,7 @@ SDKROOT = watchos; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 4; WATCHOS_DEPLOYMENT_TARGET = 2.0; }; @@ -863,6 +858,7 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -871,12 +867,14 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; @@ -911,6 +909,7 @@ PRODUCT_NAME = ""; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -922,6 +921,7 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -930,12 +930,14 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; @@ -961,6 +963,7 @@ MTL_ENABLE_DEBUG_INFO = NO; PRODUCT_NAME = ""; SDKROOT = iphoneos; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; @@ -986,7 +989,6 @@ PRODUCT_BUNDLE_IDENTIFIER = "net.matthewpalmer.Test-Host"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -1009,7 +1011,6 @@ PRODUCT_BUNDLE_IDENTIFIER = "net.matthewpalmer.Test-Host"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 4.0; }; name = Release; }; @@ -1032,7 +1033,6 @@ PRODUCT_NAME = Locksmith; SDKROOT = appletvos; SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 9.0; }; @@ -1059,7 +1059,6 @@ SDKROOT = appletvos; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 9.0; }; diff --git a/Locksmith.xcodeproj/xcshareddata/xcschemes/Locksmith OS X.xcscheme b/Locksmith.xcodeproj/xcshareddata/xcschemes/Locksmith OS X.xcscheme index 887e061..fcab576 100644 --- a/Locksmith.xcodeproj/xcshareddata/xcschemes/Locksmith OS X.xcscheme +++ b/Locksmith.xcodeproj/xcshareddata/xcschemes/Locksmith OS X.xcscheme @@ -1,6 +1,6 @@ @@ -37,7 +36,6 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" diff --git a/Locksmith.xcodeproj/xcshareddata/xcschemes/Locksmith watchOS.xcscheme b/Locksmith.xcodeproj/xcshareddata/xcschemes/Locksmith watchOS.xcscheme index 6651352..0a243b0 100644 --- a/Locksmith.xcodeproj/xcshareddata/xcschemes/Locksmith watchOS.xcscheme +++ b/Locksmith.xcodeproj/xcshareddata/xcschemes/Locksmith watchOS.xcscheme @@ -1,6 +1,6 @@ @@ -37,7 +36,6 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" diff --git a/Locksmith.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Locksmith.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Locksmith.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Package.swift b/Package.swift index e80a95f..9d0178c 100644 --- a/Package.swift +++ b/Package.swift @@ -1,5 +1,19 @@ +// swift-tools-version:4.0 + import PackageDescription let package = Package( - name: "Locksmith" + name: "Locksmith", + products: [ + // Products define the executables and libraries produced by a package, and make them visible to other packages. + .library( + name: "Locksmith", + targets: ["Locksmith"]), + ], + targets: [ + // Targets are the basic building blocks of a package. A target can define a module or a test suite. + .target( + name: "Locksmith", + path: "Source") + ] ) diff --git a/Source/Locksmith.swift b/Source/Locksmith.swift index 81c7aee..5e03003 100644 --- a/Source/Locksmith.swift +++ b/Source/Locksmith.swift @@ -17,6 +17,7 @@ public struct Locksmith { return request.readFromSecureStore()?.data } + @available(OSX 10.11, *) public static func saveData(data: [String: Any], forUserAccount userAccount: String, inService service: String = LocksmithDefaultService) throws { struct CreateRequest: GenericPasswordSecureStorable, CreateableSecureStorable { let service: String @@ -38,6 +39,7 @@ public struct Locksmith { return try request.deleteFromSecureStore() } + @available(OSX 10.11, *) public static func updateData(data: [String: Any], forUserAccount userAccount: String, inService service: String = LocksmithDefaultService) throws { struct UpdateRequest: GenericPasswordSecureStorable, CreateableSecureStorable { let service: String @@ -532,6 +534,7 @@ extension CreateableSecureStorable { } public extension CreateableSecureStorable where Self : GenericPasswordSecureStorable { + @available(OSX 10.11, *) var asCreateableSecureStoragePropertyDictionary: [String: Any] { var old = genericPasswordBaseStoragePropertyDictionary old[String(kSecValueData)] = NSKeyedArchiver.archivedData(withRootObject: data) @@ -540,15 +543,18 @@ public extension CreateableSecureStorable where Self : GenericPasswordSecureStor } public extension CreateableSecureStorable where Self : GenericPasswordSecureStorable { + @available(OSX 10.11, *) func createInSecureStore() throws { try performSecureStorageAction(closure: performCreateRequestClosure, secureStoragePropertyDictionary: asCreateableSecureStoragePropertyDictionary) } + @available(OSX 10.11, *) func updateInSecureStore() throws { try self.updateInSecureStore(query: self.asCreateableSecureStoragePropertyDictionary) } } public extension CreateableSecureStorable where Self : InternetPasswordSecureStorable { + @available(OSX 10.11, *) var asCreateableSecureStoragePropertyDictionary: [String: Any] { var old = internetPasswordBaseStoragePropertyDictionary old[String(kSecValueData)] = NSKeyedArchiver.archivedData(withRootObject: data) @@ -567,9 +573,11 @@ public extension CreateableSecureStorable { } public extension CreateableSecureStorable where Self : InternetPasswordSecureStorable { + @available(OSX 10.11, *) func createInSecureStore() throws { try performSecureStorageAction(closure: performCreateRequestClosure, secureStoragePropertyDictionary: asCreateableSecureStoragePropertyDictionary) } + @available(OSX 10.11, *) func updateInSecureStore() throws { try self.updateInSecureStore(query: self.asCreateableSecureStoragePropertyDictionary) } diff --git a/Test Host/AppDelegate.swift b/Test Host/AppDelegate.swift index 68d25f0..f014e95 100644 --- a/Test Host/AppDelegate.swift +++ b/Test Host/AppDelegate.swift @@ -14,7 +14,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true }