Skip to content

Commit b2233a8

Browse files
Merge pull request #376 from kishikawakatsumi/xcode9.3-swift4.1
Xcode9.3 swift4.1
2 parents 3d89fe8 + 2eb78f1 commit b2233a8

File tree

13 files changed

+69
-22
lines changed

13 files changed

+69
-22
lines changed

Diff for: Examples/Example-iOS/Example-iOS.xcodeproj/project.pbxproj

+7-3
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@
157157
isa = PBXProject;
158158
attributes = {
159159
LastSwiftUpdateCheck = 0700;
160-
LastUpgradeCheck = 0900;
160+
LastUpgradeCheck = 0930;
161161
ORGANIZATIONNAME = "kishikawa katsumi";
162162
TargetAttributes = {
163163
14DAEE8F1A51E1BE0070B77E = {
@@ -272,12 +272,14 @@
272272
CLANG_WARN_BOOL_CONVERSION = YES;
273273
CLANG_WARN_COMMA = YES;
274274
CLANG_WARN_CONSTANT_CONVERSION = YES;
275+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
275276
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
276277
CLANG_WARN_EMPTY_BODY = YES;
277278
CLANG_WARN_ENUM_CONVERSION = YES;
278279
CLANG_WARN_INFINITE_RECURSION = YES;
279280
CLANG_WARN_INT_CONVERSION = YES;
280281
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
282+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
281283
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
282284
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
283285
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
@@ -310,7 +312,7 @@
310312
ONLY_ACTIVE_ARCH = YES;
311313
SDKROOT = iphoneos;
312314
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
313-
SWIFT_VERSION = 3.0;
315+
SWIFT_VERSION = 4.1;
314316
};
315317
name = Debug;
316318
};
@@ -326,12 +328,14 @@
326328
CLANG_WARN_BOOL_CONVERSION = YES;
327329
CLANG_WARN_COMMA = YES;
328330
CLANG_WARN_CONSTANT_CONVERSION = YES;
331+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
329332
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
330333
CLANG_WARN_EMPTY_BODY = YES;
331334
CLANG_WARN_ENUM_CONVERSION = YES;
332335
CLANG_WARN_INFINITE_RECURSION = YES;
333336
CLANG_WARN_INT_CONVERSION = YES;
334337
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
338+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
335339
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
336340
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
337341
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
@@ -356,7 +360,7 @@
356360
MTL_ENABLE_DEBUG_INFO = NO;
357361
SDKROOT = iphoneos;
358362
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
359-
SWIFT_VERSION = 3.0;
363+
SWIFT_VERSION = 4.1;
360364
VALIDATE_PRODUCT = YES;
361365
};
362366
name = Release;

Diff for: Examples/Example-iOS/Example-iOS.xcodeproj/xcshareddata/xcschemes/Example-iOS.xcscheme

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0920"
3+
LastUpgradeVersion = "0930"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -40,7 +40,6 @@
4040
buildConfiguration = "Debug"
4141
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
4242
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
43-
language = ""
4443
shouldUseLaunchSchemeArgsEnv = "YES">
4544
<Testables>
4645
<TestableReference
@@ -70,7 +69,6 @@
7069
buildConfiguration = "Debug"
7170
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
7271
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
73-
language = ""
7472
launchStyle = "0"
7573
useCustomWorkingDirectory = "NO"
7674
ignoresPersistentStateOnLaunch = "NO"

Diff for: KeychainAccess.podspec

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'KeychainAccess'
3-
s.version = '3.1.0'
3+
s.version = '3.1.1'
44
s.summary = 'KeychainAccess is a simple Swift wrapper for Keychain that works on iOS and OS X.'
55
s.description = <<-DESC
66
KeychainAccess is a simple Swift wrapper for Keychain that works on iOS and OS X.
@@ -26,7 +26,7 @@ Pod::Spec.new do |s|
2626
s.requires_arc = true
2727
s.source_files = 'Lib/KeychainAccess/*.swift'
2828

29-
s.pod_target_xcconfig = { 'SWIFT_VERSION' => '3.0' }
29+
s.pod_target_xcconfig = { 'SWIFT_VERSION' => '4.1' }
3030

3131
s.ios.deployment_target = '8.0'
3232
s.osx.deployment_target = '10.9'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>

Diff for: Lib/Configurations/Base.xcconfig

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
88
CLANG_WARN_BOOL_CONVERSION = YES;
99
CLANG_WARN_COMMA = YES;
1010
CLANG_WARN_CONSTANT_CONVERSION = YES;
11+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
1112
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
1213
CLANG_WARN_EMPTY_BODY = YES;
1314
CLANG_WARN_ENUM_CONVERSION = YES;
1415
CLANG_WARN_INFINITE_RECURSION = YES;
1516
CLANG_WARN_INT_CONVERSION = YES;
1617
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
18+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
1719
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
1820
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
1921
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
@@ -44,4 +46,4 @@ WATCHOS_DEPLOYMENT_TARGET = 2.0;
4446
TVOS_DEPLOYMENT_TARGET = 9.0;
4547
MACOSX_DEPLOYMENT_TARGET = 10.9;
4648

47-
SWIFT_VERSION = 4.0;
49+
SWIFT_VERSION = 4.1;

Diff for: Lib/Configurations/Release.xcconfig

+1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
55
ENABLE_NS_ASSERTIONS = NO;
66
MTL_ENABLE_DEBUG_INFO = NO;
77
VALIDATE_PRODUCT = YES;
8+
SWIFT_COMPILATION_MODE = wholemodule;
89
SWIFT_OPTIMIZATION_LEVEL = -Owholemodule;

Diff for: Lib/KeychainAccess.xcodeproj/project.pbxproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@
267267
isa = PBXProject;
268268
attributes = {
269269
LastSwiftUpdateCheck = 0730;
270-
LastUpgradeCheck = 0920;
270+
LastUpgradeCheck = 0930;
271271
ORGANIZATIONNAME = "kishikawa katsumi";
272272
TargetAttributes = {
273273
140F195B1A49D79400B0016A = {

Diff for: Lib/KeychainAccess.xcodeproj/xcshareddata/xcschemes/KeychainAccess.xcscheme

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0920"
3+
LastUpgradeVersion = "0930"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -40,7 +40,6 @@
4040
buildConfiguration = "Debug"
4141
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
4242
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
43-
language = ""
4443
shouldUseLaunchSchemeArgsEnv = "YES">
4544
<Testables>
4645
<TestableReference
@@ -70,7 +69,6 @@
7069
buildConfiguration = "Debug"
7170
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
7271
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
73-
language = ""
7472
launchStyle = "0"
7573
useCustomWorkingDirectory = "NO"
7674
ignoresPersistentStateOnLaunch = "NO"

Diff for: Lib/KeychainAccess.xcodeproj/xcshareddata/xcschemes/TestHost.xcscheme

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0920"
3+
LastUpgradeVersion = "0930"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -26,7 +26,6 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29-
language = ""
3029
shouldUseLaunchSchemeArgsEnv = "YES">
3130
<Testables>
3231
</Testables>
@@ -46,7 +45,6 @@
4645
buildConfiguration = "Debug"
4746
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
4847
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
49-
language = ""
5048
launchStyle = "0"
5149
useCustomWorkingDirectory = "NO"
5250
ignoresPersistentStateOnLaunch = "NO"

Diff for: Lib/KeychainAccess/Info.plist

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>FMWK</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>3.1.0</string>
18+
<string>3.1.1</string>
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>

Diff for: Lib/KeychainAccess/Keychain.swift

+8-1
Original file line numberDiff line numberDiff line change
@@ -778,7 +778,14 @@ public final class Keychain {
778778
}
779779

780780
public func allKeys() -> [String] {
781-
return type(of: self).prettify(itemClass: itemClass, items: items()).flatMap { $0["key"] as? String }
781+
let allItems = type(of: self).prettify(itemClass: itemClass, items: items())
782+
let filter: ([String: Any]) -> String? = { $0["key"] as? String }
783+
784+
#if swift(>=4.1)
785+
return allItems.compactMap(filter)
786+
#else
787+
return allItems.flatMap(filter)
788+
#endif
782789
}
783790

784791
public class func allItems(_ itemClass: ItemClass) -> [[String: Any]] {

Diff for: Lib/KeychainAccessTests/KeychainAccessTests.swift

+33-3
Original file line numberDiff line numberDiff line change
@@ -576,11 +576,21 @@ class KeychainAccessTests: XCTestCase {
576576
XCTAssertNil(attributes?.ref)
577577
XCTAssertNotNil(attributes?.persistentRef)
578578
XCTAssertEqual(attributes?.accessible, Accessibility.afterFirstUnlock.rawValue)
579-
if #available(iOS 9.0, *) {
579+
#if os(iOS)
580+
if #available(iOS 11.3, *) {
581+
XCTAssertNotNil(attributes?.accessControl)
582+
} else if #available(iOS 9.0, *) {
580583
XCTAssertNil(attributes?.accessControl)
581584
} else {
582585
XCTAssertNotNil(attributes?.accessControl)
583586
}
587+
#else
588+
if #available(tvOS 11.3, *) {
589+
XCTAssertNotNil(attributes?.accessControl)
590+
} else {
591+
XCTAssertNil(attributes?.accessControl)
592+
}
593+
#endif
584594
XCTAssertEqual(attributes?.accessGroup, "27AEDK3C9F.com.kishikawakatsumi.KeychainAccess.TestHost")
585595
XCTAssertNotNil(attributes?.synchronizable)
586596
XCTAssertNotNil(attributes?.creationDate)
@@ -618,11 +628,21 @@ class KeychainAccessTests: XCTestCase {
618628
XCTAssertNil(attributes?.ref)
619629
XCTAssertNotNil(attributes?.persistentRef)
620630
XCTAssertEqual(attributes?.accessible, Accessibility.afterFirstUnlock.rawValue)
621-
if #available(iOS 9.0, *) {
631+
#if os(iOS)
632+
if #available(iOS 11.3, *) {
633+
XCTAssertNotNil(attributes?.accessControl)
634+
} else if #available(iOS 9.0, *) {
622635
XCTAssertNil(attributes?.accessControl)
623636
} else {
624637
XCTAssertNotNil(attributes?.accessControl)
625638
}
639+
#else
640+
if #available(tvOS 11.3, *) {
641+
XCTAssertNotNil(attributes?.accessControl)
642+
} else {
643+
XCTAssertNil(attributes?.accessControl)
644+
}
645+
#endif
626646
XCTAssertEqual(attributes?.accessGroup, "27AEDK3C9F.com.kishikawakatsumi.KeychainAccess.TestHost")
627647
XCTAssertNotNil(attributes?.synchronizable)
628648
XCTAssertNotNil(attributes?.creationDate)
@@ -661,11 +681,21 @@ class KeychainAccessTests: XCTestCase {
661681
XCTAssertNil(attributes?.ref)
662682
XCTAssertNotNil(attributes?.persistentRef)
663683
XCTAssertEqual(attributes?.accessible, Accessibility.afterFirstUnlock.rawValue)
664-
if #available(iOS 9.0, *) {
684+
#if os(iOS)
685+
if #available(iOS 11.3, *) {
686+
XCTAssertNotNil(attributes?.accessControl)
687+
} else if #available(iOS 9.0, *) {
665688
XCTAssertNil(attributes?.accessControl)
666689
} else {
667690
XCTAssertNotNil(attributes?.accessControl)
668691
}
692+
#else
693+
if #available(tvOS 11.3, *) {
694+
XCTAssertNotNil(attributes?.accessControl)
695+
} else {
696+
XCTAssertNil(attributes?.accessControl)
697+
}
698+
#endif
669699
XCTAssertEqual(attributes?.accessGroup, "27AEDK3C9F.com.kishikawakatsumi.KeychainAccess.TestHost")
670700
XCTAssertNotNil(attributes?.synchronizable)
671701
XCTAssertNotNil(attributes?.creationDate)

Diff for: README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
[![Platform](https://img.shields.io/cocoapods/p/KeychainAccess.svg)](http://cocoadocs.org/docsets/KeychainAccess)
77
[![Swift 3.x](https://img.shields.io/badge/Swift-3.x-orange.svg?style=flat)](https://swift.org/)
88
[![Swift 4.0](https://img.shields.io/badge/Swift-4.0-orange.svg?style=flat)](https://swift.org/)
9+
[![Swift 4.1](https://img.shields.io/badge/Swift-4.1-orange.svg?style=flat)](https://swift.org/)
910

1011
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.
1112

@@ -539,7 +540,7 @@ item: [authenticationType: Default, key: honeylemon, server: github.com, class:
539540
| **v2.3.x** | iOS 8+, OSX 10.9+, watchOS 2+, tvOS 9+ | 2.0, 2.1, 2.2 |
540541
| **v2.4.x** | iOS 8+, OSX 10.9+, watchOS 2+, tvOS 9+ | 2.2, 2.3 |
541542
| **v3.0.x** | iOS 8+, OSX 10.9+, watchOS 2+, tvOS 9+ | 3.x |
542-
| **v3.1.x** | iOS 8+, OSX 10.9+, watchOS 2+, tvOS 9+ | 4.0 |
543+
| **v3.1.x** | iOS 8+, OSX 10.9+, watchOS 2+, tvOS 9+ | 4.0, 4.1 |
543544

544545
## Installation
545546

0 commit comments

Comments
 (0)