Skip to content

PattoMotto/EZKeychain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EZKeychain

CI Status Version License Platform

Description

Lightweight Keychain API wrapper. Yes this just another one :)

You may wanna check this cool Keychain wrapper

Example

let keychain = EZKeychain.shared

keychain.writeString(key: keyString, value: "Simple string")
print(keyString, keychain.readString(key: keyString))
keychain.clear(key: keyString)

keychain.write(key: keyCodable, value: FooBarStruct(foo: "Foo", bar: 11))
let foobar:FooBarStruct? = keychain.read(key: keyCodable)
print(keyCodable, foobar)
keychain.clear(key: keyCodable)

keychain.writeData(key: keyData, value: NSKeyedArchiver.archivedData(withRootObject: [111.11, 999.99]))
print(keyData, keychain.readData(key: keyData))
keychain.clear(key: keyData)

keychain.writeObject(key: keyObject, value: ["Foo": 111.11])
print(keyObject, keychain.readObject(key: keyObject))
keychain.clear(key: keyObject)

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

EZKeychain is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'EZKeychain'

Author

PattoMotto

License

EZKeychain is available under the MIT license. See the LICENSE file for more info.