Swiftpack.co - Zafirzzf/SwiftyPreference as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by Zafirzzf.
Zafirzzf/SwiftyPreference v2.0
Swifty UserDefaults by strong type
⭐️ 1
🕓 1 week ago
.package(url: "https://github.com/Zafirzzf/SwiftyPreference.git", from: "v2.0")


Swifty UserDefaults by strong type

How to use


enum Config {

	@DefaultsKey(key: "token", defaultValue: "defaultValue", type: .device/.user)
	static var token: String

Get Vlaue:

let key = Config.token // done

Monitoring value changes

observation = Config.token.observe { newToken in
	// newToken


Stars: 1
Last commit: 1 week ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics