mirror of
https://github.com/ivanvorobei/SwiftUI.git
synced 2026-03-21 00:49:30 +01:00
Remove deprecation warnings for Xcode beta4
This commit is contained in:
@@ -8,13 +8,13 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
@propertyDelegate
|
||||
@propertyWrapper
|
||||
struct UserDefaultValue<Value: Codable> {
|
||||
|
||||
let key: String
|
||||
let defaultValue: Value
|
||||
|
||||
var value: Value {
|
||||
var wrappedValue: Value {
|
||||
get {
|
||||
let data = UserDefaults.standard.data(forKey: key)
|
||||
let value = data.flatMap { try? JSONDecoder().decode(Value.self, from: $0) }
|
||||
|
||||
Reference in New Issue
Block a user