Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/log in #9

Merged
merged 5 commits into from
Nov 15, 2017
Merged

Feature/log in #9

merged 5 commits into from
Nov 15, 2017

Conversation

AntonoffEvgeniy
Copy link
Contributor

Added login screen

private let kPasswordCharactersCountMin = 6

class LoginViewModel: BaseViewModel {
var emailText = Variable<String>(String())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use "" instead of String()


class LoginViewModel: BaseViewModel {
var emailText = Variable<String>(String())
var passwordText = Variable<String>(String())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use "" instead of String()


var isValid: Observable<Bool> {
return Observable.combineLatest(emailText.asObservable(), passwordText.asObservable()) { email, password in
email.isValidAsEmais() && password.characters.count >= kPasswordCharactersCountMin
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, move password validation to separate Validator

@AntonoffEvgeniy AntonoffEvgeniy merged commit 383112b into develop Nov 15, 2017
@AntonoffEvgeniy AntonoffEvgeniy deleted the feature/log_in branch November 15, 2017 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants