Changes

Jump to: navigation, search

Writing iOS 5 Code to Hide the iPad Keyboard

31 bytes added, 17:49, 3 April 2012
Hiding the Keyboard when the User Taps the Background
In order to make the keyboard disappear we need to configure our user interface so that the action method gets called when the background view is touched by the user. By default, Interface Builder has given us an instance of the UIView class as the background to our interface. Unfortunately UIView instances are unable to respond to events so there is no way given the current configuration that we can trigger our action method. We must, therefore, change the class of the view to be an instance of the UIControl class. In the center panel beneath the File’s Owner and First Responder icons is a View. This represents the main view of our interface. Select this icon and display the Identity Inspector from the right hand panel and within the inspector pane change the Class setting from UIView to UIControl:
<google>ADSDAQBOX_FLOW</google>
[[Image:xcode_4.2_ios_5_change_class.jpg|Changing the class of an iOS 5 interface builder object]]

Navigation menu