首页 > 其他 > 详细

UIScrollView 与 touchesBegan 冲突解决方法

时间:2016-09-11 14:07:40      阅读:328      评论:0      收藏:0      [点我收藏+]

给UIScrollView写一个延展 

.h文件实现:

@interface UIScrollView (NSFoundation)

@end

.m文件实现

@implementation UIScrollView (ScrollTouch)

//重写touchesBegin方法   

-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{

//主要代码实现:

    [[self nextResponder] touchesBegan:touches withEvent:event];

//super调用,别漏

    [super touchesBegan:touches withEvent:event];

}

 

//重写touchesEnded方法   

- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {

[[self nextResponder] touchesEnded:touches withEvent:event];

[super touchesEnded:touches withEvent:event];

}

 

//重写touchesMoved方法   

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

[[self nextResponder] touchesMoved:touches withEvent:event];

[super touchesMoved:touches withEvent:event];

}

 

 

 

@end

 

 

 

UIScrollView 与 touchesBegan 冲突解决方法

原文:http://www.cnblogs.com/slc-lover/p/5861617.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!