PlayPause button is not responding.
Here is my Code that I placed in viewDidLoad
method:
playPauseTapGestureRegocnizer = UITapGestureRecognizer(target: self, action: #selector(playPauseTapped))
playPauseTapGestureRegocnizer.allowedPressTypes = [NSNumber(value: UIPressType.playPause.rawValue)]
view.addGestureRecognizer(playPauseTapGestureRegocnizer)
I tried placing it in multiple methods but it does not work.
The weird thing is that when I change playPause
with menu
it works perfectly with the menu button.
Am I missing something?
Swift 4
PlayPause Gesture doesn't work on a real device. Alternative solution is to listen to
UIPressesEvent