Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the best practices for implementing form in iOS

Tags:

I need to create several screens-forms that would be used for entering data and posting to the server. I have not done that kind of stuff yet, so I'm just wondering are there any best practices for doing that. Currently, I would just drop several text fields, radios and etc, do some manual input validation, do an assembly of input data into URL and then do submission to the server.

I'm thinking about usability, so I think I should implement "move to next text field" after a user dismisses keyboard (resigns first responder). But if all the inputs are filled already and a user changes the value of one field then just navigate to submit button. So, IMHO that might be an example of practice for implementing a form. What practices do you apply?

like image 603
Centurion Avatar asked Aug 26 '11 09:08

Centurion


People also ask

What is a good form design?

The overarching principle for form design best practices keeps popping up: Make things easy for the user (especially for mobile forms). Limit the amount of typing users need to do to complete a form. One way is to automate as much as possible with features like autofill.

What makes a form user friendly?

Make the actual information entry as simple as possible to create a smooth form fill process. Minimize the amount of typing needed by avoiding long-form answer choices. Instead, use easy to complete options including short-form text responses, drop-downs, and checkboxes.


1 Answers

A few of my experiences from implementing forms:

  • Place inputs and labels in the rows of a UITableView (grouped). It's the way Apple does it and the way most users are used to. But be wary with the reuse of cells, as this may cause your inputs to move around otherwise. In other words, keep references to your inputs in a separate NSArray (or NSDictionary) to make sure they're not lost when the UITableViewCells are reused.

  • Using the keyboard return key to move to the next input is a good idea. It's easy to do if you just keep track of which table cell you're editing, so you can move on to the next one using its NSIndexPath.

  • Check your form validity when the user's made modifications, i.e. by listening to UITextFieldTextDidChangeNotification and in textFieldShouldEndEditing:. If the form's valid, allow the user to submit it on return or using a Done button (or similar).

  • If the user's editing the last row in the form, change the keyboard return button type to Done or similar.

  • UPDATE: Since posting this, it's also become quite common to show input accessory views (the toolbar with Prev/Next/Done) on top of the keyboard. In particular when you've got a more extensive form where users might want to go back and forth between inputs. And it's quite easy to implement.

Hope that helps!

like image 111
Kristofer Sommestad Avatar answered Oct 26 '22 13:10

Kristofer Sommestad