raweng / stack-scroll-view

Stack Scroll View Panel like Twitter Ipad app for iOS developers [iPad]
http://www.raweng.com
Other
379 stars 144 forks source link

Add slider to Dataviewcontroller #27

Closed mehta-viru1 closed 12 years ago

mehta-viru1 commented 12 years ago

Hello,

I am trying to add a UISlider to the view of the DataViewController. But the touch events are passed to the view and not to the slider due to which I am unable to move the slider. Please advise.

Thanks, Viraj

Reefaq commented 12 years ago

This happens coz we added the pan-gesture to the StackScrollViewController which captures the horizontal gesture if any, so if you add the UISlider which usually works on horizontal bases this collide with pan-gesture and the pan-gesture take the responsibility.

add the following line in StackScrollViewController.m

// place this in init where the pangesture initalization is done (hope you will get this)

panRecognizer.delegate = self;

// end

Note: you need to place the class which you need to receive touch instead of getting the default slide behavior, here its UIControl

-(BOOL) gestureRecognizer:(UIGestureRecognizer )gestureRecognizer shouldReceiveTouch:(UITouch )touch { if ([touch.view isKindOfClass:[UIControl class]]) { return NO; } return YES; }

mehta-viru1 commented 12 years ago

Thanks a lot Reefaq. Issue Solved.