Skip to content

Instantly share code, notes, and snippets.

@Slowhand0309
Created September 12, 2019 02:27
Show Gist options
  • Save Slowhand0309/20bf38eccf8f6b84c23d44043d6f82c3 to your computer and use it in GitHub Desktop.
Save Slowhand0309/20bf38eccf8f6b84c23d44043d6f82c3 to your computer and use it in GitHub Desktop.
[ダブルタップをUITapGestureRecognizerで設定する] #iOS
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
let gesture = UITapGestureRecognizer()
gesture.numberOfTapsRequired = 2 // ここで回数を設定する
gesture.rx.event.asSignal()
.emit(onNext: { [weak self] _ in
// do somthing...
}).disposed(by: disposeBag)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment