christianselig / ChidoriMenu

An easy way to add menus visually similar to iOS 14's Pull Down and Context Menus but with some added benefits

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Make the interruptible transition

MainasuK opened this issue · comments

commented

Example: https://github.com/MainasuK/ChidoriMenu/tree/feature/interruptible

I'm not sure that's what you want.

Depends on the GIF in the README. The iOS system UIMenu:

  1. Tap button. The menu presenting with animation
  2. Tap overlay. The menu reverses the transition to dismissing.
  3. Tap the button again. The menu cancels dismissing and presenting.

So there must be a reuse or diff mechanism to using the same transitioning. Then just toggle the animator. Finally, call the transition context callback depends on the animator's position end or not. Because the interruptible transition needs marked finish when it's completed.

I toggle the animator when tapping the overlay. That still needs some work to make that feels like the UIMenu.

Demo:
https://user-images.githubusercontent.com/7940186/119816568-6e477400-bf1f-11eb-9b61-5bbcf5c551f8.mp4

commented

By the way. I'm finding a way to trigger the UIMenu display programmatically. Using the mouse with right-click on the iPad could trigger the menu display without the focus bubble.

So if could trigger right-click on the view likes this. The UIMenu could be revealing likes your repo.