Prechádzať zdrojové kódy

Merge branch 'swift-4.0'

Evgenii Neumerzhitckii 8 rokov pred
rodič
commit
b91a37df23

+ 1 - 0
.swift-version

@@ -0,0 +1 @@
+4.0

+ 4 - 0
CHANGELOG.md

@@ -1,5 +1,9 @@
 # KeychainSwift version history
 
+## 9.0.0 (2017-09-23)
+
+Update to Swift 4.0.
+
 ## 8.0.3 (2017-04-08)
 
 Fixed Package Manager setup ([maxkramerbcgdv](https://github.com/maxkramerbcgdv)).

+ 1 - 1
Distrib/KeychainSwiftDistrib.swift

@@ -1,7 +1,7 @@
 //
 // Keychain helper for iOS/Swift.
 //
-// https://github.com/marketplacer/keychain-swift
+// https://github.com/evgenyneu/keychain-swift
 //
 // This file was automatically generated by combining multiple Swift source files.
 //

+ 1 - 1
KeychainSwift.podspec

@@ -1,6 +1,6 @@
 Pod::Spec.new do |s|
   s.name        = "KeychainSwift"
-  s.version     = "8.0.2"
+  s.version     = "9.0.0"
   s.license     = { :type => "MIT" }
   s.homepage    = "https://github.com/marketplacer/keychain-swift"
   s.summary     = "A library for saving text and data in the Keychain with Swift."

+ 56 - 20
KeychainSwift.xcodeproj/project.pbxproj

@@ -387,7 +387,7 @@
 /* Begin PBXLegacyTarget section */
 		7ED51A751B7734AF005B39C2 /* ConcatenateSwiftFiles */ = {
 			isa = PBXLegacyTarget;
-			buildArgumentsString = "$PROJECT_DIR/Sources $PROJECT_DIR/Distrib/KeychainSwiftDistrib.swift \"//\n// Keychain helper for iOS/Swift.\n//\n// https://github.com/marketplacer/keychain-swift\n//\n// This file was automatically generated by combining multiple Swift source files.\n//\"";
+			buildArgumentsString = "$PROJECT_DIR/Sources $PROJECT_DIR/Distrib/KeychainSwiftDistrib.swift \"//\n// Keychain helper for iOS/Swift.\n//\n// https://github.com/evgenyneu/keychain-swift\n//\n// This file was automatically generated by combining multiple Swift source files.\n//\"";
 			buildConfigurationList = 7ED51A781B7734AF005B39C2 /* Build configuration list for PBXLegacyTarget "ConcatenateSwiftFiles" */;
 			buildPhases = (
 			);
@@ -555,30 +555,35 @@
 			isa = PBXProject;
 			attributes = {
 				LastSwiftUpdateCheck = 0800;
-				LastUpgradeCheck = 0830;
+				LastUpgradeCheck = 0900;
 				ORGANIZATIONNAME = Marketplacer;
 				TargetAttributes = {
 					232B4C791BC29950001F2B7A = {
 						CreatedOnToolsVersion = 7.0.1;
 						DevelopmentTeam = BS677JRE62;
 						DevelopmentTeamName = "Evgenii Neumerzhitckii";
+						LastSwiftMigration = 0900;
 					};
 					232B4C891BC29984001F2B7A = {
 						CreatedOnToolsVersion = 7.0.1;
+						LastSwiftMigration = 0900;
 					};
 					23E7855F1BDA410C00B7564A = {
 						CreatedOnToolsVersion = 7.1;
+						LastSwiftMigration = 0900;
 					};
 					7E3A6B5F1D3F62C2007C5B1F = {
 						CreatedOnToolsVersion = 8.0;
 						DevelopmentTeam = BS677JRE62;
 						DevelopmentTeamName = "Evgenii Neumerzhitckii";
+						LastSwiftMigration = 0900;
 						ProvisioningStyle = Automatic;
 					};
 					7E3A6B7A1D3F6779007C5B1F = {
 						CreatedOnToolsVersion = 8.0;
 						DevelopmentTeam = BS677JRE62;
 						DevelopmentTeamName = "Evgenii Neumerzhitckii";
+						LastSwiftMigration = 0900;
 						ProvisioningStyle = Automatic;
 					};
 					7ED51A751B7734AF005B39C2 = {
@@ -586,16 +591,17 @@
 					};
 					7ED6C96B1B1C118F00FE8090 = {
 						CreatedOnToolsVersion = 6.4;
-						LastSwiftMigration = 0800;
+						LastSwiftMigration = 0900;
 					};
 					7ED6C9761B1C118F00FE8090 = {
 						CreatedOnToolsVersion = 6.4;
+						LastSwiftMigration = 0900;
 						ProvisioningStyle = Manual;
 						TestTargetID = 7ED6C99C1B1C133500FE8090;
 					};
 					7ED6C99C1B1C133500FE8090 = {
 						CreatedOnToolsVersion = 6.4;
-						LastSwiftMigration = 0800;
+						LastSwiftMigration = 0900;
 					};
 				};
 			};
@@ -856,7 +862,8 @@
 				PRODUCT_NAME = KeychainSwift;
 				SDKROOT = macosx;
 				SKIP_INSTALL = YES;
-				SWIFT_VERSION = 3.0;
+				SWIFT_SWIFT3_OBJC_INFERENCE = Off;
+				SWIFT_VERSION = 4.0;
 			};
 			name = Debug;
 		};
@@ -880,7 +887,8 @@
 				SDKROOT = macosx;
 				SKIP_INSTALL = YES;
 				SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
-				SWIFT_VERSION = 3.0;
+				SWIFT_SWIFT3_OBJC_INFERENCE = Off;
+				SWIFT_VERSION = 4.0;
 			};
 			name = Release;
 		};
@@ -901,7 +909,8 @@
 				PRODUCT_NAME = KeychainSwift;
 				SDKROOT = watchos;
 				SKIP_INSTALL = YES;
-				SWIFT_VERSION = 3.0;
+				SWIFT_SWIFT3_OBJC_INFERENCE = Off;
+				SWIFT_VERSION = 4.0;
 				TARGETED_DEVICE_FAMILY = 4;
 				WATCHOS_DEPLOYMENT_TARGET = 2.0;
 			};
@@ -924,7 +933,8 @@
 				SDKROOT = watchos;
 				SKIP_INSTALL = YES;
 				SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
-				SWIFT_VERSION = 3.0;
+				SWIFT_SWIFT3_OBJC_INFERENCE = Off;
+				SWIFT_VERSION = 4.0;
 				TARGETED_DEVICE_FAMILY = 4;
 				WATCHOS_DEPLOYMENT_TARGET = 2.0;
 			};
@@ -947,7 +957,8 @@
 				PRODUCT_NAME = KeychainSwift;
 				SDKROOT = appletvos;
 				SKIP_INSTALL = YES;
-				SWIFT_VERSION = 3.0;
+				SWIFT_SWIFT3_OBJC_INFERENCE = Off;
+				SWIFT_VERSION = 4.0;
 				TARGETED_DEVICE_FAMILY = 3;
 				TVOS_DEPLOYMENT_TARGET = 9.0;
 			};
@@ -970,7 +981,8 @@
 				SDKROOT = appletvos;
 				SKIP_INSTALL = YES;
 				SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
-				SWIFT_VERSION = 3.0;
+				SWIFT_SWIFT3_OBJC_INFERENCE = Off;
+				SWIFT_VERSION = 4.0;
 				TARGETED_DEVICE_FAMILY = 3;
 				TVOS_DEPLOYMENT_TARGET = 9.0;
 			};
@@ -991,7 +1003,8 @@
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				SDKROOT = macosx;
 				SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
