Obj-Swift
Obj-Swift

Reputation: 2942

Gesture recognizer for tap event at specific positions on the screen

I am displaying hundreds of thumbnails in my view . I know default way to handle tap on thumbnail is using UICollectionView delegate method "didSelectItemAtIndexPath" but since its many thumbnails i wanted to look into adding gestures to the screen position so when i tap on a particular spot on the screen, it will handle the event accordingly for that particular thumbnail underneath. I would like to know if it is a good/possible approach?

Upvotes: 1

Views: 433

Answers (2)

bibo bode
bibo bode

Reputation: 1150

You may find UIGestureRecognizer useful. A good tutorial to get you started is here.

Upvotes: 0

Fogmeister
Fogmeister

Reputation: 77631

It would be a hell of a lot easier to use a UICollectionView.

If you need a custom layout then you can subclass UICollectionViewLayout and get some really cool dynamic layouts.

You also get the added bonus of dequeued cells meaning that you get better memory management using it.

Upvotes: 1

Related Questions