Reputation: 381
As part of an app I have created a UIScrollView which graphically displays all of the members of a football team.
The UIScrollView control holds an array of players and their photos. When triggered, the UIScrollView draws out the photos of the squad sequentially so the user can scroll through all of the squad's players. The images are represented in another subclass of an object, this time an UIImageView control, in order to store additional player information.
i.e.: PlayerPhoto is subview of SquadScrollView. SquadScrollView is subview of View Controller
I want clicking a player's photo to results in the segue-ing of the view controller that all of this is nested within. Any ideas how to pass this up? Its kind of like a button press, I just don't know how to create it to allow me to add the action to a parent view.
Upvotes: 1
Views: 122
Reputation: 2427
Is this a horizontal or vertical scrolling app? If it's horizontal then using a tableview with the didSelectRowAtIndexPath performing the segue (or hook it up in IB to the cell directly).
If your doing a horizontal scroller you can do something similar with a UICollectionView.
The other option to to use a single press gesture recognizer on the image views and have the gesture recognizer function perform the segue.
Upvotes: 1