This should work:
init(_ test: Test2) {
_t = State(initialValue: test) // Variable 'self.t' used before being initialized
}
@State is a property wrapper, so you need to assign value to the underlying property, thus _ .
This should work:
init(_ test: Test2) {
_t = State(initialValue: test) // Variable 'self.t' used before being initialized
}
@State is a property wrapper, so you need to assign value to the underlying property, thus _ .