Answers for "swiftui cannot assign value of type binding"

0

init with bindings swiftui

struct AmountView : View {
    @Binding var amount: Double

    private var includeDecimal = false

    init(amount: Binding<Double>) {

        // self.$amount = amount // beta 3
        self._amount = amount // beta 4

        self.includeDecimal = round(self.amount)-self.amount > 0
    }
}
Posted by: Guest on January-20-2021

Code answers related to "swiftui cannot assign value of type binding"

Code answers related to "Swift"

Browse Popular Code Answers by Language