Our Guillotine Menu Transitioning Animation implemented in Swift reminds a bit of a notorious killing machine.

Overview

GuillotineMenu.swift

pod version Platform Yalantis

Preview

Inspired by this project on Dribbble

Also, read how it was done in our blog

Requirements

  • iOS 8.0+
  • Xcode 10
  • Swift 5.0 (v 4.1+)
  • Swift 4.2 (v 4.0)

Installation

CocoaPods

pod 'GuillotineMenu'

Manual Installation

You are welcome to see the sample of the project for fully operating sample in the Example folder.

  • You must add "GuillotineMenuTransitionAnimation.swift" to your project, that's all.

Usage

  • Now, it's for you to decide, should or not your menu drop from top left corner of the screen or from your navigation bar, because if you want animation like in example, you must make your menu view controller confirm to "GuillotineMenu" protocol. When you confirm to this protocol, you must make a menu button and title, you don't need to make frame for them, because animator will make it itself.
  • In view controller, that will present your menu, you must make a property for "GuillotineMenuTransitionAnimator". It's necessary for proper animation when you show or dismiss menu.
  • When you present menu, you must ensure, that model presentation style set to Custom and menu's transition delegate set to view controller, that presents menu:
let menuViewController = storyboard!.instantiateViewController(withIdentifier: "MenuViewController")
menuViewController.modalPresentationStyle = .custom
menuViewController.transitioningDelegate = self
  • Implement UIViewControllerTransitionDelegate methods in your presenting view controller:
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
}
  • At last, you can assign offset view, from where your menu will be dropped and button for it, and present your menu:
presentationAnimator.supportView = navigationController!.navigationBar
presentationAnimator.presentButton = sender
present(menuViewController, animated: true, completion: nil)

Customisation

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.

Let us know!

We’d be really happy if you sent us links to your projects where you use our component. Just send an email to [email protected] 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!

License

The MIT License (MIT)

