ios - Swift - pinch zoom multiple images -
i have scrollview holds imageview, pinches , zooms fine. issue when i'm programmatically adding additional imageviews scrollview, doing zooming , not main scrollview. in fact, scrollview "locked" panning , zooming.
what want "sync" images place on scrollview respond pinch , zoom, appears in right "scale" size @ whatever zoomscale end with.
this how place new images on screen:
let singletaprecognizer = uitapgesturerecognizer(target: self, action: "scrollviewsingletapped:") singletaprecognizer.numberoftapsrequired = 1 singletaprecognizer.numberoftouchesrequired = 1 scrollview.addgesturerecognizer(singletaprecognizer) and routine adds images:
imageview = uiimageview(image: uiimage(named: "fingerprint36x36.png")) imageview.tag = 1999 imageview.center = cgpoint(x: pointinview.x, y: pointinview.y); scrollview.addsubview(imageview) once happens, appears "self" becomes new view control, , not scrollview.
so "think" question is: how keep gesturerecognizer focused on scrollview , not "top most" imageview?
i not have code setup uipinchgesturerecognizer. works default since i'm using scrollview.
thanks help. :) mark
ok, figured out , wanted share...
in delegate, reusing same variable image placing on background. changed image name, , issue went away itself...
func viewforzoominginscrollview(scrollview: uiscrollview!) -> uiview! { return imageview } imageview name of background @ first, , reused name of xy pointer image. looking in wrong place long time, found thread similar prompted me @ function.
Comments
Post a Comment