diff --git a/.travis.yml b/.travis.yml index b114b0163..777eb949d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,6 +11,17 @@ script: - "(cd Lib && travis_retry bundle exec rake $ACTION)" matrix: include: + - osx_image: xcode10 + env: ACTION=build + - osx_image: xcode10 + env: ACTION='build:carthage' + - osx_image: xcode10 + env: ACTION='test:iphonesimulator' + - osx_image: xcode10 + env: ACTION='test:appletvsimulator' + - osx_image: xcode10 + env: ACTION='test:macosx' + - osx_image: xcode9.4 env: ACTION=build - osx_image: xcode9.4 diff --git a/Examples/Example-iOS/Example-iOS.xcodeproj/project.pbxproj b/Examples/Example-iOS/Example-iOS.xcodeproj/project.pbxproj index ccc51694e..608f7bc11 100644 --- a/Examples/Example-iOS/Example-iOS.xcodeproj/project.pbxproj +++ b/Examples/Example-iOS/Example-iOS.xcodeproj/project.pbxproj @@ -163,6 +163,7 @@ 14DAEE8F1A51E1BE0070B77E = { CreatedOnToolsVersion = 6.2; DevelopmentTeam = 27AEDK3C9F; + LastSwiftMigration = 1000; }; }; }; @@ -374,6 +375,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.kishikawakatsumi.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -386,6 +388,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.kishikawakatsumi.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.2; }; name = Release; }; diff --git a/Examples/Example-iOS/Example-iOS.xcodeproj/xcshareddata/xcschemes/Example-iOS.xcscheme b/Examples/Example-iOS/Example-iOS.xcodeproj/xcshareddata/xcschemes/Example-iOS.xcscheme index 5ec4478ae..492933c3d 100644 --- a/Examples/Example-iOS/Example-iOS.xcodeproj/xcshareddata/xcschemes/Example-iOS.xcscheme +++ b/Examples/Example-iOS/Example-iOS.xcodeproj/xcshareddata/xcschemes/Example-iOS.xcscheme @@ -1,6 +1,6 @@ =4.2) + override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCell.EditingStyle, forRowAt indexPath: IndexPath) { + let services = Array(itemsGroupedByService!.keys) + let service = services[indexPath.section] + + let keychain = Keychain(service: service) + let items = keychain.allItems() + + let item = items[indexPath.row] + let key = item["key"] as! String + + keychain[key] = nil + + if items.count == 1 { + reloadData() + tableView.deleteSections(IndexSet(integer: indexPath.section), with: .automatic) + } else { + tableView.deleteRows(at: [indexPath], with: .automatic) + } + } + #else override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) { let services = Array(itemsGroupedByService!.keys) let service = services[indexPath.section] @@ -101,6 +122,7 @@ class AccountsViewController: UITableViewController { tableView.deleteRows(at: [indexPath], with: .automatic) } } + #endif // MARK: diff --git a/Examples/Example-iOS/Example-iOS/AppDelegate.swift b/Examples/Example-iOS/Example-iOS/AppDelegate.swift index 375db5662..9d8baeffb 100644 --- a/Examples/Example-iOS/Example-iOS/AppDelegate.swift +++ b/Examples/Example-iOS/Example-iOS/AppDelegate.swift @@ -29,8 +29,13 @@ import UIKit class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? + #if swift(>=4.2) + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { + return true + } + #else func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool { return true } - + #endif } diff --git a/Examples/Example-iOS/Example-iOS/Images.xcassets/AppIcon.appiconset/Contents.json b/Examples/Example-iOS/Example-iOS/Images.xcassets/AppIcon.appiconset/Contents.json index b8236c653..19882d568 100644 --- a/Examples/Example-iOS/Example-iOS/Images.xcassets/AppIcon.appiconset/Contents.json +++ b/Examples/Example-iOS/Example-iOS/Images.xcassets/AppIcon.appiconset/Contents.json @@ -39,6 +39,11 @@ "idiom" : "iphone", "size" : "60x60", "scale" : "3x" + }, + { + "idiom" : "ios-marketing", + "size" : "1024x1024", + "scale" : "1x" } ], "info" : { diff --git a/Lib/Configurations/Base.xcconfig b/Lib/Configurations/Base.xcconfig index ae1663130..fb0cf3722 100644 --- a/Lib/Configurations/Base.xcconfig +++ b/Lib/Configurations/Base.xcconfig @@ -38,7 +38,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; -CODE_SIGN_IDENTITY[sdk=iphoneos*] = iPhone Developer; +CODE_SIGN_IDENTITY = ; DEVELOPMENT_TEAM = ; IPHONEOS_DEPLOYMENT_TARGET = 8.0; @@ -46,4 +46,4 @@ WATCHOS_DEPLOYMENT_TARGET = 2.0; TVOS_DEPLOYMENT_TARGET = 9.0; MACOSX_DEPLOYMENT_TARGET = 10.9; -SWIFT_VERSION = 4.1; +SWIFT_VERSION = 4.2; diff --git a/Lib/Configurations/TestHost.xcconfig b/Lib/Configurations/TestHost.xcconfig index 0f370183e..e2f9584ba 100644 --- a/Lib/Configurations/TestHost.xcconfig +++ b/Lib/Configurations/TestHost.xcconfig @@ -13,9 +13,10 @@ EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; PRODUCT_BUNDLE_IDENTIFIER = com.kishikawakatsumi.KeychainAccess.TestHost; CODE_SIGN_ENTITLEMENTS = TestHost/TestHost.entitlements; -PROVISIONING_PROFILE_SPECIFIER[sdk=iphone*] = iOS Development; +CODE_SIGN_IDENTITY[sdk=iphone*] = iPhone Developer; CODE_SIGN_IDENTITY[sdk=macosx*] = Developer ID Application; +PROVISIONING_PROFILE_SPECIFIER[sdk=iphone*] = iOS Development; PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*] = KeychainAccess Tests; DEVELOPMENT_TEAM = 27AEDK3C9F; diff --git a/Lib/KeychainAccess.xcodeproj/project.pbxproj b/Lib/KeychainAccess.xcodeproj/project.pbxproj index 6a2fab59a..2b0686d4c 100644 --- a/Lib/KeychainAccess.xcodeproj/project.pbxproj +++ b/Lib/KeychainAccess.xcodeproj/project.pbxproj @@ -267,12 +267,12 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0730; - LastUpgradeCheck = 0930; + LastUpgradeCheck = 1000; ORGANIZATIONNAME = "kishikawa katsumi"; TargetAttributes = { 140F195B1A49D79400B0016A = { CreatedOnToolsVersion = 6.1.1; - LastSwiftMigration = 0900; + LastSwiftMigration = 1000; ProvisioningStyle = Automatic; }; 140F19661A49D79500B0016A = { diff --git a/Lib/KeychainAccess.xcodeproj/xcshareddata/xcschemes/KeychainAccess.xcscheme b/Lib/KeychainAccess.xcodeproj/xcshareddata/xcschemes/KeychainAccess.xcscheme index 7ac666d9e..b10e88d0c 100644 --- a/Lib/KeychainAccess.xcodeproj/xcshareddata/xcschemes/KeychainAccess.xcscheme +++ b/Lib/KeychainAccess.xcodeproj/xcshareddata/xcschemes/KeychainAccess.xcscheme @@ -1,6 +1,6 @@ Cartfile] - if xcode_version.start_with?('8') - sh %[echo SWIFT_VERSION=\"3.0\" > swift3.xcconfig] - sh %[XCODE_XCCONFIG_FILE=`pwd`/swift3.xcconfig carthage update --no-use-binaries] + if xcode_version.start_with?('10') + sh %[echo SWIFT_VERSION=\"4.2\" > swift.xcconfig] + elsif xcode_version.start_with?('9.4') + sh %[echo SWIFT_VERSION=\"4.1\" > swift.xcconfig] + elsif xcode_version.start_with?('9.3') + sh %[echo SWIFT_VERSION=\"4.1\" > swift.xcconfig] + elsif xcode_version.start_with?('9') + sh %[echo SWIFT_VERSION=\"4.0\" > swift.xcconfig] else - sh %[carthage update --no-use-binaries] + sh %[echo SWIFT_VERSION=\"3.0\" > swift.xcconfig] end + sh %[XCODE_XCCONFIG_FILE=`pwd`/swift.xcconfig carthage update --no-use-binaries] + sh %[find . -name '*.bcsymbolmap' | xargs grep swiftlang] end end @@ -255,8 +287,10 @@ namespace :test do t.coverage = true t.build_dir = 'build' t.hide_shell_script_environment = true - if xcode_version.start_with?('9.4') + if xcode_version.start_with?('10') t.add_build_setting('SWIFT_VERSION', '4.2') + elsif xcode_version.start_with?('9.4') + t.add_build_setting('SWIFT_VERSION', '4.1') elsif xcode_version.start_with?('9.3') t.add_build_setting('SWIFT_VERSION', '4.1') elsif xcode_version.start_with?('9') diff --git a/Lib/TestHost/AppDelegate.swift b/Lib/TestHost/AppDelegate.swift index b76711721..17bf91269 100644 --- a/Lib/TestHost/AppDelegate.swift +++ b/Lib/TestHost/AppDelegate.swift @@ -42,8 +42,14 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? + #if swift(>=4.2) + private func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { + return true + } + #else func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool { return true } + #endif } #endif diff --git a/README.md b/README.md index 20458c842..838ef2ca4 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ [![Swift 3.x](https://img.shields.io/badge/Swift-3.x-orange.svg?style=flat)](https://swift.org/) [![Swift 4.0](https://img.shields.io/badge/Swift-4.0-orange.svg?style=flat)](https://swift.org/) [![Swift 4.1](https://img.shields.io/badge/Swift-4.1-orange.svg?style=flat)](https://swift.org/) +[![Swift 4.2](https://img.shields.io/badge/Swift-4.2-orange.svg?style=flat)](https://swift.org/) KeychainAccess is a simple Swift wrapper for Keychain that works on iOS and OS X. Makes using Keychain APIs extremely easy and much more palatable to use in Swift. @@ -540,7 +541,7 @@ item: [authenticationType: Default, key: honeylemon, server: github.com, class: | **v2.3.x** | iOS 8+, OSX 10.9+, watchOS 2+, tvOS 9+ | 2.0, 2.1, 2.2 | | **v2.4.x** | iOS 8+, OSX 10.9+, watchOS 2+, tvOS 9+ | 2.2, 2.3 | | **v3.0.x** | iOS 8+, OSX 10.9+, watchOS 2+, tvOS 9+ | 3.x | -| **v3.1.x** | iOS 8+, OSX 10.9+, watchOS 2+, tvOS 9+ | 4.0, 4.1 | +| **v3.1.x** | iOS 8+, OSX 10.9+, watchOS 2+, tvOS 9+ | 4.0, 4.1, 4.2 | ## Installation