All Projects â†’ naoyashiga â†’ Rpmodalgesturetransition

naoyashiga / Rpmodalgesturetransition

Licence: mit
You can dismiss modal by using gesture 👆 📱

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Rpmodalgesturetransition

Marqueelabel
Charles Powell
Stars: ✭ 3,741 (+4056.67%)
Mutual labels:  ios-animation
Lottie Ios
An iOS library to natively render After Effects vector animations
Stars: ✭ 22,295 (+24672.22%)
Mutual labels:  ios-animation
Tkswitchercollection
An animation switch collection
Stars: ✭ 877 (+874.44%)
Mutual labels:  ios-animation
Mevhorizontalcontacts
An iOS UICollectionViewLayout subclass to show a list of contacts with configurable expandable items.
Stars: ✭ 358 (+297.78%)
Mutual labels:  ios-animation
Chromacolorpicker
🎨 An intuitive iOS color picker built in Swift.
Stars: ✭ 434 (+382.22%)
Mutual labels:  ios-animation
Pinterestsegment
A Pinterest-like segment control with masking animation.
Stars: ✭ 560 (+522.22%)
Mutual labels:  ios-animation
Mevfloatingbutton
An iOS drop-in UITableView, UICollectionView and UIScrollView superclass category for showing a customizable floating button on top of it.
Stars: ✭ 301 (+234.44%)
Mutual labels:  ios-animation
Loadingshimmer
An easy way to add a shimmering effect to any view with just one line of code. It is useful as an unobtrusive loading indicator.
Stars: ✭ 1,180 (+1211.11%)
Mutual labels:  ios-animation
Hero
Elegant transition library for iOS & tvOS
Stars: ✭ 20,547 (+22730%)
Mutual labels:  ios-animation
Cariocamenu
The fastest zero-tap iOS menu.
Stars: ✭ 785 (+772.22%)
Mutual labels:  ios-animation
Jthamburgerbutton
An animated hamburger button for iOS.
Stars: ✭ 358 (+297.78%)
Mutual labels:  ios-animation
Notificationbanner
The easiest way to display highly customizable in app notification banners in iOS
Stars: ✭ 4,307 (+4685.56%)
Mutual labels:  ios-animation
Iosproject
iOS project of collected some demos for iOS App, use Objective-C
Stars: ✭ 5,357 (+5852.22%)
Mutual labels:  ios-animation
React Native Dating App
Dating app - Exponent and React Native
Stars: ✭ 352 (+291.11%)
Mutual labels:  ios-animation
Lihalert
Advance animated alerts for iOS written in Swift
Stars: ✭ 34 (-62.22%)
Mutual labels:  ios-animation
Hotels
酒店预订App
Stars: ✭ 323 (+258.89%)
Mutual labels:  ios-animation
Awesome Ios Animation
A curated list of awesome iOS animation, including Objective-C and Swift libraries
Stars: ✭ 4,983 (+5436.67%)
Mutual labels:  ios-animation
Fsdairportfliplabel
UILabel like old Airport flipping labels
Stars: ✭ 79 (-12.22%)
Mutual labels:  ios-animation
Sizeslidebutton
A fun Swift UIControl for picking a size
Stars: ✭ 46 (-48.89%)
Mutual labels:  ios-animation
Macaw
Powerful and easy-to-use vector graphics Swift library with SVG support
Stars: ✭ 5,756 (+6295.56%)
Mutual labels:  ios-animation

RPModalGestureTransition


You can dismiss modal by using gesture.

Usage

1.Define animation

You define animator class inherits UIViewControllerAnimatedTransitioning. I made this in TransitionAnimator.swift.

2.Set UIViewControllerTransitioningDelegate to modal

import UIKit

extension ModalViewController: UIViewControllerTransitioningDelegate {

    func presentationControllerForPresentedViewController(presented: UIViewController, presentingViewController presenting: UIViewController, sourceViewController source: UIViewController) -> UIPresentationController? {

        return BackgroundPresentationController(presentedViewController: presented, presentingViewController: presenting)
    }

    func animationControllerForPresentedController(presented: UIViewController, presentingController presenting: UIViewController, sourceController source: UIViewController) -> UIViewControllerAnimatedTransitioning? {

        return TransitionAnimator(isPresenting: true)
    }

    func animationControllerForDismissedController(dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? {

        return TransitionAnimator(isPresenting: false)
    }

    func interactionControllerForPresentation(animator: UIViewControllerAnimatedTransitioning) -> UIViewControllerInteractiveTransitioning? {
        return nil
    }

    func interactionControllerForDismissal(animator: UIViewControllerAnimatedTransitioning) -> UIViewControllerInteractiveTransitioning? {
        guard let percentInteractiveTransition = percentInteractiveTransition else {
            return nil
        }
        
        return percentInteractiveTransition.isInteractiveDissmalTransition ? percentInteractiveTransition : nil
    }
}

3.Set InteractiveTransition to modal

Class InteractiveTransition inherits UIPercentDrivenInteractiveTransition.

class ModalViewController: UIViewController {
    
    var percentInteractiveTransition: InteractiveTransition?
    
    override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?) {
        super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
        
        modalPresentationStyle = .Custom
        transitioningDelegate = self
        
        percentInteractiveTransition = InteractiveTransition(attachedViewController: self)
    }

4.Define interactive animation

You have to define how animation change with gesture. You check InteractiveTransition.swift.

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].