Search code examples
ios3dtouchquickaction

How to add 3D touch quick actions inside an app? Like in contacts


Is there an API to show quick actions menu on force touch inside an app? I only see APIs for showing quick actions menu when you swipe-up peek view. But I want to do something like the example from apple 3D touch page.

Here is what I want to achieve 3D touch quick actions menu on contacts on 6s


Solution

  • There might be another solution but one of the I think is you can show this custom view on detection of 3D touch. You can do it from

    • UIViewControllerPreviewingDelegate method previewingContext:viewControllerForLocation: or you can use force and maximumPossibleForce properties of UITouch to detect pressure applied on screen and show this custom view after particular pressure level.