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.
Features
Adding to Your Project
Swift Package Manager
Swift Package Manager is the recommended way to integrate LNPreviewToContextMenu
in your project.
LNPreviewToContextMenu
supports SPM versions 5.1.0 and above. To use SPM, you should use Xcode 11 to open your project. Click File
-> Swift Packages
-> Add Package Dependency
, enter https://github.com/LeoNatan/LNPreviewToContextMenu
. Select the version you’d like to use.
You can also manually add the package to your Package.swift
file:
.package(url: "https://github.com/LeoNatan/LNPreviewToContextMenu.git", from: "1.0")
And the dependency in your target:
.target(name: "BestExampleApp", dependencies: ["LNPreviewToContextMenu"]),
Carthage
Add the following to your Cartfile:
github "LeoNatan/LNPreviewToContextMenu"
Make sure you follow the Carthage integration instructions here.
Manual
Drag the 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
CocoaPods is not supported. There are many reasons for this. Instead of CocoaPods, use Swift Package Manager. You can continue using CocoaPods for for your other dependencies and Swift Package Manager for LNPreviewToContextMenu
.
Using the Framework
Just link your project with the framework, and the magic will happen automatically.
Optionally, import <LNPreviewToContextMenu/UIPreviewAction+Images.h>
to add support for images to your preview action items.
LNPreviewToContextMenu
LNPreviewToContextMenu
is a framework for automatically transforming your existing 3D Touch Peek&Pop preview controllers and actions into the newUIContextMenu
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.Features
Adding to Your Project
Swift Package Manager
Swift Package Manager is the recommended way to integrate
LNPreviewToContextMenu
in your project.LNPreviewToContextMenu
supports SPM versions 5.1.0 and above. To use SPM, you should use Xcode 11 to open your project. ClickFile
->Swift Packages
->Add Package Dependency
, enterhttps://github.com/LeoNatan/LNPreviewToContextMenu
. Select the version you’d like to use.You can also manually add the package to your
Package.swift
file:And the dependency in your target:
Carthage
Add the following to your Cartfile:
github "LeoNatan/LNPreviewToContextMenu"
Make sure you follow the Carthage integration instructions here.
Manual
Drag the
LNPreviewToContextMenu.xcodeproj
project to your project, and addLNPreviewToContextMenu.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
CocoaPods is not supported. There are many reasons for this. Instead of CocoaPods, use Swift Package Manager. You can continue using CocoaPods for for your other dependencies and Swift Package Manager for
LNPreviewToContextMenu
.Using the Framework
Just link your project with the framework, and the magic will happen automatically.
Optionally, import
<LNPreviewToContextMenu/UIPreviewAction+Images.h>
to add support for images to your preview action items.