From c63a915650a5e2bd2ad8825988b2de341848cd4a Mon Sep 17 00:00:00 2001 From: Khoa Pham Date: Fri, 20 Oct 2017 11:12:51 +0200 Subject: [PATCH 1/8] Update to swift 4 --- .slather.yml | 4 ---- .swift-version | 2 +- .travis.yml | 11 ----------- Keychains.podspec | 2 +- 4 files changed, 2 insertions(+), 17 deletions(-) delete mode 100644 .slather.yml delete mode 100644 .travis.yml diff --git a/.slather.yml b/.slather.yml deleted file mode 100644 index 5819120..0000000 --- a/.slather.yml +++ /dev/null @@ -1,4 +0,0 @@ -ci_service: travis_ci -coverage_service: coveralls -xcodeproj: Tests/Tests.xcodeproj -source_directory: Source diff --git a/.swift-version b/.swift-version index 9f55b2c..5186d07 100644 --- a/.swift-version +++ b/.swift-version @@ -1 +1 @@ -3.0 +4.0 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 683aa89..0000000 --- a/.travis.yml +++ /dev/null @@ -1,11 +0,0 @@ -osx_image: xcode8 -language: objective-c - -script: -- xcodebuild clean build -project Keychains.xcodeproj -scheme "Keychains-Mac" -sdk macosx -- xcodebuild test -project Keychains.xcodeproj -scheme "Keychains-Mac" -sdk macosx -- xcodebuild clean build -project Keychains.xcodeproj -scheme "Keychains-iOS" -sdk iphonesimulator -- xcodebuild test -project Keychains.xcodeproj -scheme "Keychains-iOS" -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 6,OS=10.0' | xcpretty - -notifications: - email: false \ No newline at end of file diff --git a/Keychains.podspec b/Keychains.podspec index 2e0b2fb..42b3d9b 100644 --- a/Keychains.podspec +++ b/Keychains.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "Keychains" s.summary = "A keychain wrapper that is so easy to use that your cat could use it." - s.version = "1.0.0" + s.version = "2.0.0" s.homepage = "https://github.com/hyperoslo/Keychains" s.license = 'MIT' s.author = { "Hyper Interaktiv AS" => "ios@hyper.no" } From d682de39a4e8eec4ba67e23a9da4e60c47be316f Mon Sep 17 00:00:00 2001 From: Khoa Pham Date: Fri, 20 Oct 2017 11:15:28 +0200 Subject: [PATCH 2/8] Rename to macOS --- Keychains.xcodeproj/project.pbxproj | 28 +++++++++---------- ...-Mac.xcscheme => Keychains-macOS.xcscheme} | 25 ++--------------- circle.yml | 10 +++++++ 3 files changed, 27 insertions(+), 36 deletions(-) rename Keychains.xcodeproj/xcshareddata/xcschemes/{Keychain-Mac.xcscheme => Keychains-macOS.xcscheme} (74%) create mode 100644 circle.yml diff --git a/Keychains.xcodeproj/project.pbxproj b/Keychains.xcodeproj/project.pbxproj index 2ef09a5..5b0cd34 100644 --- a/Keychains.xcodeproj/project.pbxproj +++ b/Keychains.xcodeproj/project.pbxproj @@ -36,7 +36,7 @@ /* Begin PBXFileReference section */ BDA447E21C294B45003FDEAD /* Keychains.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Keychains.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - BDA447EB1C294B45003FDEAD /* Tests-Mac.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Tests-Mac.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + BDA447EB1C294B45003FDEAD /* Tests-macOS.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Tests-macOS.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; BDA447FB1C294B68003FDEAD /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; BDA447FD1C294B68003FDEAD /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; BDA448011C294B9F003FDEAD /* Keychain.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Keychain.swift; sourceTree = ""; }; @@ -172,7 +172,7 @@ D56DA9DC1C20608E003E7253 /* Keychains.framework */, D56DA9E61C20608E003E7253 /* Tests-iOS.xctest */, BDA447E21C294B45003FDEAD /* Keychains.framework */, - BDA447EB1C294B45003FDEAD /* Tests-Mac.xctest */, + BDA447EB1C294B45003FDEAD /* Tests-macOS.xctest */, ); name = Products; sourceTree = ""; @@ -197,9 +197,9 @@ /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ - BDA447E11C294B45003FDEAD /* Keychains-Mac */ = { + BDA447E11C294B45003FDEAD /* Keychains-macOS */ = { isa = PBXNativeTarget; - buildConfigurationList = BDA447F31C294B45003FDEAD /* Build configuration list for PBXNativeTarget "Keychains-Mac" */; + buildConfigurationList = BDA447F31C294B45003FDEAD /* Build configuration list for PBXNativeTarget "Keychains-macOS" */; buildPhases = ( BDA447DD1C294B45003FDEAD /* Sources */, BDA447DE1C294B45003FDEAD /* Frameworks */, @@ -210,14 +210,14 @@ ); dependencies = ( ); - name = "Keychains-Mac"; + name = "Keychains-macOS"; productName = "Keychain-Mac"; productReference = BDA447E21C294B45003FDEAD /* Keychains.framework */; productType = "com.apple.product-type.framework"; }; - BDA447EA1C294B45003FDEAD /* Tests-Mac */ = { + BDA447EA1C294B45003FDEAD /* Tests-macOS */ = { isa = PBXNativeTarget; - buildConfigurationList = BDA447F61C294B45003FDEAD /* Build configuration list for PBXNativeTarget "Tests-Mac" */; + buildConfigurationList = BDA447F61C294B45003FDEAD /* Build configuration list for PBXNativeTarget "Tests-macOS" */; buildPhases = ( BDA447E71C294B45003FDEAD /* Sources */, BDA447E81C294B45003FDEAD /* Frameworks */, @@ -228,9 +228,9 @@ dependencies = ( BDA447EE1C294B45003FDEAD /* PBXTargetDependency */, ); - name = "Tests-Mac"; + name = "Tests-macOS"; productName = "Keychain-MacTests"; - productReference = BDA447EB1C294B45003FDEAD /* Tests-Mac.xctest */; + productReference = BDA447EB1C294B45003FDEAD /* Tests-macOS.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; D56DA9DB1C20608E003E7253 /* Keychains-iOS */ = { @@ -309,8 +309,8 @@ targets = ( D56DA9DB1C20608E003E7253 /* Keychains-iOS */, D56DA9E51C20608E003E7253 /* Tests-iOS */, - BDA447E11C294B45003FDEAD /* Keychains-Mac */, - BDA447EA1C294B45003FDEAD /* Tests-Mac */, + BDA447E11C294B45003FDEAD /* Keychains-macOS */, + BDA447EA1C294B45003FDEAD /* Tests-macOS */, ); }; /* End PBXProject section */ @@ -386,7 +386,7 @@ /* Begin PBXTargetDependency section */ BDA447EE1C294B45003FDEAD /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = BDA447E11C294B45003FDEAD /* Keychains-Mac */; + target = BDA447E11C294B45003FDEAD /* Keychains-macOS */; targetProxy = BDA447ED1C294B45003FDEAD /* PBXContainerItemProxy */; }; D56DA9E91C20608E003E7253 /* PBXTargetDependency */ = { @@ -622,7 +622,7 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - BDA447F31C294B45003FDEAD /* Build configuration list for PBXNativeTarget "Keychains-Mac" */ = { + BDA447F31C294B45003FDEAD /* Build configuration list for PBXNativeTarget "Keychains-macOS" */ = { isa = XCConfigurationList; buildConfigurations = ( BDA447F41C294B45003FDEAD /* Debug */, @@ -631,7 +631,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - BDA447F61C294B45003FDEAD /* Build configuration list for PBXNativeTarget "Tests-Mac" */ = { + BDA447F61C294B45003FDEAD /* Build configuration list for PBXNativeTarget "Tests-macOS" */ = { isa = XCConfigurationList; buildConfigurations = ( BDA447F71C294B45003FDEAD /* Debug */, diff --git a/Keychains.xcodeproj/xcshareddata/xcschemes/Keychain-Mac.xcscheme b/Keychains.xcodeproj/xcshareddata/xcschemes/Keychains-macOS.xcscheme similarity index 74% rename from Keychains.xcodeproj/xcshareddata/xcschemes/Keychain-Mac.xcscheme rename to Keychains.xcodeproj/xcshareddata/xcschemes/Keychains-macOS.xcscheme index 79b1119..6401b55 100644 --- a/Keychains.xcodeproj/xcshareddata/xcschemes/Keychain-Mac.xcscheme +++ b/Keychains.xcodeproj/xcshareddata/xcschemes/Keychains-macOS.xcscheme @@ -16,7 +16,7 @@ BuildableIdentifier = "primary" BlueprintIdentifier = "BDA447E11C294B45003FDEAD" BuildableName = "Keychains.framework" - BlueprintName = "Keychains-Mac" + BlueprintName = "Keychains-macOS" ReferencedContainer = "container:Keychains.xcodeproj"> @@ -29,26 +29,7 @@ language = "" shouldUseLaunchSchemeArgsEnv = "YES"> - - - - - - - - @@ -68,7 +49,7 @@ BuildableIdentifier = "primary" BlueprintIdentifier = "BDA447E11C294B45003FDEAD" BuildableName = "Keychains.framework" - BlueprintName = "Keychains-Mac" + BlueprintName = "Keychains-macOS" ReferencedContainer = "container:Keychains.xcodeproj"> @@ -86,7 +67,7 @@ BuildableIdentifier = "primary" BlueprintIdentifier = "BDA447E11C294B45003FDEAD" BuildableName = "Keychains.framework" - BlueprintName = "Keychains-Mac" + BlueprintName = "Keychains-macOS" ReferencedContainer = "container:Keychains.xcodeproj"> diff --git a/circle.yml b/circle.yml new file mode 100644 index 0000000..f4ec84e --- /dev/null +++ b/circle.yml @@ -0,0 +1,10 @@ +machine: + xcode: + version: "9.0" + +test: + override: + - set -o pipefail && xcodebuild -project Keychains.xcodeproj -scheme "Keychains-macOS" -sdk macosx clean build + - set -o pipefail && xcodebuild -project Keychains.xcodeproj -scheme "Keychains-macOS" -sdk macosx -enableCodeCoverage YES test + - set -o pipefail && xcodebuild -project Keychains.xcodeproj -scheme "Keychains-iOS" -sdk iphonesimulator clean build + - set -o pipefail && xcodebuild -project Keychains.xcodeproj -scheme "Keychains-iOS" -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 8,OS=11.0' -enableCodeCoverage YES test \ No newline at end of file From b424bd57f093eac9ddbc212ea47a4e3d17fc2162 Mon Sep 17 00:00:00 2001 From: Khoa Pham Date: Fri, 20 Oct 2017 11:15:56 +0200 Subject: [PATCH 3/8] Bump deployment target --- Keychains.podspec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Keychains.podspec b/Keychains.podspec index 42b3d9b..faca489 100644 --- a/Keychains.podspec +++ b/Keychains.podspec @@ -8,8 +8,8 @@ Pod::Spec.new do |s| s.source = { :git => "https://github.com/hyperoslo/Keychains.git", :tag => s.version.to_s } s.social_media_url = 'https://twitter.com/hyperoslo' - s.ios.deployment_target = '8.0' - s.osx.deployment_target = '10.9' + s.ios.deployment_target = '9.0' + s.osx.deployment_target = '10.10' s.requires_arc = true s.ios.source_files = 'Source/{iOS,Shared}/**/*' From 61038233a27195ee609190615d197229fbffd726 Mon Sep 17 00:00:00 2001 From: Khoa Pham Date: Fri, 20 Oct 2017 11:17:48 +0200 Subject: [PATCH 4/8] Rename to Keychains --- ...in-iOS.xcscheme => Keychains-iOS.xcscheme} | 19 ------------------- README.md | 18 +++++++++--------- 2 files changed, 9 insertions(+), 28 deletions(-) rename Keychains.xcodeproj/xcshareddata/xcschemes/{Keychain-iOS.xcscheme => Keychains-iOS.xcscheme} (78%) diff --git a/Keychains.xcodeproj/xcshareddata/xcschemes/Keychain-iOS.xcscheme b/Keychains.xcodeproj/xcshareddata/xcschemes/Keychains-iOS.xcscheme similarity index 78% rename from Keychains.xcodeproj/xcshareddata/xcschemes/Keychain-iOS.xcscheme rename to Keychains.xcodeproj/xcshareddata/xcschemes/Keychains-iOS.xcscheme index 6e82c27..1f40f92 100644 --- a/Keychains.xcodeproj/xcshareddata/xcschemes/Keychain-iOS.xcscheme +++ b/Keychains.xcodeproj/xcshareddata/xcschemes/Keychains-iOS.xcscheme @@ -29,26 +29,7 @@ language = "" shouldUseLaunchSchemeArgsEnv = "YES"> - - - - - - - - diff --git a/README.md b/README.md index 2063ca3..0efa34f 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ -# Keychain +# Keychains -[![CI Status](http://img.shields.io/travis/hyperoslo/Keychain.svg?style=flat)](https://travis-ci.org/hyperoslo/Keychain) -[![Version](https://img.shields.io/cocoapods/v/Keychain.svg?style=flat)](http://cocoadocs.org/docsets/Keychain) +[![Version](https://img.shields.io/cocoapods/v/Keychains.svg?style=flat)](http://cocoadocs.org/docsets/Keychains) [![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) -[![License](https://img.shields.io/cocoapods/l/Keychain.svg?style=flat)](http://cocoadocs.org/docsets/Keychain) -[![Platform](https://img.shields.io/cocoapods/p/Keychain.svg?style=flat)](http://cocoadocs.org/docsets/Keychain) +[![License](https://img.shields.io/cocoapods/l/Keychains.svg?style=flat)](http://cocoadocs.org/docsets/Keychains) +[![Platform](https://img.shields.io/cocoapods/p/Keychains.svg?style=flat)](http://cocoadocs.org/docsets/Keychains) +![Swift](https://img.shields.io/badge/%20in-swift%204.0-orange.svg) A keychain wrapper that is so easy to use that your cat could use it. @@ -23,18 +23,18 @@ Keychain.deletePassword(forAccount: account) ## Installation -**Keychain** is available through [CocoaPods](http://cocoapods.org). To install +**Keychains** is available through [CocoaPods](http://cocoapods.org). To install it, simply add the following line to your Podfile: ```ruby -pod 'Keychain' +pod 'Keychains' ``` **Keychain** is also available through [Carthage](https://github.com/Carthage/Carthage). To install just write into your Cartfile: ```ruby -github "hyperoslo/Keychain" +github "hyperoslo/Keychains" ``` ## Author @@ -43,4 +43,4 @@ Hyper Interaktiv AS, ios@hyper.no ## License -**Keychain** is available under the MIT license. See the LICENSE file for more info. +**Keychains** is available under the MIT license. See the LICENSE file for more info. From 536bd604e7089c3f81fd42641739679528d47d8e Mon Sep 17 00:00:00 2001 From: Khoa Pham Date: Fri, 20 Oct 2017 11:24:55 +0200 Subject: [PATCH 5/8] Configure test actions --- .../xcschemes/Keychains-iOS.xcscheme | 19 +++++++++++++++++++ .../xcschemes/Keychains-macOS.xcscheme | 19 +++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/Keychains.xcodeproj/xcshareddata/xcschemes/Keychains-iOS.xcscheme b/Keychains.xcodeproj/xcshareddata/xcschemes/Keychains-iOS.xcscheme index 1f40f92..6e82c27 100644 --- a/Keychains.xcodeproj/xcshareddata/xcschemes/Keychains-iOS.xcscheme +++ b/Keychains.xcodeproj/xcshareddata/xcschemes/Keychains-iOS.xcscheme @@ -29,7 +29,26 @@ language = "" shouldUseLaunchSchemeArgsEnv = "YES"> + + + + + + + + diff --git a/Keychains.xcodeproj/xcshareddata/xcschemes/Keychains-macOS.xcscheme b/Keychains.xcodeproj/xcshareddata/xcschemes/Keychains-macOS.xcscheme index 6401b55..26660ec 100644 --- a/Keychains.xcodeproj/xcshareddata/xcschemes/Keychains-macOS.xcscheme +++ b/Keychains.xcodeproj/xcshareddata/xcschemes/Keychains-macOS.xcscheme @@ -29,7 +29,26 @@ language = "" shouldUseLaunchSchemeArgsEnv = "YES"> + + + + + + + + From 5b33de66206f230969731d161b1be6c690b17e84 Mon Sep 17 00:00:00 2001 From: Khoa Pham Date: Fri, 20 Oct 2017 11:28:49 +0200 Subject: [PATCH 6/8] Reformat --- Source/Shared/Keychain.swift | 16 ++++++++++++---- Tests/Shared/TestKeychain.swift | 2 ++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Source/Shared/Keychain.swift b/Source/Shared/Keychain.swift index 6e2c1fe..38760f3 100644 --- a/Source/Shared/Keychain.swift +++ b/Source/Shared/Keychain.swift @@ -30,8 +30,12 @@ public struct Keychain { /// - service: The service, this is for kSecAttrService /// - accessGroup: The access group, this is for kSecAttrAccessGroup /// - Returns: The password - public static func password(forAccount account: String, service: String = bundleIdentifier, accessGroup: String = "") -> String { - guard !service.isEmpty && !account.isEmpty else { return "" } + public static func password(forAccount account: String, + service: String = bundleIdentifier, + accessGroup: String = "") -> String? { + guard !service.isEmpty && !account.isEmpty else { + return nil + } var query = [ kSecAttrAccount as String : account, @@ -55,7 +59,9 @@ public struct Keychain { /// - accessGroup: The access group, this is for kSecAttrAccessGroup /// - Returns: True if the password can be set successfully @discardableResult public static func setPassword(_ password: String, forAccount account: String, service: String = bundleIdentifier, accessGroup: String = "") -> Bool { - guard !service.isEmpty && !account.isEmpty else { return false } + guard !service.isEmpty && !account.isEmpty else { + return false + } var query = [ kSecAttrAccount as String : account, @@ -78,7 +84,9 @@ public struct Keychain { /// - service: The service, this is for kSecAttrService /// - Returns: True if the password can be safely deleted @discardableResult public static func deletePassword(forAccount account: String, service: String = bundleIdentifier, accessGroup: String = "") -> Bool { - guard !service.isEmpty && !account.isEmpty else { return false } + guard !service.isEmpty && !account.isEmpty else { + return false + } var query = [ kSecAttrAccount as String: account, diff --git a/Tests/Shared/TestKeychain.swift b/Tests/Shared/TestKeychain.swift index e1b1602..44a6497 100644 --- a/Tests/Shared/TestKeychain.swift +++ b/Tests/Shared/TestKeychain.swift @@ -8,6 +8,8 @@ class TestKeychain: XCTestCase { let account = "John Hyperseed" override func tearDown() { + super.tearDown() + Keychain.deletePassword(forAccount: account, service: service) } From d5a4aadafa7861bc55f9bbc3c1a360f5ddc13db9 Mon Sep 17 00:00:00 2001 From: Khoa Pham Date: Fri, 20 Oct 2017 11:33:29 +0200 Subject: [PATCH 7/8] Update ios version in circle --- circle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/circle.yml b/circle.yml index f4ec84e..a0a7bb9 100644 --- a/circle.yml +++ b/circle.yml @@ -7,4 +7,4 @@ test: - set -o pipefail && xcodebuild -project Keychains.xcodeproj -scheme "Keychains-macOS" -sdk macosx clean build - set -o pipefail && xcodebuild -project Keychains.xcodeproj -scheme "Keychains-macOS" -sdk macosx -enableCodeCoverage YES test - set -o pipefail && xcodebuild -project Keychains.xcodeproj -scheme "Keychains-iOS" -sdk iphonesimulator clean build - - set -o pipefail && xcodebuild -project Keychains.xcodeproj -scheme "Keychains-iOS" -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 8,OS=11.0' -enableCodeCoverage YES test \ No newline at end of file + - set -o pipefail && xcodebuild -project Keychains.xcodeproj -scheme "Keychains-iOS" -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 8,OS=11.0.1' -enableCodeCoverage YES test \ No newline at end of file From 8e9f19a19718f26ca14b934200bb1e3d54160967 Mon Sep 17 00:00:00 2001 From: Khoa Pham Date: Fri, 20 Oct 2017 12:15:25 +0200 Subject: [PATCH 8/8] Add a test host --- Keychains.xcodeproj/project.pbxproj | 168 +++++++++++++++++- TestHost_iOS/AppDelegate.swift | 46 +++++ .../AppIcon.appiconset/Contents.json | 93 ++++++++++ .../Base.lproj/LaunchScreen.storyboard | 25 +++ TestHost_iOS/Base.lproj/Main.storyboard | 24 +++ TestHost_iOS/Info.plist | 45 +++++ TestHost_iOS/TestHost_iOS.entitlements | 10 ++ TestHost_iOS/ViewController.swift | 25 +++ 8 files changed, 435 insertions(+), 1 deletion(-) create mode 100644 TestHost_iOS/AppDelegate.swift create mode 100644 TestHost_iOS/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 TestHost_iOS/Base.lproj/LaunchScreen.storyboard create mode 100644 TestHost_iOS/Base.lproj/Main.storyboard create mode 100644 TestHost_iOS/Info.plist create mode 100644 TestHost_iOS/TestHost_iOS.entitlements create mode 100644 TestHost_iOS/ViewController.swift diff --git a/Keychains.xcodeproj/project.pbxproj b/Keychains.xcodeproj/project.pbxproj index 5b0cd34..f095ca5 100644 --- a/Keychains.xcodeproj/project.pbxproj +++ b/Keychains.xcodeproj/project.pbxproj @@ -14,6 +14,11 @@ BDA448151C294C29003FDEAD /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = BDA448101C294C29003FDEAD /* Info.plist */; }; BDA448171C294C29003FDEAD /* TestKeychain.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDA448121C294C29003FDEAD /* TestKeychain.swift */; }; BDA448181C294C29003FDEAD /* TestKeychain.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDA448121C294C29003FDEAD /* TestKeychain.swift */; }; + D23151A21F9A035F0089CED9 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D23151A11F9A035F0089CED9 /* AppDelegate.swift */; }; + D23151A41F9A035F0089CED9 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D23151A31F9A035F0089CED9 /* ViewController.swift */; }; + D23151A71F9A035F0089CED9 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D23151A51F9A035F0089CED9 /* Main.storyboard */; }; + D23151A91F9A035F0089CED9 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D23151A81F9A035F0089CED9 /* Assets.xcassets */; }; + D23151AC1F9A035F0089CED9 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D23151AA1F9A035F0089CED9 /* LaunchScreen.storyboard */; }; D56DA9E71C20608E003E7253 /* Keychains.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D56DA9DC1C20608E003E7253 /* Keychains.framework */; }; /* End PBXBuildFile section */ @@ -43,6 +48,14 @@ BDA4480E1C294C29003FDEAD /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; BDA448101C294C29003FDEAD /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; BDA448121C294C29003FDEAD /* TestKeychain.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestKeychain.swift; sourceTree = ""; }; + D231519F1F9A035F0089CED9 /* TestHost_iOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TestHost_iOS.app; sourceTree = BUILT_PRODUCTS_DIR; }; + D23151A11F9A035F0089CED9 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + D23151A31F9A035F0089CED9 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + D23151A61F9A035F0089CED9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + D23151A81F9A035F0089CED9 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + D23151AB1F9A035F0089CED9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + D23151AD1F9A035F0089CED9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + D23151B11F9A03700089CED9 /* TestHost_iOS.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = TestHost_iOS.entitlements; sourceTree = ""; }; D56DA9DC1C20608E003E7253 /* Keychains.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Keychains.framework; sourceTree = BUILT_PRODUCTS_DIR; }; D56DA9E61C20608E003E7253 /* Tests-iOS.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Tests-iOS.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ @@ -63,6 +76,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + D231519C1F9A035F0089CED9 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; D56DA9D81C20608E003E7253 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -156,9 +176,24 @@ path = Shared; sourceTree = ""; }; + D23151A01F9A035F0089CED9 /* TestHost_iOS */ = { + isa = PBXGroup; + children = ( + D23151B11F9A03700089CED9 /* TestHost_iOS.entitlements */, + D23151A11F9A035F0089CED9 /* AppDelegate.swift */, + D23151A31F9A035F0089CED9 /* ViewController.swift */, + D23151A51F9A035F0089CED9 /* Main.storyboard */, + D23151A81F9A035F0089CED9 /* Assets.xcassets */, + D23151AA1F9A035F0089CED9 /* LaunchScreen.storyboard */, + D23151AD1F9A035F0089CED9 /* Info.plist */, + ); + path = TestHost_iOS; + sourceTree = ""; + }; D56DA9D21C20608E003E7253 = { isa = PBXGroup; children = ( + D23151A01F9A035F0089CED9 /* TestHost_iOS */, D56DA9DD1C20608E003E7253 /* Products */, BDA447FF1C294B9F003FDEAD /* Source */, BDA447F91C294B68003FDEAD /* SupportFiles */, @@ -173,6 +208,7 @@ D56DA9E61C20608E003E7253 /* Tests-iOS.xctest */, BDA447E21C294B45003FDEAD /* Keychains.framework */, BDA447EB1C294B45003FDEAD /* Tests-macOS.xctest */, + D231519F1F9A035F0089CED9 /* TestHost_iOS.app */, ); name = Products; sourceTree = ""; @@ -233,6 +269,23 @@ productReference = BDA447EB1C294B45003FDEAD /* Tests-macOS.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; + D231519E1F9A035F0089CED9 /* TestHost_iOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = D23151B01F9A035F0089CED9 /* Build configuration list for PBXNativeTarget "TestHost_iOS" */; + buildPhases = ( + D231519B1F9A035F0089CED9 /* Sources */, + D231519C1F9A035F0089CED9 /* Frameworks */, + D231519D1F9A035F0089CED9 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = TestHost_iOS; + productName = TestHost_iOS; + productReference = D231519F1F9A035F0089CED9 /* TestHost_iOS.app */; + productType = "com.apple.product-type.application"; + }; D56DA9DB1C20608E003E7253 /* Keychains-iOS */ = { isa = PBXNativeTarget; buildConfigurationList = D56DA9F01C20608E003E7253 /* Build configuration list for PBXNativeTarget "Keychains-iOS" */; @@ -275,7 +328,7 @@ D56DA9D31C20608E003E7253 /* Project object */ = { isa = PBXProject; attributes = { - LastSwiftUpdateCheck = 0720; + LastSwiftUpdateCheck = 0900; LastUpgradeCheck = 0900; ORGANIZATIONNAME = "Hyper Interaktiv AS"; TargetAttributes = { @@ -285,6 +338,15 @@ BDA447EA1C294B45003FDEAD = { CreatedOnToolsVersion = 7.2; }; + D231519E1F9A035F0089CED9 = { + CreatedOnToolsVersion = 9.0; + ProvisioningStyle = Manual; + SystemCapabilities = { + com.apple.Keychain = { + enabled = 1; + }; + }; + }; D56DA9DB1C20608E003E7253 = { CreatedOnToolsVersion = 7.2; LastSwiftMigration = 0800; @@ -301,6 +363,7 @@ hasScannedForEncodings = 0; knownRegions = ( en, + Base, ); mainGroup = D56DA9D21C20608E003E7253; productRefGroup = D56DA9DD1C20608E003E7253 /* Products */; @@ -311,6 +374,7 @@ D56DA9E51C20608E003E7253 /* Tests-iOS */, BDA447E11C294B45003FDEAD /* Keychains-macOS */, BDA447EA1C294B45003FDEAD /* Tests-macOS */, + D231519E1F9A035F0089CED9 /* TestHost_iOS */, ); }; /* End PBXProject section */ @@ -331,6 +395,16 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + D231519D1F9A035F0089CED9 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + D23151AC1F9A035F0089CED9 /* LaunchScreen.storyboard in Resources */, + D23151A91F9A035F0089CED9 /* Assets.xcassets in Resources */, + D23151A71F9A035F0089CED9 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; D56DA9DA1C20608E003E7253 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -365,6 +439,15 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + D231519B1F9A035F0089CED9 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + D23151A41F9A035F0089CED9 /* ViewController.swift in Sources */, + D23151A21F9A035F0089CED9 /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; D56DA9D71C20608E003E7253 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -396,6 +479,25 @@ }; /* End PBXTargetDependency section */ +/* Begin PBXVariantGroup section */ + D23151A51F9A035F0089CED9 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + D23151A61F9A035F0089CED9 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + D23151AA1F9A035F0089CED9 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + D23151AB1F9A035F0089CED9 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + /* Begin XCBuildConfiguration section */ BDA447F41C294B45003FDEAD /* Debug */ = { isa = XCBuildConfiguration; @@ -465,6 +567,59 @@ }; name = Release; }; + D23151AE1F9A035F0089CED9 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_ENTITLEMENTS = TestHost_iOS/TestHost_iOS.entitlements; + CODE_SIGN_IDENTITY = "iPhone Developer"; + CODE_SIGN_STYLE = Manual; + DEVELOPMENT_TEAM = ""; + GCC_C_LANGUAGE_STANDARD = gnu11; + INFOPLIST_FILE = TestHost_iOS/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + MTL_ENABLE_DEBUG_INFO = YES; + PRODUCT_BUNDLE_IDENTIFIER = "com.fantageek.TestHost-iOS"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + D23151AF1F9A035F0089CED9 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_ENTITLEMENTS = TestHost_iOS/TestHost_iOS.entitlements; + CODE_SIGN_IDENTITY = "iPhone Developer"; + CODE_SIGN_STYLE = Manual; + DEVELOPMENT_TEAM = ""; + GCC_C_LANGUAGE_STANDARD = gnu11; + INFOPLIST_FILE = TestHost_iOS/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_BUNDLE_IDENTIFIER = "com.fantageek.TestHost-iOS"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; D56DA9EE1C20608E003E7253 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -606,6 +761,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = no.hyper.KeychainTests; PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/TestHost_iOS.app/TestHost_iOS"; }; name = Debug; }; @@ -616,6 +772,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = no.hyper.KeychainTests; PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/TestHost_iOS.app/TestHost_iOS"; }; name = Release; }; @@ -640,6 +797,15 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + D23151B01F9A035F0089CED9 /* Build configuration list for PBXNativeTarget "TestHost_iOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D23151AE1F9A035F0089CED9 /* Debug */, + D23151AF1F9A035F0089CED9 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; D56DA9D61C20608E003E7253 /* Build configuration list for PBXProject "Keychains" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/TestHost_iOS/AppDelegate.swift b/TestHost_iOS/AppDelegate.swift new file mode 100644 index 0000000..d8a79e1 --- /dev/null +++ b/TestHost_iOS/AppDelegate.swift @@ -0,0 +1,46 @@ +// +// AppDelegate.swift +// TestHost_iOS +// +// Created by Khoa Pham on 20.10.2017. +// Copyright © 2017 Hyper Interaktiv AS. All rights reserved. +// + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + var window: UIWindow? + + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + return true + } + + func applicationWillResignActive(_ application: UIApplication) { + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. + } + + func applicationDidEnterBackground(_ application: UIApplication) { + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. + } + + func applicationWillEnterForeground(_ application: UIApplication) { + // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. + } + + func applicationDidBecomeActive(_ application: UIApplication) { + // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. + } + + func applicationWillTerminate(_ application: UIApplication) { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + } + + +} + diff --git a/TestHost_iOS/Assets.xcassets/AppIcon.appiconset/Contents.json b/TestHost_iOS/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..1d060ed --- /dev/null +++ b/TestHost_iOS/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,93 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "83.5x83.5", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/TestHost_iOS/Base.lproj/LaunchScreen.storyboard b/TestHost_iOS/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..f83f6fd --- /dev/null +++ b/TestHost_iOS/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/TestHost_iOS/Base.lproj/Main.storyboard b/TestHost_iOS/Base.lproj/Main.storyboard new file mode 100644 index 0000000..03c13c2 --- /dev/null +++ b/TestHost_iOS/Base.lproj/Main.storyboard @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/TestHost_iOS/Info.plist b/TestHost_iOS/Info.plist new file mode 100644 index 0000000..16be3b6 --- /dev/null +++ b/TestHost_iOS/Info.plist @@ -0,0 +1,45 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/TestHost_iOS/TestHost_iOS.entitlements b/TestHost_iOS/TestHost_iOS.entitlements new file mode 100644 index 0000000..c6672c1 --- /dev/null +++ b/TestHost_iOS/TestHost_iOS.entitlements @@ -0,0 +1,10 @@ + + + + + keychain-access-groups + + $(AppIdentifierPrefix)no.hyper.Keychains.TestHost-iOS + + + diff --git a/TestHost_iOS/ViewController.swift b/TestHost_iOS/ViewController.swift new file mode 100644 index 0000000..02a264c --- /dev/null +++ b/TestHost_iOS/ViewController.swift @@ -0,0 +1,25 @@ +// +// ViewController.swift +// TestHost_iOS +// +// Created by Khoa Pham on 20.10.2017. +// Copyright © 2017 Hyper Interaktiv AS. All rights reserved. +// + +import UIKit + +class ViewController: UIViewController { + + override func viewDidLoad() { + super.viewDidLoad() + // Do any additional setup after loading the view, typically from a nib. + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + // Dispose of any resources that can be recreated. + } + + +} +