处理事件的方法
- UIView是UIResponder的子类,可以覆盖下列4个方法处理不同的触摸事件
//一根或者多根手指开始触摸view - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event //一根或者多根手指在view上移动 - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event //一根或者多根手指离开view - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event //触摸结束前,某个系统事件(例如电话呼入)会打断触摸过程 - (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)