4 Replies
      Latest reply on Jul 20, 2019 11:36 PM by caram
      kevinwo Level 1 Level 1 (0 points)

        In Xcode 11 Beta 4, I'm no longer able to pass `Binding`s down a view hierarchy. For example, imagine I have a list view called `CoolListView`, which renders multiple `CoolListRow` subviews, and the user is able to change a value from the list superview level that I'd like to percolate down to and update the row subviews:

         

        public struct CoolListRow : View {
            @Binding var currentStep: Int
        
            public var body: some View {
               // ...
            }
        
            public init(currentStep: Binding<Int>) {
                self.$currentStep = currentStep
            }
        }

         

        In Beta 3 and earlier, I would be able to pass this `Binding` as an argument to my subviews, but now in Beta 4, Xcode complains `Cannot assign to property: '$currentStep' is immutable`. Any ideas on how to resolve this?