开发者

Detect number of fingers on the scrollview before touch goes into content view

开发者 https://www.devze.com 2023-02-20 11:41 出处:网络
I am already visiting array of UIGestureRecognizer in the scrollview and make maxi开发者_JS百科mumNumberOfTouches to be 2 to allow both one/two finger swipe/drag gesture for my custom scrollview.

I am already visiting array of UIGestureRecognizer in the scrollview and make maxi开发者_JS百科mumNumberOfTouches to be 2 to allow both one/two finger swipe/drag gesture for my custom scrollview. The thing I want to do is to identify between when it's a one finger drag and when it's a two finger drag. Is there a way to achieve this?


The method -(NSUInteger)numberOfTouches of UIGestureRecognizer could tell you how many touches on it.


- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
    int count = [[event allTouches] count]; // this should be 1 or 2
}
0

精彩评论

暂无评论...
验证码 换一张
取 消