- August 12, 2025
- Mins Read
Inspired by this project on Dribbble
Also, read how it was done in our blog
pod ‘GuillotineMenu’
You are welcome to see the sample of the project for fully operating sample in the Example folder.
let menuViewController = storyboard!.instantiateViewController(withIdentifier: “MenuViewController”)
menuViewController.modalPresentationStyle = .custom
menuViewController.transitioningDelegate = self
extension ViewController: UIViewControllerTransitioningDelegate {
func animationControllerForPresentedController(presented: UIViewController, presentingController presenting: UIViewController, sourceController source: UIViewController) -> UIViewControllerAnimatedTransitioning? {
presentationAnimator.mode = .presentation
return presentationAnimator
}
func animationControllerForDismissedController(dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? {
presentationAnimator.mode = .dismissal
return presentationAnimator
}
presentationAnimator.supportView = navigationController!.navigationBar
presentationAnimator.presentButton = sender
present(menuViewController, animated: true, completion: nil)
Of course, you can assign different “supportView” or “presentButton” for menu, but we think that’s the best case would be behaviour like in Example project.
To specify the length of an animation effect, change the value of the “duration” property.
Also, you have wonderful delegate methods of animator:
public protocol GuillotineAnimationDelegate: class {
func animatorDidFinishPresentation(_ animator: GuillotineTransitionAnimation)
func animatorDidFinishDismissal(_ animator: GuillotineTransitionAnimation)
func animatorWillStartPresentation(_ animator: GuillotineTransitionAnimation)
func animatorWillStartDismissal(_ animator: GuillotineTransitionAnimation)
}
You can do whatever you want alongside menu is animating.
We’d be really happy if you sent us links to your projects where you use our component. Just send an email to github@yalantis.com And do let us know if you have any questions or suggestion regarding the animation.
P.S. We’re going to publish more awesomeness wrapped in code and a tutorial on how to make UI for iOS (Android) better than better. Stay tuned!
Recognize your user's voice elegantly without having to figure out authorization and audio engines. SwiftSpeech Examples Features Installation Getting Started ...
Example To run the example project, clone the repo, and run pod install from the Example directory first. Requirements iOS 14.0 Installation ...
SlidingRuler is a Swift package containing a SwiftUI control that acts like an linear infinite slider or a finite, more precise ...
SkeletonUI aims to bring an elegant, declarative syntax to skeleton loading animations. Get rid of loading screens or spinners and ...