views:

40

answers:

1

I'm creating an iOS user interface with a lot of different UIImageViews that will trigger actions when tapped (once is enough). I have the choice between using UIButtons with a custom view (the image) or just setting up a bunch of UIImageviews with an associated UITapGestureRecognizers. In terms of functionality I get the same expected result (action triggered on tap). My question is more about performance: the app will (lazily) load around 300 of these touchable UIImageViews in a scroll view. In terms of memory allocation which technique would you suggest?

Thanks for any help and guidance!

A: 

UIButtons. They were designed for this and have been extensively optimized by Apple for [touches]. If you might need more advanced functionality in the future, you might use a UIImageView subclass w/ UITouch events. Good luck!

Kolin Krewinkel