var description: String { ... }
can be used to define what the variable is going to show when printed. Struct needs to also function likeCustomStringConvertible
to this work
structFilterFlights:View{@BindingvarflightSearch:FlightSearch@BindingvarisPresented:Bool// applies filters only when leaving the sheet@Stateprivatevardraft:FlightSearchinit(flightSearch:Binding<FlightSearch>,isPresented:Binding<Bool>){_flightSearch=flightSearch_isPresented=isPresented_draft=State(wrappedValue:flightSearch.wrappedValue)}...
Picker(...)
takes 3 parameters: label, selection (binding to the thing where selected value is saved), and the views (you provide a bunch of views to choose from- Add
.tag(...)
to the view that's clicked because this line will then update second argument to be what value is inside tag - Looks much better when
Picker
is put insideForm
Form
needs to be insideNavigationView
to make it clickable
- Add
Top comments(0)
Subscribe
For further actions, you may consider blocking this person and/orreporting abuse