Set return key on keyboard

When I wanted to add a Done/Next key to the keyboard I found it surprisingly hard to find out how this was possible. After much research I stumbled upon the solutions that you go through the textfield to set the button.

The below examples don't have any logic to work out if the done or next button should be shown, I'll leave that up you to work out for specific domain.

Done

- (void)textFieldDidBeginEditing:(UITextField *)textField
{
      textField.returnKeyType = UIReturnKeyDone;
}

Next

- (void)textFieldDidBeginEditing:(UITextField *)textField
{
      textField.returnKeyType = UIReturnKeyNext;
}

Skip onto next field

- (BOOL)textFieldShouldReturn:(UITextField *)textField
{
   // _firstTextField is the textfield we are moving from
   //_secondTextField is the textfield we are moving to
    if ([textField isEqual:_firstTextField] && UIReturnKeyNext == textField.returnKeyType) {
        [_secondTextField becomeFirstResponder];
    }

    return YES;
}