Skip to content
A Swift implementation of the KeychainItemWrapper from the Apple examples
Branch: master
Clone or download
macostea Tests enhancement (#6)
* Add tests and travis yml

* Remove testExample method

* Fix scheme name

* Use xcodebuild instead of xctool on travis;
See facebook/xctool#704 for details

* Add destination string

* Remove extra whitespace
Latest commit 0f87650 Sep 30, 2016
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
KeychainTestApp Tests enhancement (#6) Sep 30, 2016
.gitignore Initial commit Apr 6, 2015
.travis.yml Tests enhancement (#6) Sep 30, 2016
KeychainItemWrapper.swift swift 3.0 Sep 29, 2016
LICENSE Initial commit Apr 6, 2015
README.md Update README for Swift 3 Sep 30, 2016

README.md

KeychainItemWrapper.swift

A Swift implementation of the KeychainItemWrapper from the Apple example.

Installation

  1. Drag and drop KeychainItemWrapper.swift into your Xcode project.
  2. Enable Keychain Sharing in target capabilities.
  3. All done!

Usage

Setting a Keychain item value

let keychainItemWrapper = KeychainItemWrapper(identifier: "identifier for this item", accessGroup: "access group if shared")
keychainItemWrapper["superSecretKey"] = "aSuperSecretValue" as AnyObject?

Getting a Keychain item value

let keychainItemWrapper = KeychainItemWrapper(identifier: "identifier for this item", accessGroup: "access group if shared")
let superSecretValue = keychainItemWrapper["superSecretKey"] as? String?
print("The super secret value is: \(superSecretValue)")

Contact

Follow me on twitter @mcostea

License

KeychainItemWrapper.swift is released under the MIT license. See LICENSE for details.

You can’t perform that action at this time.