4

In my app, I allow the user to play Live Photos from their photo library.

To do this, I use the following:

@IBOutlet weak var livePhotoView: PHLivePhotoView!

@objc func handleTapGesture(_ recognizer: UITapGestureRecognizer) {
    if let currentType = currentMediaType {
        if currentType == .livePhoto && livePhotoIsPlaying == false {
            playImageView.alpha = 0
            backButtonView.alpha = 0
            ivePhotoView.startPlayback(with: .full)
            livePhotoIsPlaying = true
        } else if currentType == .livePhoto && livePhotoIsPlaying == true {
            livePhotoView.stopPlayback()
            livePhotoIsPlaying = false
        }
    }
}

By using this method, I get Haptic Feedback whenever the Live Photo is played which I don't want. Is this the normal behavior of PHLivePhotoView, and is there a way to disable it?

Lukas Würzburger
  • 6,543
  • 7
  • 41
  • 75
HemOdd
  • 697
  • 1
  • 7
  • 23

1 Answers1

-1

PHLivePhotoViews have an enum property called PHLivePhotoViewPlaybackStyle that determines if the playback should include haptic feedback.

To disable haptic feedback on playback use:

livePhotoView.startPlayback(with: .hint)

instead of:

livePhotoView.startPlayback(with: .full)
Stephen Thomas
  • 79
  • 1
  • 1
  • 5