ios - iPhone: Click view behind transparent UIScrollView -


i have uiscrollview set have clear background. part of scrollview have content, part not (so shows other views behind it). able click through uiscrollview , mkmapview behind, transparent portion of uiscrollview.

i have found code having real hard time understanding how working:

- (void)touchesbegan:(nsset *)touches withevent:(uievent *)event {     if (![self yourmethodthatdeterminesinterestingtouches:touches withevent:event])         [self.nextresponder touchesbegan:touches withevent:event];  } 

could me wrap mind around how forward touch event view behind view? can call - (void)touchesbegan:(nsset *)touches withevent:(uievent *)event uiviewcontroller?

what did subclass uiscrollview , implement logic passes responsibility down views under it, if touch happens inside of transparent area.

in our case transparent area defined contentoffset of 120 on y axis, meaning our content starts 120 points below start of uiscrollview, , code looks this:

- (bool)pointinside:(cgpoint)point withevent:(uievent *)event {     if (self.contentoffset.y < 0 && point.y < 0.0) {         return no;     } else {         return yes;     } } 

obviously response past prime helpful searching solution.


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -