Questions tagged [swiftui-state]
47 questions
0
votes
1 answer
Set variable based on @State properties
Inside my View struct, I have the following @State properties:
@State private var email = ""
@State private var password = ""
And multiple times in the View body I repeat this code to check whether the login button should be disabled:
email.isEmpty…

George
- 25,988
- 10
- 79
- 133
-2
votes
1 answer
How can I call a function of a child view from the parent view in swiftUI to change a @state variable?
I'm trying to get into swift/swiftui but I'm really struggling with this one:
I have a MainView containing a ChildView. The ChildView has a function update to fetch the data to display from an external source and assign it to a @State data…

gevaye
- 1
- 2