Make user name entry required.
[FIXED] Prevent the ability to create a new user without user name.
This commit is contained in:
parent
cd64bff5ef
commit
332808027f
@ -349,12 +349,20 @@
|
||||
firstField.keyboardType = UIKeyboardTypeAlphabet;
|
||||
firstField.text = newUser.name;
|
||||
firstField.placeholder = @"eg. Robert Lee Mitchell";
|
||||
firstField.enablesReturnKeyAutomatically = YES;
|
||||
}
|
||||
tappedButtonBlock:^(UIAlertView *alert, NSInteger buttonIndex) {
|
||||
if (buttonIndex == [alert cancelButtonIndex]) {
|
||||
completion(NO);
|
||||
return;
|
||||
}
|
||||
if (![alert textFieldAtIndex:0].text.length) {
|
||||
[PearlAlert showAlertWithTitle:@"Name Is Required" message:nil viewStyle:UIAlertViewStyleDefault initAlert:nil
|
||||
tappedButtonBlock:^(UIAlertView *alert, NSInteger buttonIndex) {
|
||||
[self showNewUserNameAlertFor:newUser completion:completion];
|
||||
} cancelTitle:@"Try Again" otherTitles:nil];
|
||||
return;
|
||||
}
|
||||
|
||||
// Save
|
||||
newUser.name = [alert textFieldAtIndex:0].text;
|
||||
|
Loading…
Reference in New Issue
Block a user