All Projects → Mindinventory → GenericLocalPersistence

Mindinventory / GenericLocalPersistence

Licence: MIT license
GenericLocalPersistence is a clean and easy-to-use code that is useful for integrating local storage like UserDefaults, PList, Keychain.

Programming Languages

swift
15916 projects
ruby
36898 projects - #4 most used programming language
objective c
16641 projects - #2 most used programming language

Projects that are alternatives of or similar to GenericLocalPersistence

Prephirences
Prephirences is a Swift library that provides useful protocols and convenience methods to manage application preferences, configurations and app-state. UserDefaults
Stars: ✭ 548 (+3123.53%)
Mutual labels:  keychain, userdefaults, plist
Persistentstorageserializable
Swift library that makes easier to serialize the user's preferences (app's settings) with system User Defaults or Property List file on disk.
Stars: ✭ 162 (+852.94%)
Mutual labels:  userdefaults, plist
Hxbaseprojectdemo
一个项目的基类工程
Stars: ✭ 126 (+641.18%)
Mutual labels:  userdefaults, plist
Securepropertystorage
Helps you define secure storages for your properties using Swift property wrappers.
Stars: ✭ 379 (+2129.41%)
Mutual labels:  keychain, userdefaults
swift-standard-clients
Client declarations and live implementations for standard iOS managers
Stars: ✭ 28 (+64.71%)
Mutual labels:  keychain, userdefaults
Persistencekit
Store and retrieve Codable objects to various persistence layers, in a couple lines of code!
Stars: ✭ 121 (+611.76%)
Mutual labels:  keychain, userdefaults
Cakebase
Cakebase is an asynchronous json database for nodejs.
Stars: ✭ 28 (+64.71%)
Mutual labels:  localstorage
csv2plist.py
Convert a .csv to .plist array for usage with iOS / OSX app development
Stars: ✭ 29 (+70.59%)
Mutual labels:  plist
react-localstorage
Easy methods for use localstorage in Reactjs.
Stars: ✭ 21 (+23.53%)
Mutual labels:  localstorage
cache-bucket
Light Cache for nodeJs and browserJs with TTL.
Stars: ✭ 14 (-17.65%)
Mutual labels:  localstorage
groucho
Know all your users. Scalable front-end (anon) personalization & attribution
Stars: ✭ 31 (+82.35%)
Mutual labels:  localstorage
BlazoredLocalStorage
This library has been moved to the Blazored org
Stars: ✭ 26 (+52.94%)
Mutual labels:  localstorage
Hackintosh-ThinkPad-E14
Files required for prepping a Hackintosh on ThinkPad E14.
Stars: ✭ 27 (+58.82%)
Mutual labels:  plist
localForage-cn
localForage中文仓库,localForage改进了离线存储,提供简洁健壮的API,包括 IndexedDB, WebSQL, 和 localStorage。
Stars: ✭ 201 (+1082.35%)
Mutual labels:  localstorage
Giotto
Theme manager for your app: apply styles to anything you want through a plist file
Stars: ✭ 18 (+5.88%)
Mutual labels:  plist
UserDefault
The simplest way of using the UserDefaults with @propertyWrapper.
Stars: ✭ 17 (+0%)
Mutual labels:  userdefaults
GoogleDriveBrowser
Goole Drive Download Library for iOS
Stars: ✭ 13 (-23.53%)
Mutual labels:  plist
kubectl-passman
kubectl plugin that provides the missing link/glue between common password managers and kubectl
Stars: ✭ 69 (+305.88%)
Mutual labels:  keychain
jsGBC
👾 A GameBoy Color Emulator written in JavaScript
Stars: ✭ 44 (+158.82%)
Mutual labels:  localstorage
local-storage-fallback
Check and use appropriate storage adapter for browser (localStorage, sessionStorage, cookies, memory)
Stars: ✭ 103 (+505.88%)
Mutual labels:  localstorage

GenericLocalPersistence

GenericLocalPersistence is a clean and easy-to-use code that is useful for integrating local storage like,

  • UserDefaults
  • PList
  • Keychain

Read more from MEDIUM

Installation

From CocoaPods First, add the following line to your Podfile

pod install 'GenericLocalPersistence', '~> 0.0.1’

pod 'GenericLocalPersistence', :git => 'https://github.com/Riddhi-mi/GenericLocalPersistence.git'

Usage of UserDefault

import GenericLocalPersistence

Set & Get value from User Default

DefaultManager().saveValueInDefault(value: "TestValue", using: "TestKey")
let valueFetch:String = DefaultManager().getValue("TestKey") ?? ""

Usage of Plist

import GenericLocalPersistence

Set & Get value from plist file

Replace "userDetails" with custom name for creating plist file to store data

private let managerPlist = plistManager(named: "userDetails")
managerPlist?.saveDatatoPlist(value: "TestString Value", using: "TestKey")
let stringValue :String = managerPlist?.getDictionary(key: "TestKey") ?? ""

Usage of KeyChain

import GenericLocalPersistence

Set & Get value from KeyChain file

Store password value

let passWordString = textPassword?.text?.data(using: .utf8, allowLossyConversion: false) ?? Data()
let passwordStatus = KeyChainManager()?.save(key: "com.appBundleID.password", data: passWordString)

//Retrive data

if let receivedData = KeyChainManager()?.load(key: "com.appBundleID.password") {
    let data = String(decoding: receivedData, as: UTF8.self)
    print("result: ", data)
}

Store username value

let userNameString = textName?.text?.data(using: .utf8, allowLossyConversion: false) ?? Data()
let emailStatus = KeyChainManager()?.save(key: "com.appBundleID.email", data: userNameString)

//Retrive data

if let data = KeyChainManager()?.load(key: "com.appBundleID.email") {
    let data = String(decoding: data, as: UTF8.self)
    print("result: ", data)
}

NOTE

Replace "com.appBundleID" with your project bundleID for KeyChain integration
Define the dataType in which you want to fetch the value and thats the way you can get the stored value.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

GenericLocalPersistence is MIT-licensed.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].