danielsaidi / Sheeeeeeeeet

Sheeeeeeeeet is a Swift library for creating menus, custom action sheets, context menus etc.
MIT License
1.74k stars 111 forks source link

[Feature] Is context menu active #128

Closed BinaryDennis closed 4 years ago

BinaryDennis commented 4 years ago

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?)