View Single Post
  #3 (permalink)  
Old October 13th, 2014, 12:52 AM
OrangeLady OrangeLady is offline
Registered User
Points: 9, Level: 1
Points: 9, Level: 1 Points: 9, Level: 1 Points: 9, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2014
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chpt - 4 A Fix to Keyboard Won't disappear pgs 82-83

A more efficient way to set the Delegate for the UITextField and let the delegate act on behalf of the UITextField and dismiss the keyboard when the Return key is pressed...

To set the delegate, open the Main.storyboard and select the UITextField at the top, press the Control key and drag a line using the left mouse button to the View Controller (Yellow Orb) at bottom of screen. Release mouse button and Popover appears. Select the Delegate in the Outlets section.

Note: Make sure textFieldShouldReturn: method is included and the corrections are made from the Errata page on Wrox.com/go/begiosprogramming for chpt 4 in steps 9 and 10.

Next, with the UITextField selected, go to the Attribute Inspector and for the Return Key property, select Done. Then run the application.

This should work.
Reply With Quote