Validating a form using Combine
Sometimes, the reactive way of thinking feels academic and not connected to the usual problems a developer has to solve. In reality, most of the programs we usually write would benefit from using reactive programming, but some problems fit better than others.
Let's consider as an example a part of an app where the user has to fill in a form. The form has several fields, each one with a different way of being validated; some can be validated on their own while others have validation depending on different fields, and all together concur to validate the whole form.
In the imperative way, this turns out to usually create a mess of spaghetti code, but switching to the reactive declarative way, the code becomes really natural.
In this recipe, we'll implement a simple signup page with a username text field and two password fields, one for the password and the other for password confirmation.
The username has a minimum number of characters...