Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/roytang121/Akaibu-NSUserDefaults
Save NSObject into NSUserDefaults in one-line, auto class mapping
https://github.com/roytang121/Akaibu-NSUserDefaults
Last synced: 14 days ago
JSON representation
Save NSObject into NSUserDefaults in one-line, auto class mapping
- Host: GitHub
- URL: https://github.com/roytang121/Akaibu-NSUserDefaults
- Owner: roytang121
- License: mit
- Created: 2015-10-10T17:16:59.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-04-22T05:28:31.000Z (over 8 years ago)
- Last Synced: 2024-08-01T20:37:09.483Z (3 months ago)
- Language: Swift
- Homepage:
- Size: 18.6 KB
- Stars: 14
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Akaibu
### What is it ?
* **Archive** any class in just **ONE-LINE** of code.
* **Automatically** map class's properties under the hood.
* Drop in replacement of NSObject
* Swifty \<3### Installation
Drag n drop the `Akaibu.swift` into your project directory. Enjoy ~```swift
// By extending Akaibu, it inherits from NSObject and NSCoding automaticallyclass Model: Akaibu {
//.....
}
```### tl;dr
That's all you need to know
```swift
model.saveWithKey(key) // archive to NSUserDefaults
// or
Akaibu.saveWithKey(model, key) // archive to NSUserDefaultslet model = Akaibu.loadWithKey(key) as? Model // load from NSUserDefaults
```### Clear saved objects
```swift
Akaibu.removeAll()
```
### Why Akaibu ?
* Easy to use and save tons of time
* You don't want CoreData
* You are sick of `encodeWithCoder:` and `initWithCoder:`### About Akaibu:
* Akaibu is inspired by the japanese word **「アーカイブ」** , which means **archive**.