Dismissing the Keyboard

When the keyboard appears on the screen in the item detail view, it obscures BNRDetailViewController’s imageView. This is annoying when you are trying to see an image, so you are going to implement the delegate method textFieldShouldReturn: to have the text field resign its first responder status to dismiss the keyboard when the return key is tapped. (This is why you hooked up the delegate outlets earlier.) But first, in BNRDetailViewController.m, have BNRDetailViewController conform to the UITextFieldDelegate protocol.

@​i​n​t​e​r​f​a​c​e​ ​B​N​R​D​e​t​a​i​l​V​i​e​w​C​o​n​t​r​o​l​l​e​r​ ​(​)​ ​ ​ ​ ​<​U​I​N​a​v​i​g​a​t​i​o​n​C​o​n​t​r​o​l​l​e​r​D​e​l​e​g​a​t​e​,​ ​U​I​I​m​a​g​e​P​i​c​k​e​r​C​o​n​t​r​o​l​l​e​r​D​e​l​e​g​a​t​e​ ...

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.