LNPreviewToContextMenu is a framework for automatically transforming your existing 3D Touch Peek&Pop preview controllers and actions into the new UIContextMenu system in iOS 13.
With this framework, your existing 3D Touch Peek&Pop previewing code will automagically display in the new
UIContextMenu system under iOS 13 and above.
- [x] Supports storyboard and code-based previewing
- [x] Optionally, support add images to your existing preview action items to display as menu item images
- [x] Support for devices without 3D Touch (including iPhone 11 and iPads)
- [x] macOS Catalyst support (your preview actions are displayed as a context menu)
Adding to Your Project
Add the following to your Cartfile:
Make sure you follow the Carthage integration instructions here.
LNPreviewToContextMenu.xcodeproj project to your project, and add
LNPreviewToContextMenu.framework to Frameworks, Libraries, and Embedded Content in your project target's General tab. Xcode should sort everything else on its own.
Check out the included example project to see how it is integrated with the framework.
CocoaPods is not supported. There are many reasons for this. Instead of CocoaPods, use Carthage. You can continue using CocoaPods for for your other dependencies and Carthage for
Using the Framework
Just link your project with the framework, and the magic will happen automatically.
<LNPreviewToContextMenu/UIPreviewAction+Images.h> to add support for images to your preview action items.
Subscribe to iOS Example
Get the latest posts delivered right to your inbox