Copyright © 2017 Yalantis

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Comments
  • Change view from menu

    Change view from menu

    Hi :),

    Thank you for your menu, it's so cool ^^. But I don't understand something, how do you do to change view from the menu (from profile button by example) ? May be i'm too tired lol but i tried all, and nothing works ... Can you help me ? Thank you.

    opened by RpX974 9
  • Dismiss animation is not fast enough

    Dismiss animation is not fast enough

    when i set animationDuration lower than 0.15, dismiss animation will never stop. How could I make animation faster and without dismiss bug?

    thank you.

    type: enhancement 
    opened by BadReese 7
  • After Animation UI doesn't respond for 1-2 seconds

    After Animation UI doesn't respond for 1-2 seconds

    After that animation is finished in the two modes : Presentation & Dismissal , the UI doesn't respond :

    • you can not select anything ..for example for the demo application you can not neither select the menu button nor scrolling the tableView.
    type: bug priority: high status: work in progress 
    opened by dingua 6
  • iOS 7

    iOS 7

    I don't have an iOS 7 device or simulator but my app must support iOS 7 min.

    What part of code base stops it from being compatible with iOS 7. I don't seem to see anything that is iOS 8+

    opened by pjebs 4
  • Problem when run in iOS8.2 by iPhone6

    Problem when run in iOS8.2 by iPhone6

    Using Xcode 7.2 + swift2.0 Thank you for your menu, it's so cool But when i try it in iPhone6 using iOS8.2, it have big problem. Just display : VC: viewWillAppear VC: viewDidAppear Menu: viewWillAppear VC: viewWillDisappear willStartPresentation img_0221

    opened by lelang 4
  • Button changes of position when we push on it

    Button changes of position when we push on it

    Hello there,

    Just to let you know, i have experiencing an issue with the button on the top left corner. When the first VC appears, the button has a good position, but as soon as i push on it to get the second VC, the button move on the maximum top and left corner... When i push again to get back on the first VC, the button gets back its correct position... I ve compared between my version and the example... but i don't find anything...

    type: bug priority: critical status: queued 
    opened by Hugo75002 3
  • Menu UIButton -> UIBarButtonItem

    Menu UIButton -> UIBarButtonItem

    I tried to add the GuillotineMenu to my app but i saw the menu button inside the menu view never appears because it returns an UIButton in the dismissButton variable and the button in the navigation bar is an UIBarButtonItem. I don't know if it's something i have to change or is something from a newer version of Xcode because i couldn't have access to the button within the uibarbuttonitem in the storyboard. I even had to change the code in the viewcontroller when i want to present the menu (presentationAnimator.presentButton = sender.customView as? UIButton) because the sender is an UIBarButtonItem.

    Please let me know about this issue. If i must change something on my side or it's something different.

    Thanks!

    Your Environment

    • [X ] Version of the component: latest
    • [X ] Swift version: 3
    • [X ] iOS version: 10.2
    • [X ] Xcode version: 8.2.1 (8C1002)
    status: need feedback 
    opened by dcarriola 3
  • iPhone 6S leaning screen

    iPhone 6S leaning screen

    Hi !

    I have exactly the same problem than this : https://github.com/Yalantis/GuillotineMenu/issues/17

    But I use Xcode 8 and an iPhone 6S with iOS 10.1.1. The Example project works but I don't know why in my project it does not works. It stops after willStartPresentation.

    Thank you for your help !

    type: bug status: need feedback 
    opened by Darkkrye 3
  • Swift3

    Swift3

    Recently, I updated swift3 and Xcode 8. well, I'm not yet understanding whole error code, but some error appears on framework source code related to animation.

    type: enhancement 
    opened by XOneto9 3
  • How to manage multiple view controller through navigation items?

    How to manage multiple view controller through navigation items?

    I'm not sure the general pattern for selecting different items in navigation and may need some guides for that. I'm really excited with this framework.

    By the way, how to change default background color for GuillotineMenuViewController?

    opened by willowcheng 3
  • Use of unresolved identifier in ViewControllerTransitioningDelegate

    Use of unresolved identifier in ViewControllerTransitioningDelegate

    Report

    I copied the code from the example project and it won't run. The example project will run though. So Basically it is saying that there is errors of "use of unresolved identifier presentationAnimator and cellHeight.

    screen shot 2017-05-25 at 6 36 34 am

    As I said, the example project runs but not the copied code. I have included it in pod file and installed it and imported it.

    What can I do to resolve this?

    • [ ] Version of the component: commit 39f8585
    • [ ] Swift version: 3
    • [ ] iOS version: 10
    • [ ] Device: Simulator iPhone 6s
    • [ ] Xcode version: 8.3
    • [ ] If you use Cocoapods: _run pod env | pbcopy and no result
    • [ ] If you use Carthage: _run carthage version | pbcopy and carthage not installed
    status: invalid 
    opened by joshharington 2
Releases(3.0.2)
Owner
Yalantis
Knowledge is power and the way to get power is by sharing knowledge. We are open source because this is a smart way to live, work and play.
Yalantis
SwiftySideMenu is a lightweight and easy to use side menu controller to add left menu and center view controllers with scale animation based on Pop framework.

SwiftySideMenu SwiftySideMenu is a lightweight, fully customizable, and easy to use controller to add left menu and center view controllers with scale

Hossam Ghareeb 84 Feb 4, 2022
A Slide Menu, written in Swift, inspired by Slide Menu Material Design

Swift-Slide-Menu (Material Design Inspired) A Slide Menu, written in Swift 2, inspired by Navigation Drawer on Material Design (inspired by Google Mat

Boisney Philippe 90 Oct 17, 2020
Slide-Menu - A Simple Slide Menu With Swift

Slide Menu!! Весь интерфейс создан через код

Kirill 0 Jan 8, 2022
Menu controller with expandable item groups, custom position and appearance animation written with Swift. Similar to ActionSheet style of UIAlertController.

Easy to implement controller with expanding menu items. Design is very similar to iOS native ActionSheet presentation style of a UIAlertController. As

Anatoliy Voropay 22 Dec 27, 2022
EasyMenu - SwiftUI Menu but not only button (similar to the native Menu)

EasyMenu SwiftUI Menu but not only button (similar to the native Menu) You can c

null 10 Oct 7, 2022
Hamburger Menu Button - A hamburger menu button with full customization

Hamburger Menu Button A hamburger menu button with full customization. Inspired by VinhLe's idea on the Dribble How to use it You can config the looks

Toan Nguyen 114 Jun 12, 2022
An iOS drop down menu with pretty animation and easy to customize.

IGLDropDownMenu An iOS drop down menu with pretty animation. Screenshot How To Use Use CocoaPods: pod 'IGLDropDownMenu' Manual Install: Just drap the

Galvin Li 1.2k Dec 27, 2022
PopMenu is pop animation menu inspired by Sina weibo / NetEase app.

PopMenu PopMenu is pop animation menu inspired by Sina weibo / NetEase app. Screenshots Installation CocoaPods With CocoaPods, add this line to your P

曾宪华 898 Nov 14, 2022
Slide Menu (Drawer) in Swift

AKSwiftSlideMenu Slide Menu (Drawer) in Swift 5.0 Why to use a library everytime? Let's create our own Slide Menu in Swift 5.0 I have uploaded a video

Ashish Kakkad 281 Jan 5, 2023
⭕️ CircleMenu is a simple, elegant UI menu with a circular layout and material design animations. Swift UI library made by @Ramotion

CIRCLE MENU Simple, elegant UI menu with a circular layout and material design animations We specialize in the designing and coding of custom UI for M

Ramotion 3.4k Dec 29, 2022
A simple side menu for iOS written in Swift.

ENSwiftSideMenu A lightweight flyover side menu component for iOS with the UIDynamic's bouncing animation, UIGestures and UIBlurEffect. Allows you to

Evgeny Nazarov 1.8k Dec 21, 2022
iOS Interactive Side Menu written in Swift.

Interactive Side Menu A customizable, interactive, auto expanding and collapsing side menu for iOS written in Swift. Here are some of the ways Interac

Handsome 706 Dec 15, 2022
iOS Slide Menu View based on Google+, iQON, Feedly, Ameba iOS app. It is written in pure swift.

SlideMenuControllerSwift iOS Slide View based on iQON, Feedly, Google+, Ameba iPhone app. Installation CocoaPods pod 'SlideMenuControllerSwift' Carth

Yuji Hato 3.3k Dec 29, 2022
✨ Awesome Dropdown menu for iOS with Swift 5.0

The eligible dropdown menu for iOS, written in Swift 5, appears dropdown menu to display a view of related items when a user click on the dropdown menu. You can customize dropdown view whatever you like (e.g. UITableView, UICollectionView... etc)

Kyle Yi 1.3k Dec 26, 2022
RadialMenu is a custom control for providing a touch context menu (like iMessage recording in iOS 8) built with Swift & POP

RadialMenu Looking for help? For $150/hr I'll help with your RadialMenu problems including integrating it into your project. Email [email protected] t

Brad Jasper 297 Nov 27, 2022
The elegant yet functional dropdown menu, written in Swift, appears underneath the navigation bar to display a list of defined items when a user clicks on the navigation title.

Introduction The elegant yet functional dropdown menu, written in Swift, appears underneath the navigation bar to display a list of defined items when

Tho Pham 2.7k Dec 28, 2022
ExpandingMenu is menu button for iOS written in Swift.

ExpandingMenu ExpandingMenu is written in Swift. Requirements iOS 8.0+ Xcode 10.0+ Swift 3.x+ Installation CocoaPods You can install CocoaPods with th

null 454 Dec 7, 2022
Animated top menu for UITableView / UICollectionView / UIScrollView written in Swift

Persei Animated top menu for UITableView / UICollectionView / UIScrollView written in Swift! Made in Yalantis. Check this project on Dribbble Check th

Yalantis 3.4k Dec 14, 2022
A side menu controller written in Swift for iOS

Description SideMenuController is a custom container view controller written in Swift which will display the main content within a center panel and th

Teo 1.2k Dec 29, 2022