UIScrollView自带了一些手势,有时候可能会与scrollView上面的子view的手势产生冲突。
个人测试了一下,发现在scrollView上面的子view上的手势响应优先级是比scrollView上的高的,只是touchesBegan这些自带的方法需要判断一下。
下面是一个自定义的view,该view上面其实是有两种手势的,tap和pan,还有重写的touchesBegan。等会将其添加到自定义的scrollView上。
//
// ViewCustom.m
// ScrollView
//
// Created by Wu on 16/3/17.
// Copyright © 2016年 Wu. All rights reserved.
//
#import "ViewCustom.h"<pre name="code" class="objc">//
// ScroolViewCustom.m
// ScrollView
//
// Created by Wu on 16/3/17.
// Copyright © 2016年 Wu. All rights reserved.
//
#import "ScrollViewCustom.h"
#import "ViewCustom.h"
@implementation ScrollViewCustom
- (BOOL)touchesShouldBegin:(NS