[iOS] Add "peek and pop" (3d touch) capabilities to RN
See original GitHub issue#3055 will transmit 3d touch props during touch events. However the “peek and pop” feature presented by Apple is still very hard to implement just using pressure events. My goal would be to implement in a related PR a wrapper around iOS’s UIViewControllerPreviewingDelegate
Protocol that makes it easy to create “peek and pop” previews. This protocol works well on iOS but may not be really friendly with the way React does things. On that, I would like to get your input.
In my opinion, the React way of doing things is still handling an event but use a component or an API that would wrap UIPreviewAction
, UIPreviewActionGroup
and the UIPreviewActionItem
Protocol to display the preview and its action group.
How would you do that ? Once I get the right way of doing things here, I can try to implement it!
Issue Analytics
- State:
- Created 8 years ago
- Comments:21 (7 by maintainers)
I have a working (yet not fully featured) example here: https://github.com/brentvatne/PeekPopAttempt
Feel free to flesh it out and distribute as a package on npm. The main missing features are:
preferredContentSize
of the controller being peeked.Usage looks like this:
and…
and…
@ide can a JS implementation match the experience of the native implementation? I just tried this feature on a 6s; it is extremely polished. Blur increases as I increase finger pressure in a very delightful manner.
I mean, anything’s possible, but by going the javascript route you give up a lot of the functionality you get for “free” on iOS if you were to use a UIViewController.