Pass scrolling from UIView to the base UIScrollView for proper scrolling

I have a situation similar to these two posts ( 1907297 and 689684 ) and to describe my situation most succinctly, I present this text / graphic layout (similar to what you see in IB, the points used to provide the indent level)

UIView (MainView: 320x460)
, .UIScrollView (ScrollView: 320x460)
, .UIView (OverlayView: 320x40)
,,. UIButton (ArbitraryButton1)
,,. UILabel (ArbitraryLabel1)
,,. UILabel (ArbitraryLabel2)

The goal is for OverlayView to serve as a single transparent container for placing and displaying some arbitrary buttons / labels on top of ScrollView. These buttons / shortcuts should remain stationary while the contents in the ScrollView below it are moved using custom checks. Buttons / tags can sometimes be hidden / unclosed / scaled in unison (with animation), which makes it convenient to group them in a single OverlayView.

The problem is that although the cranes on the OverlayView seem to be passed directly to the base ScrollView just beautifully, the movement of the movements is not affected. I can detect / intercept swipes by overriding

-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event

OverlayView, ScrollView , . , touchhesMoved - , UIScrollView / ?

, , , , . , touchsShouldBegin/touchesShouldCancel, , . , , , - .

, .

P.S. - , iOS 3.0, , UIGestureRecognizers .

+5
4

, viewDidLoad subviews ( )? , swipes, IB.

, , . , , , , , , .

, , , CALayer, CALayer , CALayers .

0

UIScrollView touchshouldCancelInContentView: method

-(BOOL)touchesShouldCancelInContentView:(UIView *)view
{

    if ([view isKindOfClass:[UIButton class]]) {//or whatever class you want to be able to scroll in
        return YES;
    }

    if ([view isKindOfClass:[UIControl class]]) {
        return NO;
    }

    return YES;
}
0

, :

OverlayView ( UIScrollView) 0 (, ) clipToBounds = NO (, OverlayView ). .

 self.OverlayView.clipsToBounds = NO;
 CGRect frame = self.OverlayView.frame;
 self.OverlayView.frame = CGRectMake(frame.origin.x, frame.origin.y, 0, 0);

, OverlayView (, ), . UIScrollView.

0

- , Apple , (MobileJoel). , :
https://github.com/natrosoft/NATouchThroughView

, :

UIView (MainView: 320x460)    
. .UIScrollView (ScrollView: 320x460)
. .UIView (OverlayView: 320x40)  --> change this view to class NARootTouchThroughView in I.B.
. . . .UIView (transparent UIView that you change to class NATouchThroughView in I.B.)
. . . .UIButton (ArbitraryButton1)
. . . .UILabel (ArbitraryLabel1)
. . . .UILabel (ArbitraryLabel2)

, , UIScrollview. UILabels , NATouchThroughView, :

UIView (MainView: 320x460)    
. .UIScrollView (ScrollView: 320x460)
. .NARootTouchThroughView (OverlayView: 320x40)
. . . .NATouchThroughView (transparent)
. . . .UIButton (ArbitraryButton1)
. . . .UILabel (ArbitraryLabel1)
. . . .UILabel (ArbitraryLabel2)
. . . .NATouchThroughView (transparent and covers the labels but not the UIButton)
0