Reputation: 488
I want to add a peek and pop feature to my application. I managed to do it, but now I want to add support for iPhone 5s and iPhone Xr, in which there is no 3D Touch.
override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
super.traitCollectionDidChange(previousTraitCollection)
if traitCollection.forceTouchCapability == .available {
registerForPreviewing(with: self, sourceView: messagesTableView)
}
}
If I understand correctly, the only way is to implement it with long press.
peek
for non 3D touch devices without implementing all action, blur, etc?Upvotes: 1
Views: 545
Reputation: 922
You can use PeekPop framework which provide backward compatibility for Peek and Pop.
Haptic Touch can be generated via UIFeedbackGenerator subclasses.
Upvotes: 1