DataPersistence is a drop in class that allows easy persistance of data using NSKeyedArchiver/NSKeyedUnarchiver.
DataPersistence requires Swift 2 and Xcode 7.1 to run.
CocoaPods is the recommended way to add DataPersistence to your project.
- Add a pod entry for DataPersistence to your Podfile
pod 'DataPersistence', '~> 0.1.0'
. - Install the pod(s) by running
pod install
. - ...
- Profit
Add the files located in the DataPersistence
directory to your project.
DataPersistence has two class methods one to save data to disk and one to load data from disk.
To save data to disk call:
DataPersistence.saveData(data: AnyObject, directory: NSSearchPathDirectory, filename: String)
To load data from disk call:
DataPersistence.loadData(directory: NSSearchPathDirectory, filename: String)
The changelog can be viewed here.
DataPersistence is distributed under the MIT License.