Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learning iOS UI Development

You're reading from   Learning iOS UI Development Implement complex iOS user interfaces with ease using Swift

Arrow left icon
Product type Paperback
Published in Dec 2015
Publisher
ISBN-13 9781785288197
Length 196 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Toc

Table of Contents (11) Chapters Close

Responder chain


An application can handle different kind of events thanks to responder objects. These objects implement specific methods that are useful to respond to one or more events. The UIResponder class is the base class where an interface for these events is defined; therefore, most of the classes that are directly exposed to user interaction are subclasses of UIResponder, such as UIView, UIViewController, UIControl, and even the UIApplication class.

A touch event is propagated through the application structure following an explicit path: the event is generated by the system and added into the event queue; the UIApplication singleton gets the topmost event and propagates it to the key window that, in turn, identifies the view where the touch occurred and passes the event to this view.

Hit-testing

The process through which this view is defined is called hit-testing, and it mainly relies on the hitTest(_:withEvent:) method. The logic is extremely simple: given a touch position, the hit...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at £16.99/month. Cancel anytime