/KeychainItemWrapper.swift

A Swift implementation of the KeychainItemWrapper from the Apple examples

Primary LanguageSwiftMIT LicenseMIT

KeychainItemWrapper.swift

A Swift implementation of the KeychainItemWrapper from the Apple example.

Installation

  1. Drag and drop KeychainItemWrapper.swift into your Xcode project.
  2. All done

Usage

Setting a Keychain item value

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

Getting a Keychain item value

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

Contact

Follow me on twitter @mcostea

License

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