Questions tagged [uicontextmenuinteraction]
18 questions
9
votes
1 answer
Weird animation when deleting item from UICollectionView while UIContextMenu is shown
I'm using UIContextMenuInteraction to show a context menu for UICollectionView as follows:
func collectiovnView(_ collectionView: UICollectionView, contextMenuConfigurationForItemAt indexPath: IndexPath, point: CGPoint) ->…

Hejazi
- 16,587
- 9
- 52
- 67
7
votes
1 answer
UICollectionView reordering: interactive movement or drag and drop?
As of iOS 9, UICollectionView supports interactive movement via beginInteractiveMovement and its sibling methods. As of iOS 11, it also supports drag and drop, which seems to support movement as well. In iOS 13 beta 4, drag and drop gestures have…

Tom Hamming
- 10,577
- 11
- 71
- 145
6
votes
2 answers
How to use UIPreviewParameters to specify a range of text as a highlighted preview for UIContextMenuInteraction without hiding the rest of the view?
Update for iOS 13.4 (March, 2020):
This also happens with UIPointerInteraction when hovering over the links.
I have a view that displays rich text and shows the iOS 13 context menu when the user long presses on a link. I want to be able to…

halleygen
- 481
- 1
- 7
- 15
4
votes
1 answer
iPadOS: Prevent UIContextMenuInteraction from triggering when not using pointer
UIMenu vs UIContextMenuInteraction vs UIPointerInteraction
I'm trying to set up UIContextMenuInteraction in the same way as in Files or Pages app:
(Long) tap anywhere in the blank space shows the black horizontal UIMenu
Secondary (Right/Control)…

Tom Kraina
- 3,569
- 1
- 38
- 58
3
votes
3 answers
How to hide UIContextMenuInteraction/UITargetedPreview black background?
I want to add UIContextMenuInteraction to a UIView with some transparent parts. When user interact with this view, iOS shows this view with a black background.
Is it possible to make those parts transparent or change the color?

Ali Samaiee
- 301
- 6
- 14
2
votes
1 answer
Change popup size of UIImage in ContextMenu?
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(_…

uuuuuu
- 119
- 1
- 7
2
votes
1 answer
ContextMenuConfiguration for User Images?
I want the image of users to popup (without action option) and then be dismissed if touched outside.
Say table view consist of 2 UI elements (a button and a text) and one picture. How would you set the pop up context menu for only the picture -…

uuuuuu
- 119
- 1
- 7
2
votes
1 answer
Swift programmatic UI UIContextMenuInteraction Auto layout error (groupView) on opening context menu
I have an app with a programmatic UI (No storyboards). I add a context menu to a button of my viewcontroller. On opening this menu (tap and hold on the button) I get a LayoutConstraints warning/error in the console (menu works fine otherwise:
(
…

DeveloperSammy
- 167
- 1
- 11
2
votes
0 answers
UIContextMenuInteraction giving NSLayoutConstraint warnings when interacting and shifting the tableView lower down
I have a UITableView to display a series of data in different cells.
I've added a UIContextMenuInteraction to the tableView so that I can interact with each cell and get a preview. When I perform the interaction on any cell, it first gives a bunch…

filippolobisch
- 43
- 3
2
votes
1 answer
How do I prevent UIScrollView from zooming in a ton when activating an iOS 13 context menu?
If you have a UIScrollView that you can zoom into, and you add an iOS 13 context menu interaction to the view inside the scroll view (eg: a UIImageView), when you perform the interaction it weirdly zooms into the image momentarily, then zooms it out…

christianselig
- 405
- 4
- 17
1
vote
1 answer
ios 13 UIContextMenu shows shortened UIAction titles
I decided to addUIContextMenuInteraction to my UITableViewCell, it works fine, but the title that has 9+ letters (without image) or 6+ letters(with image) is getting shortened like this:
Implementation of delegate method:
extension MyCustomCell:…

Alexander Nikolenko
- 485
- 6
- 10
1
vote
0 answers
did select row at indexpath not working after context menu disappears in iOS app
I am implementing UIContextMenu in my App. It runs very well. Only one problem, once context menu has appeared and disappeared, tableView delegate didSelectRowAt indexPath does not work on first tap, but works on second tap.
I can't seem to find…

Shubham Singh
- 11
- 2
0
votes
1 answer
How to handle tap in two or more views in UIContextMenuInteractionDelegate
There are two views and there were added UIContextMenuInteraction to both views. After tap one of these views need to identify which view was tapped.
class Cell: UITableViewCell {
let redView = UIView()
let blueView = UIView()
...
func setup() {
…
0
votes
1 answer
UIContextMenuInteraction for UIControl
I know UIButton has a menu property so that context menus can be added to the button. But for other UIControl subclasses, such as custom UIControls, this property does not exist.
I know that one way of adding a context menu to a UIControl is to call…

ashipma
- 423
- 5
- 15
0
votes
0 answers
How to add buttons and enable tap on UIContextMenu previewView on iOS Swift?
I am trying to add some buttons on the previewView for context menu. But on tapping the preview View, the content menu gets dismissed. How to disable the dismiss action and detect tap on the button inside preview view?
I tried setting…

abhimuralidharan
- 5,752
- 5
- 46
- 70