Introduction
Hello
I know this is a bit to late, probably, but in case someone else stumbles upon it: I certainly believe it is possible and I don't think its a "native behavior for contacts". Although it would not be as simple as the UIKit api for peek pop views. You would need to:
Steps
subclass UIGestureRecognizer
(perhaps it may work with the UITapGestureRecognizer
also), and register UITouch
es and use their force
property.
Setup a UIViewController with transparent but blurred background around the edges (together with a modalPresentationStyle .overCurrentContext
if i recall correctly), with your desired content in the middle (much like the peek view). Then add a UIPanGestureRecognizer
to the center view for dismissal/sliding up the buttons.
And then create a custom animation transition for that UIViewController
to be triggered once the force
property of the registered UITouches
from the subclassed UIGestureRecognizer
is high enough. And then reversed once the force
property gets low enough.
Concluding notes
I believe this is a bit of a tedious task and there might be a simpler way. For example, a simpler way using a 3rd party library for long pressure gestures (that registers size of the touch), but it would not give the same feel.