在我的应用中,我允许用户从他们的照片库中播放 Live Photos。
为此,我使用以下内容:
@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
}
}
}
通过使用这种方法,每当播放我不想要的实况照片时,我都会得到触觉反馈。这是 的正常行为PHLivePhotoView
吗,有没有办法禁用它?