Skip to content

macostea/KeychainItemWrapper.swift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

A Swift implementation of the KeychainItemWrapper from the Apple examples

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages