Question

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!

Was it helpful?

Solution

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!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top