这节我们了解一个UIViewController里面的四个方法,-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
,-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
,-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
,-(void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event
,
当我们对屏幕进行操作的时候,系统会自动调用这四个方法,分别是开始触碰,开始移动,结束触碰,和取消触碰。
我们可以NSLog一下里面的touches和event;
touches = {(
phase: Began tap count: 1 window:
UI触屏的操作初识
最新推荐文章于 2024-07-09 16:12:54 发布