我正在開發iOS應用程序,並且我希望用戶能夠選擇屏幕上的某些內容,然後在選擇結束時能夠保存手指一秒鐘,以觸發其他事件。滑動然後按住 - touchesBegan/touchesMoved/touchesEnded
我已經創建了很多動作,當用戶通過四處滑動標記東西時。爲此,我一直在使用:
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
//Stuff here
}
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
//Stuff here
}
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
//Stuff here
}
我不在乎,如果使用這些功能,或者如果它通過UIGestureRecognizer
做,但我根本無法找到實現這樣的高效和簡單的方式。
有什麼建議嗎?