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.4 Methods tableViewCellLongPressed and displayLongPressOptions

In the test drive, you saw that you can long press a cell to choose whether to edit the corresponding search query or share the search. Method tableViewCellLongPressed (Fig. 4.28, lines 57–67) is called to respond to the long press gesture. As you’ll see in Fig. 4.34, this method is registered as a gesture handler for each UITableView cell. Lines 59–60 determine whether the method was called because a long press gesture began and whether the UITableView is currently in editing mode. If it is, we do not want to process the long press gesture; otherwise, the dialog that allows the user to edit or share a search would be displayed when the user tries to move a cell. If the UITableView ...

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