Created
September 12, 2019 02:27
-
-
Save Slowhand0309/20bf38eccf8f6b84c23d44043d6f82c3 to your computer and use it in GitHub Desktop.
[ダブルタップをUITapGestureRecognizerで設定する] #iOS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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