Today there is no way to find out if the native UIContextMenu is shown or not.
But by adding a computed property called isCurrentlyPresented that uses activeInteraction in ContextMenuDelegate.swift and by resetting activeInteraction in the callback method for when the context menu is being dismissed, it will be possible to find that out.
Delegate callback method used to reset the property activeInteraction
contextMenuInteraction(_ interaction: UIContextMenuInteraction, willEndFor configuration: UIContextMenuConfiguration, animator: UIContextMenuInteractionAnimating?)
Today there is no way to find out if the native UIContextMenu is shown or not.
But by adding a computed property called
isCurrentlyPresented
that usesactiveInteraction
inContextMenuDelegate.swift
and by resettingactiveInteraction
in the callback method for when the context menu is being dismissed, it will be possible to find that out.Delegate callback method used to reset the property activeInteraction
contextMenuInteraction(_ interaction: UIContextMenuInteraction, willEndFor configuration: UIContextMenuConfiguration, animator: UIContextMenuInteractionAnimating?)