To run the example project, clone the repo, and run pod install
from the Example directory first.
NMKeychain is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "NMKeychain"
Init the NMKeychain
object
let dataInKeychain = NMKeychain<Date?>(
key: "dataInKeychain_unique_key",
identifier: "unique_keychain_identifier",
label: "Label for this data",
defaultValue: Date(timeIntervalSinceNow: -600),
synchronizable: true,
accessibility: .afterFirstUnlock,
onChange: {
print("data has changed")
}
)
Set a value
dataInKeychain.value = Date()
Get the value
let date = dataInKeychain.value
Nicolas Mahe, [email protected]
KeychainAccess from Kishikawakatsumi
NMKeychain is available under the MIT license. See the LICENSE file for more info.