-				SWIFT_VERSION = 3.0;
+				SWIFT_SWIFT3_OBJC_INFERENCE = Off;
+				SWIFT_VERSION = 4.0;
 			};
 			name = Debug;
 		};
@@ -1009,7 +1022,8 @@
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				SDKROOT = macosx;
 				SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
-				SWIFT_VERSION = 3.0;
+				SWIFT_SWIFT3_OBJC_INFERENCE = Off;
+				SWIFT_VERSION = 4.0;
 			};
 			name = Release;
 		};
@@ -1030,7 +1044,8 @@
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				SDKROOT = macosx;
 				SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
-				SWIFT_VERSION = 3.0;
+				SWIFT_SWIFT3_OBJC_INFERENCE = Off;
+				SWIFT_VERSION = 4.0;
 			};
 			name = Debug;
 		};
@@ -1050,7 +1065,8 @@
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				SDKROOT = macosx;
 				SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
-				SWIFT_VERSION = 3.0;
+				SWIFT_SWIFT3_OBJC_INFERENCE = Off;
+				SWIFT_VERSION = 4.0;
 			};
 			name = Release;
 		};
@@ -1085,14 +1101,20 @@
 				CLANG_CXX_LIBRARY = "libc++";
 				CLANG_ENABLE_MODULES = YES;
 				CLANG_ENABLE_OBJC_ARC = YES;
+				CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
 				CLANG_WARN_BOOL_CONVERSION = YES;
+				CLANG_WARN_COMMA = YES;
 				CLANG_WARN_CONSTANT_CONVERSION = 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_LITERAL_CONVERSION = YES;
 				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+				CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+				CLANG_WARN_STRICT_PROTOTYPES = YES;
 				CLANG_WARN_SUSPICIOUS_MOVE = YES;
 				CLANG_WARN_UNREACHABLE_CODE = YES;
 				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -1122,6 +1144,7 @@
 				ONLY_ACTIVE_ARCH = YES;
 				SDKROOT = iphoneos;
 				SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+				SWIFT_VERSION = 4.0;
 				TARGETED_DEVICE_FAMILY = "1,2";
 				VERSIONING_SYSTEM = "apple-generic";
 				VERSION_INFO_PREFIX = "";
@@ -1136,14 +1159,20 @@
 				CLANG_CXX_LIBRARY = "libc++";
 				CLANG_ENABLE_MODULES = YES;
 				CLANG_ENABLE_OBJC_ARC = YES;
+				CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
 				CLANG_WARN_BOOL_CONVERSION = YES;
+				CLANG_WARN_COMMA = YES;
 				CLANG_WARN_CONSTANT_CONVERSION = 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_LITERAL_CONVERSION = YES;
 				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+				CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+				CLANG_WARN_STRICT_PROTOTYPES = YES;
 				CLANG_WARN_SUSPICIOUS_MOVE = YES;
 				CLANG_WARN_UNREACHABLE_CODE = YES;
 				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -1165,6 +1194,7 @@
 				MTL_ENABLE_DEBUG_INFO = NO;
 				SDKROOT = iphoneos;
 				SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
+				SWIFT_VERSION = 4.0;
 				TARGETED_DEVICE_FAMILY = "1,2";
 				VALIDATE_PRODUCT = YES;
 				VERSIONING_SYSTEM = "apple-generic";
@@ -1187,7 +1217,8 @@
 				PRODUCT_BUNDLE_IDENTIFIER = "com.marketplacer.$(PRODUCT_NAME:rfc1034identifier)";
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				SKIP_INSTALL = YES;
-				SWIFT_VERSION = 3.0;
+				SWIFT_SWIFT3_OBJC_INFERENCE = Off;
+				SWIFT_VERSION = 4.0;
 			};
 			name = Debug;
 		};
@@ -1207,7 +1238,8 @@
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				SKIP_INSTALL = YES;
 				SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
-				SWIFT_VERSION = 3.0;
+				SWIFT_SWIFT3_OBJC_INFERENCE = Off;
+				SWIFT_VERSION = 4.0;
 			};
 			name = Release;
 		};
@@ -1226,7 +1258,8 @@
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				SWIFT_OBJC_BRIDGING_HEADER = "Tests/KeychainSwiftTests/KeychainSwiftTests-Bridging-Header.h";
 				SWIFT_OPTIMIZATION_LEVEL = "-Onone";
-				SWIFT_VERSION = 3.0;
+				SWIFT_SWIFT3_OBJC_INFERENCE = Off;
+				SWIFT_VERSION = 4.0;
 				TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Keychain Swift.app/Keychain Swift";
 			};
 			name = Debug;
@@ -1242,7 +1275,8 @@
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				SWIFT_OBJC_BRIDGING_HEADER = "Tests/KeychainSwiftTests/KeychainSwiftTests-Bridging-Header.h";
 				SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
-				SWIFT_VERSION = 3.0;
+				SWIFT_SWIFT3_OBJC_INFERENCE = Off;
+				SWIFT_VERSION = 4.0;
 				TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Keychain Swift.app/Keychain Swift";
 			};
 			name = Release;
@@ -1259,7 +1293,8 @@
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
 				PRODUCT_BUNDLE_IDENTIFIER = com.marketplacer.KeychainSwiftDemo;
 				PRODUCT_NAME = "Keychain Swift";
-				SWIFT_VERSION = 3.0;
+				SWIFT_SWIFT3_OBJC_INFERENCE = Off;
+				SWIFT_VERSION = 4.0;
 			};
 			name = Debug;
 		};
@@ -1272,7 +1307,8 @@
 				PRODUCT_BUNDLE_IDENTIFIER = com.marketplacer.KeychainSwiftDemo;
 				PRODUCT_NAME = "Keychain Swift";
 				SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
-				SWIFT_VERSION = 3.0;
+				SWIFT_SWIFT3_OBJC_INFERENCE = Off;
+				SWIFT_VERSION = 4.0;
 			};
 			name = Release;
 		};

+ 1 - 1
KeychainSwift.xcodeproj/xcshareddata/xcschemes/ConcatenateSwiftFiles.xcscheme

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <Scheme
-   LastUpgradeVersion = "0830"
+   LastUpgradeVersion = "0900"
    version = "1.3">
    <BuildAction
       parallelizeBuildables = "YES"

+ 1 - 1
KeychainSwift.xcodeproj/xcshareddata/xcschemes/Demo.xcscheme

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <Scheme
-   LastUpgradeVersion = "0830"
+   LastUpgradeVersion = "0900"
    version = "1.3">
    <BuildAction
       parallelizeBuildables = "YES"

+ 1 - 1
KeychainSwift.xcodeproj/xcshareddata/xcschemes/KeychainSwift-macOS.xcscheme

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <Scheme
-   LastUpgradeVersion = "0830"
+   LastUpgradeVersion = "0900"
    version = "1.3">
    <BuildAction
       parallelizeBuildables = "YES"

+ 1 - 1
KeychainSwift.xcodeproj/xcshareddata/xcschemes/KeychainSwift-tvOS.xcscheme

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <Scheme
-   LastUpgradeVersion = "0830"
+   LastUpgradeVersion = "0900"
    version = "1.3">
    <BuildAction
       parallelizeBuildables = "YES"

+ 1 - 1
KeychainSwift.xcodeproj/xcshareddata/xcschemes/KeychainSwift-watchOS.xcscheme

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <Scheme
-   LastUpgradeVersion = "0830"
+   LastUpgradeVersion = "0900"
    version = "1.3">
    <BuildAction
       parallelizeBuildables = "YES"

+ 1 - 1
KeychainSwift.xcodeproj/xcshareddata/xcschemes/KeychainSwift.xcscheme

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <Scheme
-   LastUpgradeVersion = "0830"
+   LastUpgradeVersion = "0900"
    version = "1.3">
    <BuildAction
       parallelizeBuildables = "YES"

