objective c - How to Drag/Drop objects inside a UIScrollView using a UIPanGestureRecognizer? -
i've seen similar questions here, haven't seen solid answer question directly.
i have uiscrollview contains uiimageview object. view can zoomed in view more details on given photo. when zoomed in @ level, panning works expected. pinch zoom works expected well.
now, want add view on top of image (such drawing), within scrollview, whenever scrollview zooms/pans, new drawn view (resizes zoom)--let's call drawnview.
think of annotating picture. i'm viewing image. can zoom in/out on image , pan around find i'm looking for. then, can draw on (no details needed here, working find). but, need move little bit. want touch , drag different location.
whenever touch drag drawnview, want able drag around without delay. don't want use uilongpressgesturerecognizer. i'd rather use uipangesturerecognizer. now, long scrollview not zoomed in @ (zoom factor 1.0f), uipangesturerecognizer on drawnview works fine. however, zoom in @ in scrollview, scrollview's uipangesturerecognizer gets triggered first.
i don't understand why case. drawnview has userinterationenabled = true, , it's visible, why doesn't pan gesture first?
try using
- (bool)touchesshouldcancelincontentview:(uiview *)view if passed in view draw view return no. else return yes.
Comments
Post a Comment