diff --git a/MasterPassword/iOS/MPUnlockViewController.m b/MasterPassword/iOS/MPUnlockViewController.m index 51be9719..cd2d6661 100644 --- a/MasterPassword/iOS/MPUnlockViewController.m +++ b/MasterPassword/iOS/MPUnlockViewController.m @@ -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;