O'Reilly logo

iOS® 8 for Programmers: An App-Driven Approach with Swift™, Third Edition by Abbey Deitel, Harvey M. Deitel, Paul J. Deitel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

4.6.5 Method displayAddEditSearchAlert

When the user chooses to add a new search or edit an existing one, method displayAddEditSearch (Fig. 4.29) displays an appropriate UIAlertController based on the method’s first argument. This dialog provides UITextFields for receiving user input. Lines 98–101 create the UIAlertController. If the search is new, the dialog’s title will be "Add Search" (line 99) and the message will be empty (line 100) because we’ll provide text in the UITextFields with instructions for the user. If the search is being edited, the dialog’s title will be "Edit Search" (line 99) and the message will be "Modify your query" (line 100).

  95       // displays add/edit dialog  96       func displayAddEditSearchAlert(# ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required