+ 1 - 1
KeychainSwift.xcodeproj/xcshareddata/xcschemes/macOS Demo.xcscheme

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <Scheme
-   LastUpgradeVersion = "0830"
+   LastUpgradeVersion = "0900"
    version = "1.3">
    <BuildAction
       parallelizeBuildables = "YES"

+ 1 - 1
KeychainSwift.xcodeproj/xcshareddata/xcschemes/macOS Tests.xcscheme

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <Scheme
-   LastUpgradeVersion = "0830"
+   LastUpgradeVersion = "0900"
    version = "1.3">
    <BuildAction
       parallelizeBuildables = "YES"

+ 11 - 19
README.md

@@ -32,11 +32,11 @@ There are three ways you can add KeychainSwift to your Xcode project.
 
 #### Add source (iOS 7+)
 
-Simply add [KeychainSwiftDistrib.swift](https://github.com/marketplacer/keychain-swift/blob/master/Distrib/KeychainSwiftDistrib.swift) file into your Xcode project.
+Simply add [KeychainSwiftDistrib.swift](https://github.com/evgenyneu/keychain-swift/blob/master/Distrib/KeychainSwiftDistrib.swift) file into your Xcode project.
 
 #### Setup with Carthage (iOS 8+)
 
-Alternatively, add `github "marketplacer/keychain-swift" ~> 8.0` to your Cartfile and run `carthage update`.
+Alternatively, add `github "evgenyneu/keychain-swift" ~> 9.0` to your Cartfile and run `carthage update`.
 
 #### Setup with CocoaPods (iOS 8+)
 
@@ -44,7 +44,7 @@ If you are using CocoaPods add this text to your Podfile and run `pod install`.
 
     use_frameworks!
     target 'Your target name'
-    pod 'KeychainSwift', '~> 8.0'
+    pod 'KeychainSwift', '~> 9.0'
 
 
 #### Setup with Swift Package Manager
@@ -57,29 +57,21 @@ import PackageDescription
 let package = Package(
     name: "KeychainSwift",
     dependencies: [
-        .Package(url: "https://github.com/marketplacer/keychain-swift.git",
-                 versions: Version(8,0,0)..<Version(9,0,0))
+        .Package(url: "https://github.com/evgenyneu/keychain-swift.git",
+                 versions: Version(9,0,0)..<Version(10,0,0))
     ]
 )
 ```
 
-#### Swift 4.0 / Xcode 9.0 beta version
-
-*Branch:* swift-4.0
-
-* *File:* [KeychainSwiftDistrib.swift](https://github.com/marketplacer/keychain-swift/blob/swift-4.0/Distrib/KeychainSwiftDistrib.swift)
-* *Carthage:* `github "marketplacer/keychain-swift" "swift-4.0"`
-* *CocoaPods:* `pod 'KeychainSwift', git: 'https://github.com/marketplacer/keychain-swift.git', branch: 'swift-4.0'`
-
 
 ## Legacy Swift versions
 
-Setup a [previous version](https://github.com/marketplacer/keychain-swift/wiki/Legacy-Swift-versions) of the library if you use an older version of Swift.
+Setup a [previous version](https://github.com/evgenyneu/keychain-swift/wiki/Legacy-Swift-versions) of the library if you use an older version of Swift.
 
 
 **iOS 7 support**
 
-Use [iOS 7 compatible](https://github.com/marketplacer/keychain-swift/blob/iOS7/Distrib/KeychainSwiftDistrib.swift) version of the library.
+Use [iOS 7 compatible](https://github.com/evgenyneu/keychain-swift/blob/iOS7/Distrib/KeychainSwiftDistrib.swift) version of the library.
 
 <h2 id="usage">Usage</h2>
 
@@ -131,7 +123,7 @@ KeychainSwift().set("Hello world", forKey: "key 1", withAccess: .accessibleWhenU
 
 You can use `.accessibleAfterFirstUnlock` if you need your app to access the keychain item while in the background. Note that it is less secure than the `.accessibleWhenUnlocked` option.
 
-See the list of all available [access options](https://github.com/marketplacer/keychain-swift/blob/master/Sources/KeychainSwiftAccessOptions.swift).
+See the list of all available [access options](https://github.com/evgenyneu/keychain-swift/blob/master/Sources/KeychainSwiftAccessOptions.swift).
 
 
 <h3 id="keychain_synchronization">Synchronizing keychain items with other devices</h3>
@@ -210,15 +202,15 @@ if keychain.lastResultCode != noErr { /* Report error */ }
 
 ## Using KeychainSwift from Objective-C
 
-[This manual](https://github.com/marketplacer/keychain-swift/wiki/Using-KeychainSwift-in-Objective-C-project) describes how to use KeychainSwift in Objective-C apps.
+[This manual](https://github.com/evgenyneu/keychain-swift/wiki/Using-KeychainSwift-in-Objective-C-project) describes how to use KeychainSwift in Objective-C apps.
 
 ## Known serious issue
 
-It [has been reported](https://github.com/marketplacer/keychain-swift/issues/15) that the library sometimes returns `nil`  instead of the stored Keychain value. The issue seems to be random and hard to reproduce. It may be connected with [the Keychain issue](https://forums.developer.apple.com/thread/4743) reported on Apple developer forums. If you experienced this problem feel free to create an issue so we can discuss it and find solutions.
+It [has been reported](https://github.com/evgenyneu/keychain-swift/issues/15) that the library sometimes returns `nil`  instead of the stored Keychain value. The issue seems to be random and hard to reproduce. It may be connected with [the Keychain issue](https://forums.developer.apple.com/thread/4743) reported on Apple developer forums. If you experienced this problem feel free to create an issue so we can discuss it and find solutions.
 
 ## Demo app
 
-<img src="https://raw.githubusercontent.com/marketplacer/keychain-swift/master/graphics/keychain-swift-demo-3.png" alt="Keychain Swift demo app" width="320">
+<img src="https://raw.githubusercontent.com/evgenyneu/keychain-swift/master/graphics/keychain-swift-demo-3.png" alt="Keychain Swift demo app" width="320">
 
 ## Running Keychain unit tests
 

+ 4 - 4
macOS Demo/ViewController.swift

@@ -29,7 +29,7 @@ class ViewController: NSViewController {
     updateValueLabel()
     errorLabel.stringValue = ""
   }
-	
+  
 //  override var representedObject: Any? {
 //    didSet {
 //    // Update the view, if already loaded.
@@ -37,7 +37,7 @@ class ViewController: NSViewController {
 //  }
 
   @IBAction func onSaveTapped(_ sender: AnyObject) {
-    keychain.synchronizable = synchronizableButton.state == NSOnState
+    keychain.synchronizable = synchronizableButton.state == NSControl.StateValue.on
     keychain.set(textField.stringValue, forKey: TegKeychainDemo_keyName)
     errorLabel.stringValue = "Result code: \(keychain.lastResultCode)"
     updateValueLabel()
@@ -45,7 +45,7 @@ class ViewController: NSViewController {
   
   
   @IBAction func onDeleteTapped(_ sender: AnyObject) {
-    keychain.synchronizable = synchronizableButton.state == NSOnState
+    keychain.synchronizable = synchronizableButton.state == NSControl.StateValue.on
     keychain.delete(TegKeychainDemo_keyName)
     errorLabel.stringValue = "Result code: \(keychain.lastResultCode)"
     updateValueLabel()
@@ -56,7 +56,7 @@ class ViewController: NSViewController {
   }
   
   private func updateValueLabel() {
-    keychain.synchronizable = synchronizableButton.state == NSOnState
+    keychain.synchronizable = synchronizableButton.state == NSControl.StateValue.on
 
     if let value = keychain.get(TegKeychainDemo_keyName) {
       valueLabel.stringValue = "In Keychain: \(value)"