This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is a re-implementation of the @Binding and @State property wrappers from SwiftUI | |
// The only purpose of this code is to implement those wrappers myself just to understand how they work internally and why they are needed | |
// Re-implementing them myself has helped me understand the whole thing better | |
//: # A Binding is just something that encapsulates getter+setter to a property | |
@propertyDelegate | |
struct XBinding<Value> { | |
var value: Value { | |
get { return getValue() } |