3

I would like to know how to create a web form in native iOS code. Take a look at Twitter and Facebook's login forms:

enter image description here enter image description here

Twitter uses <label>username</label> while Facebook uses <input type="text" placeholder="Email" />. I just don't know how to convert HTML into Objective-C and/or Interface Builder. I don't even know what these components are called so I couldn't Google them.

JoJo
  • 19,587
  • 34
  • 106
  • 162

1 Answers1

2

For the Twitter login, they use a grouped UITableView with two rows and one section. Each row contains two cells (Value 1) which contain a UITextField.

In the Facebook app, the same goes, but there are two sections (UITextField cells and login button). They then have a UIButton at the bottom which allows people to sign up.

Leniel Maccaferri
  • 100,159
  • 46
  • 371
  • 480
max_
  • 24,076
  • 39
  • 122
  • 211
  • So I have to subclass UITableCell and design this structure myself or is it already part of the API somewhere? Also, how did they create the "next" button to jump between form fields? – JoJo Oct 17 '11 at 20:46
  • Subclassing isn't necessary, but you can do that. The next button is by just setting the keyboards return key type to next then get it to switch textFields upon return. – max_ Oct 17 '11 at 21:20
  • Do you have any sample code on how you would make these forms and getting the next button appearing? Like I said in my question, searching on Google for "ios forms" only tells me how to create web forms for Safari. – JoJo Oct 17 '11 at 21:26
  • 1
    Cells with UITextFields: http://windrealm.org/tutorials/uitableview_uitextfield_form.php. Next button: http://stackoverflow.com/questions/1347779/how-to-navigate-through-textfields-next-done-buttons – max_ Oct 17 '11 at 21:44