All Projects → Yalantis → Guillotinemenu

Yalantis / Guillotinemenu

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

Programming Languages

swift
15916 projects
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Guillotinemenu

Pulltorefresh
This component implements pure pull-to-refresh logic and you can use it for developing your own pull-to-refresh animations
Stars: ✭ 1,150 (-60.45%)
Mutual labels:  cocoapods, yalantis
Pull To Refresh.rentals Ios
This project aims to provide a simple and customizable pull to refresh implementation. Made in Yalantis
Stars: ✭ 2,171 (-25.34%)
Mutual labels:  cocoapods, yalantis
Colormatchtabs
This is a Review posting app that let user find interesting places near them
Stars: ✭ 1,341 (-53.89%)
Mutual labels:  cocoapods, yalantis
Forceblur
ForceBlur Animation for iOS Messaging Apps
Stars: ✭ 666 (-77.1%)
Mutual labels:  cocoapods, yalantis
Jsonhelper
✌ Convert anything into anything in one operation; JSON data into class instances, hex strings into UIColor/NSColor, y/n strings to booleans, arrays and dictionaries of these; anything you can make sense of!
Stars: ✭ 792 (-72.76%)
Mutual labels:  protocol, cocoapods
Preloader.ophiuchus
Custom Label to apply animations on whole text or letters.
Stars: ✭ 880 (-69.74%)
Mutual labels:  cocoapods, yalantis
Displayswitcher
Custom transition between two collection view layouts
Stars: ✭ 2,253 (-22.52%)
Mutual labels:  cocoapods, yalantis
Fittrack
Concept of a fitness app.
Stars: ✭ 165 (-94.33%)
Mutual labels:  cocoapods, yalantis
Foldingtabbar.ios
Folding Tab Bar and Tab Bar Controller
Stars: ✭ 3,677 (+26.44%)
Mutual labels:  protocol, cocoapods
Segmentio
Animated top/bottom segmented control written in Swift.
Stars: ✭ 2,310 (-20.56%)
Mutual labels:  cocoapods, yalantis
Koloda
KolodaView is a class designed to simplify the implementation of Tinder like cards on iOS.
Stars: ✭ 4,998 (+71.87%)
Mutual labels:  cocoapods, yalantis
Randomkit
Random data generation in Swift
Stars: ✭ 1,458 (-49.86%)
Mutual labels:  protocol, cocoapods
Yalfield
Custom Field component with validation for creating easier form-like UI from interface builder.
Stars: ✭ 476 (-83.63%)
Mutual labels:  cocoapods, yalantis
Transitionbutton
UIButton sublass for loading and transition animation.
Stars: ✭ 1,124 (-61.35%)
Mutual labels:  cocoapods, transition-animation
Starwars.ios
This component implements transition animation to crumble view-controller into tiny pieces.
Stars: ✭ 3,685 (+26.72%)
Mutual labels:  transition-animation, yalantis
Imagetransition
Library for smooth animation of images during transitions.
Stars: ✭ 195 (-93.29%)
Mutual labels:  cocoapods, transition-animation
Cuckoo
Boilerplate-free mocking framework for Swift!
Stars: ✭ 1,344 (-53.78%)
Mutual labels:  protocol, cocoapods
Abexpandableview
Expandable, collapsible, filterable and single/multi selectable table view.
Stars: ✭ 138 (-95.25%)
Mutual labels:  protocol, cocoapods
Ipfs Desktop
An unobtrusive and user-friendly desktop application for IPFS on Windows, Mac and Linux.
Stars: ✭ 3,710 (+27.58%)
Mutual labels:  protocol
Go Cyber
Your 🔵 Superintelligence
Stars: ✭ 270 (-90.72%)
Mutual labels:  protocol

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.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].