Home / IOS Development / Binding to a @State struct’s property (SwiftUI): iOSProgramming

Binding to a @State struct’s property (SwiftUI): iOSProgramming



Hi all. I watched CS193p lecture 14 in 2020 and at 29:56 (https://youtu.be/GRX5Dha_Clw?t=1797) the professor mentioned for some reason that we can not transfer a binding to a structure with state property cover. as the dollar sign refers to binding the value of the structure (thus apparently $ draft.destination does not work). However, I see him doing $ draft.destination elsewhere in the code (as for Pickers’ “selection” binding), and it works fine there …

Would really appreciate if anyone can help me understand why this is. Thanks!


Source link