Created
October 24, 2017 16:25
-
-
Save azamsharp/67e79e31263199df3a9c8878ab7b7075 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@IBAction func save() { | |
var errors = [String]() | |
if (viewModel.newPassword.value?.count)! < 8 { | |
errors.append("Password should be at least 8 characters long") | |
} | |
if viewModel.newPassword.value != viewModel.confirmPassword.value { | |
errors.append("Password is not matching") | |
} | |
if errors.count == 0 { | |
// update the password | |
} else { | |
// show the errors | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment