3D Touch Peek Swipe Like Mail

kbpontius

Using the 3D Touch Peek and Pop functionality, what is the most effective way of mimicking the capability depicted below (to swipe the "peeked" content side-to-side to perform an action)? The screenshot below comes from the iOS native Mail app.

Mail Swipe 3D Touch - Unread Mail Swipe 3D Touch - Trash

Chris Droukas

Update

You can replicate this effect on iOS 10. There's a new set of APIs called UIPreviewInteraction and UIPreviewInteractionDelegate that enable custom presentation for peek/pop interactions. I highly recommend watching A Peek at 3D Touch from this year's WWDC.

Original Answer

Looking at the iOS Runtime Headers, there's a class called UIPreviewPresentationController. That's the controller responsible for peeks. Inside it, there are references to objects called leadingPreviewAction and trailingPreviewAction. These have corresponding properties that deal with edge constraints and centers. Judging by use of the terms leading and trailing (as in Auto Layout), these may correspond to left/right action items.

This is speculation, but I think these related private classes (_UIPreviewQuickActionView) control the behavior you're looking for. Those are unavailable right now.

Likewise, the documentation for UIPreviewAction says:

A preview action, or peek quick action, is displayed below a peek when a user swipes the peek upward. A peek quick action typically selects a deep link to your app and has a title, a style, and a handler.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Swipe UITableViewCell without touch

3D touch/Force touch implementation

iOS 3D Touch programmatically

3D Touch peek and pop trouble

Issues with 3D Touch and state restoration

How to implement 3D-Touch Peek-and-select?

3D Touch Peek and Pop from UITableViewCell how to hand over data to other UIViewController?

Testing 3D touch with iOS Simulator

3D Touch Peek View Will not slide up for action

3D Touch and SpriteKit

Present commit view controller modally instead of pushing when using 3D Touch Peek & Pop

Using 3D Touch with storyboard's peek and pop

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

Peek ViewController but Pop a Different ViewController - 3D Touch - Swift

3D Touch Peek - Background Blur Color

3D Touch Peek And Pop on UITableViewCell Objective C Code. (Force Touch)

Enabling 3D Touch preview for TableView

Disable 3D touch for iOS application

3D Touch: registerForPreviewing in UICollectionViewCell

Touch Input & Mobile Swipe Detection

samsung S3 leftswipe and right swipe not working in one touch

Unity3d Touch Swipe

SWRevealViewController and 3D Touch quickActions

Implement 3D Touch "Peek and Pop" for Manual Segue

3D Touch, peek and pop is crashing with a fatal error : unexpectedly found nil while unwrapping an Optional value

iOS 3D Touch Peek/Pop without Storyboards

3d Peek & Pop for search results

Is there any function for opening a preview (peek) with a long press gesture since 3D Touch won't be supported in iOS 13?

How to achieve 3d touch (peek and pop) in react native