The purpose of this repository is to supplement the video with code, and to provide a simple starting point to ad NSUserDefaults to your app.
The “A Foolproof NSUserDefaults example in Swift 2.0 for iOS 9” video demonstrates storing three different data types into the standard NSUserDefaults.
The video uses Swift 2.0 and iOS 9 The code uses Swift 3.1 and iOS 10.3
This code has been updated since the making of the video (updated 04-03-2017). The code now requires two keys be set in the plist.info file: * NSPhotoLibraryUsageDescription * NSCameraUsageDescription These can be set to any value.
Code in the function imagePickerController has also changed to find selected images from the editingInfo dictionary.
You can find more iOS videos on the DeegeU channel
The code is a self contained Swift project that can be loaded into XCode.
This code is written and compiled for Swift 3.1.
There are two issues when running the application.
- objc[2962]: Class PLBuildVersion is implemented in both... This appears to be an issue on Apple's side. Neither library is controlled by this application. This only occurs in the emulator.
- [Generic] Creating an image format with an unknown type is an error Unknown cause, but does not appear to affect the application functionality.
If you are having troubles getting the source code, please see Getting the source code or the video How to get code from GitHub
MIT: http://rem.mit-license.org
Any feedback is welcome. You can contact me at dj at deegeu.com, the Facebook page, the Google+ page or on DeegeU.com.
If you wish to contribute to any issues you find in the source code, please issue a pull request.