Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/morishin/betteruserdefaults
UserDefaults Swift Extensions
https://github.com/morishin/betteruserdefaults
ios swift
Last synced: 23 days ago
JSON representation
UserDefaults Swift Extensions
- Host: GitHub
- URL: https://github.com/morishin/betteruserdefaults
- Owner: morishin
- License: mit
- Created: 2017-02-10T12:10:13.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-12-02T16:33:26.000Z (almost 7 years ago)
- Last Synced: 2024-09-16T07:16:55.803Z (2 months ago)
- Topics: ios, swift
- Language: Swift
- Homepage: http://morishin.hatenablog.com/entry/swifty-userdefaults
- Size: 18.6 KB
- Stars: 3
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# BetterUserDefaults
![Swift version](https://img.shields.io/badge/swift-4.0-orange.svg)
![CocoaPods compatible](https://cocoapod-badges.herokuapp.com/v/BetterUserDefaults/badge.png)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)UserDefaults Swift Extensions
## Usage
```swift
import BetterUserDefaultsextension UserDefaults.Key {
static let sampleKeyA = UserDefaults.Key("sampleKeyA")
static let sampleKeyB = UserDefaults.Key("sampleKeyB")
}UserDefaults.standard.set(true, for: .sampleKeyA)
UserDefaults.standard.set(123, for: .sampleKeyB)UserDefaults.standard.bool(for: .sampleKeyA) // true
UserDefaults.standard.integer(for: .sampleKeyB) // 123
```## Installation
### Carthage
Cartfile```
github "morishin/BetterUserDefaults"
```### CocoaPods
Podfile```ruby
pod 'BetterUserDefaults'
```## LICENSE
MIT