Jonathan Dumaine
Jonathan Dumaine

Reputation: 5756

Receive touch events from an UIView from a Nib

I'm sure this is an easy one, yet I need some pointing in the right direction. I have a rather complicated NIB that I would like to have only one view in that nib to listen for touch & multi-touch events. What is the best way of doing so using IBOutlets?

Thanks

Upvotes: 2

Views: 913

Answers (1)

Jonathan Sterling
Jonathan Sterling

Reputation: 18385

If I were you, I would do the following: subclass UIView and implement whichever of the UIResponder touch methods are useful to you:

– touchesBegan:withEvent:
– touchesMoved:withEvent:
– touchesEnded:withEvent:
– touchesCancelled:withEvent:

Or you could implement these methods in a UIViewController subclass.

Upvotes: 1

Related Questions