触摸方法

触摸方法 (5种)

  • 开始触摸屏幕会自动调用该方法:
-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
    NSLog(@"输入的内容是: %@",self.textField.text);
//    收键盘  结束父试图的编辑
    [self.view endEditing:YES];
}
  • 触摸移动时自动调用该方法:
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{
	、、、
}
  • 触摸结束时自动调用该方法:
 - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{
	、、、
}
  • 点击过程中,事件被手势识别,会回调这个方法:
 - (void)touchesCancelled:(NSSet<UITouch *> *)touches withEvent:(nullable UIEvent *)event{
	、、、
}
  • 未知
 - (void)touchesEstimatedPropertiesUpdated:(NSSet<UITouch *> *)touches NS_AVAILABLE_IOS(9_1);
posted @ 2017-08-23 21:26  笑笑就好90  阅读(150)  评论(0编辑  收藏  举报