Skip to content

Parallel states #6

@gioele-santi

Description

@gioele-santi

Hi, I read the article while programming in the last few days. It was very useful to better understand Combine + SwiftUI in the MVVM pattern. And also a very good chance to merge several concepts that I studied in the past but never realised I could combine effectively (like FSM and reactive programming).

My question is, at the beginning of the article you talk about a user registration view and since I am trying to do something similar I was wondering how could you manage parallel states...

I mean while in idle, waiting for a valid user input, the application should continuously validate the input (eg: no empty username, strong pw, correct retype of pw). I added some @published variables in ViewModel for username and password(s) and valid (to enable button) but the change in view is still managed by the single state and those are computed independently from it. Is there a better way to manage a state composed by more variables?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions