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 year ago
.package(url: "https://github.com/Zafirzzf/SwiftyPreference.git", from: "v2.0")

SwiftyDefaults

Swifty UserDefaults by strong type

How to use

####Setup:

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
}

GitHub

link
Stars: 1
Last commit: 1 year ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

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