Latest | 0.1.0 |
---|---|
Homepage | https://github.com/rizwankce/Storage |
License | MIT |
Platforms | ios 8.0 |
Authors |
Swift Storage
If you are using Coadble
protocol from Swift 4 and needs an easy way to store and retrieve your objects, You are in the right place. Swift Storage is a simple extension to store/retrieve your Coadble
objects.
Features
- [ ] Store Codable objects
- [ ] Retrieve stored Coadble objects
- [ ] Store Locations
- [ ] Cache
- [ ] Documents
- [ ] User Default
- [ ] CloudKit
- [ ] NSUbiquitousKeyValueStore
- [ ] Name Spaced Stores
- [ ] Comprehensive Unit and Integration Test Coverage
- [ ] Complete Documentation
Usage
Considering you have a Coadble Job
struct like below
struct Job: Codable {
let company: String
let position: String
let description: String
let url: String
}
To save or retrieve array of Job
// Create a instance of `Storage` with a type and file name
let storage: Storage<[Job]> = Storage(storageType: .document, filename: "remote-jobs.json")
// To Save array of `Job`
storage.save([job1, job2])
// To retrieve stored values of jobs
let jobs = storage.storedValue
Example
To run the example project, clone the repo, and run pod install
from the Example directory first.
Requirements
- Xcode 9.0+
- Swift 4
Installation
CocoaPods
CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command in terminal:
$ gem install cocoapods
To integrate Swift Storage into your Xcode project using CocoaPods, simply add the following line to your Podfile:
pod 'SwiftStorage'
Contributing
If you like to contribute to this project, feel free to send PR or raise issues.
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
Credits
The idea of Swift Storage is orginally came from Ben Scheirman from NSScreenCast and most of the code is inspired from one of his series and extended a little with more options.
License
Storage is available under the MIT license. See the LICENSE file for more info.
Latest podspec
{ "name": "SwiftStorage", "version": "0.1.0", "summary": "One stop place for all your storage.", "description": "TODO: Add long description of the pod here.", "homepage": "https://github.com/rizwankce/Storage", "license": { "type": "MIT", "file": "LICENSE" }, "authors": { "rizwankce": "[email protected]" }, "source": { "git": "https://github.com/rizwankce/Storage.git", "tag": "0.1.0" }, "platforms": { "ios": "8.0" }, "source_files": "Storage/Classes/**/*", "pushed_with_swift_version": "4.0" }
Wed, 20 Dec 2017 15:20:06 +0000