ios - Pass events from (UITableViewCell->UIScrollView) to owning UITableView -
i have standard uitableview
populated custom cells displayed using uiimageview
. tap on images fire uitableview's
method:
-(void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath
however wanted enable pinch zooming on these images requires nesting uiimageview
in uiscrollview
, that's did. looks this:
@interface smlargegallerycell : uitableviewcell @property (strong, nonatomic) uiimageview *assetimageview; @property (strong, nonatomic) uiscrollview *scrollview; @end
however, when tap on images, uitableview
no longer receives call didselectrowatindexpath
. if tap between cells, event fire. issue seems uiscrollview
not forwarding events.
how can make happen?
i'm thinking along lines of (although know ridiculous):
-(ibaction)myscrollviewaction:(id)sender{ self.scrollview.parenttableview didselectrowatindexpath.....; }
what missing here?
has responder chain?
see answer question seems structurally similar yours: horizontal uiscrollview having vertical uiscrollviews inside - how prevent scrolling of inner scroll views when scrolling outer horizontal view?
shortly solution hack on both:
1) shouldrecognizesimultaneouslywithgesturerecognizer of uigesturerecognizerdelegate protocol.
using can catch gestures on both tableview , cell simultaneously.
2) native uiscrollview's pangesturerecognizer.
since uitableview subclass of uiscrollview should have pangesturerecognizer (and maybe others) well.
just see pattern i've used - believe may transform used in case.
Comments
Post a Comment