Skip to content

Version 0.0.5

Compare
Choose a tag to compare
@SvenTiigi SvenTiigi released this 17 Jan 22:11

Refactored Architecture

This release contains breaking changes and introduces a more SwiftUI oriented architecture.

struct LoginView: View {
    
    @Validated(!.isEmpty && .isEmail)
    var mailAddress = String()
    
    @Validated(.range(8...))
    var password = String()
    
    var body: some View {
        List {
            TextField("E-Mail", text: self.$mailAddress)
            TextField("Password", text: self.$password)
            Button(
                action: {
                    print("Login", self.mailAddress, self.password)
                },
                label: {
                    Text("Submit")
                }
            )
            .validated(
                self._mailAddress,
                self._password
            )
        }
    }
    
}