开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