AppProperty // Implement `DynamicProperty` protocol.
This commit is contained in:
parent
b4a669650a
commit
02a059a629
|
@ -159,12 +159,12 @@ public struct TextEditorEX: NSViewRepresentable {
|
||||||
|
|
||||||
// MARK: - Property Wrapper (Bindable Extension)
|
// MARK: - Property Wrapper (Bindable Extension)
|
||||||
|
|
||||||
public extension AppProperty {
|
extension AppProperty: DynamicProperty {
|
||||||
@available(macOS 10.15, *)
|
@available(macOS 10.15, *)
|
||||||
var projectedValue: Binding<Value> {
|
public var projectedValue: Binding<Value> {
|
||||||
.init(
|
.init(
|
||||||
get: {
|
get: {
|
||||||
container.object(forKey: key) as? Value ?? defaultValue
|
wrappedValue
|
||||||
},
|
},
|
||||||
set: {
|
set: {
|
||||||
container.set($0, forKey: key)
|
container.set($0, forKey: key)
|
||||||
|
|
Loading…
Reference in New Issue