Say you have a context menu for an image that pops up when long pressed. How can you make the popup larger, but keep the same dimension?
ViewControllerTableViewCell: UITableViewCell, UIContextMenuInteractionDelegate {
func contextMenuInteraction(_ interaction: UIContextMenuInteraction, configurationForMenuAtLocation location: CGPoint) -> UIContextMenuConfiguration? {
UIContextMenuConfiguration(identifier: nil, previewProvider: nil) { _ in
let share = UIAction(title: "", image: UIImage(systemName: "")) { _ in
// share code
}
return UIMenu(title: "", children: [share])
}
}
override func awakeFromNib() {
super.awakeFromNib()
immy.isUserInteractionEnabled = true
immy.addInteraction(UIContextMenuInteraction(delegate: self))
}
You can provide your own previewProvider to your context menu. Just create a custom view controller with an image view for previewing the image at the desired size:
Then just add the custom preview provider implementation to the
UIContextMenuConfiguration
initializer:edit/update:
Without any action