4 Text Input and Delegation

WorldTrotter looks good, but so far it does not do anything. In this chapter, you are going to add an instance of UITextField to WorldTrotter. The text field will allow the user to type in a temperature in Fahrenheit that will then be converted to Celsius and displayed on the interface (Figure 4.1).

Figure 4.1  WorldTrotter with a UITextField

WorldTrotter with a UITextField

Text Editing

The first thing you are going to do is add a UITextField to the interface and set up the constraints for that text field. This text field will replace the top label in the interface that currently has the text 212.

Open Main.storyboard ...

Get iOS Programming: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.