Allows trendy transitions using swipe gesture such as "swipe back anywhere".

Overview

logotype-a

Build Status Carthage compatible pods Platform Swift Version Objective-C compatible

SwipeTransition allows trendy transitions using swipe gesture such as "swipe back".

Demo

Try the demo on the web (appetize.io): https://appetize.io/app/pebm8kveqhfj3wn204adn0xu8r

Features

  • Swipe back anywhere.
  • Swipe to dismiss anywhere.
  • Apply to all view controllers automatically!
  • No conflict of gestures on UIScrollView, UITableView, UICollectionView and so on.

Requirements

  • Xcode 10.2 (10.0+)
  • Swift 5 (4.2+)
  • iOS 8.0+

Installation

Carthage

github "tattn/SwipeTransition"

CocoaPods

pod "SwipeTransition"
pod "SwipeTransitionAutoSwipeBack"      # if needed
pod "SwipeTransitionAutoSwipeToDismiss" # if needed

Usage

The easiest way to use

Just setting these frameworks in the Linked Frameworks and Libraries, it works. (if you use Carthage)

Linked Frameworks and Libraries

Notes: these frameworks use Method Swizzling.

If you want to set up manually without Method Swizzling, please use SwipeTransition.framework only.

Manually set up

Notes: if you use `AutoSwipeBack.framework`, these are unnecessary.

Just use SwipeBackNavigationController instead of UINavigationController. Of course, you can set it with Interface Builder.

let viewController = UIViewController()
let navigationController = SwipeBackNavigationController(rootViewControlelr: viewController)

Another way is to set swipeBack.

class CustomNavigationController: UINavigationController {
    override func viewDidLoad() {
        super.viewDidLoad()
        swipeBack = SwipeBackController(navigationController: self)
    }
}
Notes: if you use `AutoSwipeToDismiss.framework`, these are unnecessary.

Just use SwipeToDismissNavigationController instead of UINavigationController. Of course, you can set it with Interface Builder.

let viewController = UIViewController()
let navigationController = SwipeToDismissNavigationController(rootViewControlelr: viewController)

Another way is to set swipeToDismiss.

class CustomNavigationController: UINavigationController {
    override func viewDidLoad() {
        super.viewDidLoad()
        modalPresentationStyle = .fullScreen
        swipeToDismiss = SwipeToDismissController(viewController: self)
    }
}

Enable/Disable gestures

Use isEnabled property.

self.navigationController?.swipeBack?.isEnabled = false
self.swipeToDismiss?.isEnabled = false

Configuration

You can also change the behavior such as animation.

SwipeBackConfiguration.shared.parallaxFactor = 0.6

SwipeToDismissConfiguration.shared.dismissHeightRatio = 0.5

Inheriting the configure class, you can set it with computed property.

class CustomSwipeBackConfiguration: SwipeBackConfiguration {
    override var transitionDuration: TimeInterval {
        get { return 1.5 }
        set { super.transitionDuration = newValue }
    }
}

SwipeBackConfiguration.shared = CustomSwipeBackConfiguration()

Other usage

See this wiki

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

Support this project

Donating to help me continue working on this project.

Donate

ToDo

  • All .modalPresentationStyle support
  • Animation support (fade / custom)
  • Some transition styles support (e.g. right to left swipe transition)

License

SwipeTransition is released under the MIT license. See LICENSE for details.

Comments
  • Logo Design Proposal

    Logo Design Proposal

    Greetings Sir @tattn , I am a graphics designer and i passed by your nice project and i noticed it doesn't have a logo yet. I want to propose a logo design for it as a gift for free, if you will give me permission i will start immediately and show you here. Thanks and best regards! - tobaloidee

    opened by Tobaloidee 7
  • Weird behavior since August update

    Weird behavior since August update

    Hi & thanks for the good work I've been using for some time :)

    Just updated my cocoapods and now the swipe to go back move does not really work anymore:

    • slow, reactive, swipe does not work (ie controlling the animation with your finger)
    • only thing that work is that if i do a quick swipe at the center of the screen, I still go back. But I cannot control the animation with my finger This results in a pretty bad user experience.

    Any idea how to fix this?

    Thanks

    Some details on my setup:

    • My project is written is swift
    • I use SwipeTransitionAutoSwipeBack in my linked frameworks to setup everything automatically
    • The view from which I need to swipe back contains a WKWebBrowser
    opened by A1exandre 3
  • Some change in animation and allowsTransitionFinish function

    Some change in animation and allowsTransitionFinish function

    I've made some change in animation pop, change to .easeInOut, like standard animation type of iOS when push and pop. And some change in method allowsTransitionFinish for finish transition if drag more than 50% of screen width or velocity is higher than 1000. Hope this help. @tattn

    opened by vandat0599 2
  • Bump kramdown from 2.1.0 to 2.3.0

    Bump kramdown from 2.1.0 to 2.3.0

    Bumps kramdown from 2.1.0 to 2.3.0.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 2
  • Remove UIWebview reference. Deprecated

    Remove UIWebview reference. Deprecated

    Description

    UIWebview is deprecated. ITMS-90809: Deprecated API Usage - Apple will stop accepting submissions of apps that use UIWebView APIs . See documentation for more information.

    Fixes

    Remove reference to UIWebview

    opened by abllogra 2
  • Objective-c support

    Objective-c support

    I'm trying to disable the pull to dismiss in some VCs, but can't find the property swipeToDismiss

    #import <SwipeTransition/SwipeTransition-Swift.h>
    
    - (void)viewDidLoad {
        [super viewDidLoad];
        self.swipeToDismiss.isEnabled = NO;
        ...
    }
    

    All screens are working without any code typed. But i need to disable in some of them.

    Is swipeToDismiss to disable the pull down, right?

    captura de tela 2018-03-27 as 23 52 35
    opened by CavalcanteLeo 2
  • Bump kramdown from 2.3.0 to 2.3.1

    Bump kramdown from 2.3.0 to 2.3.1

    Bumps kramdown from 2.3.0 to 2.3.1.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 1
  • UISlider stops working

    UISlider stops working

    Hello! I have UISlider inside view controller and interactive pop gesture enabled. When I try to drag thumb right it ignores finger movement and pop gesture occurres.

    opened by shmakovigor 1
  • Objective-c support stoped work after swift 4.2

    Objective-c support stoped work after swift 4.2

    I cant access the property isEnabled anymore

    before i had to use #import <SwipeTransition/SwipeTransition-Swift.h>, but not, xcode cant find it, instead i have access to #import <SwipeTransition/SwipeTransition.h>

    captura de tela 2018-09-20 as 13 40 11

    opened by CavalcanteLeo 1
  • formSheet crash

    formSheet crash

    let viewController = ViewController() viewController.modalPresentationStyle = .formSheet viewController.popoverPresentationController?.sourceView = view present(viewController, animated: true, completion: nil)

    In case of screen transition, swipe the crash of the navigation bar

    opened by Silent404 1
  • Keep crashing

    Keep crashing

    I tried below code

    let settingHomeNC = UINavigationController(rootViewController: settingHomeVC)
            settingHomeNC.swipeToDismiss = SwipeToDismissController()
            present(settingHomeNC, animated: true, completion: nil)
    

    and this

    let settingHomeNC = SwipeToDismissNavigationController(rootViewController: settingHomeVC)
            present(settingHomeNC, animated: true, completion: nil)
    

    It works sometimes but then starts crashing after pod update every time.

    opened by BluePick 1
  • navigationItem title do not run animation like normal

    navigationItem title do not run animation like normal

    Hi, I am using swipe transition But I realize the animation of navigation title do not run from left to right like normal. It only animator alpha. Can I change this? Thank

    opened by BigVeila 0
  • Swift Package Manager support

    Swift Package Manager support

    This doesn't work perfectly - it looks like the Automation target has an error when running swift build.

    It works for the SwipeTransition framework though, and has made it so I can target my branch as a dependency in my app. I might look to fix this in a few weeks, but if someone else would like to commandeer this and finish what I started, please feel free!

    opened by AndrewSB 3
  • Ambiguous use of 'swipeBack'

    Ambiguous use of 'swipeBack'

    Sorry if I'm asking a dumb question, as I'm a beginner developer. My code was working well before, but After I updated my XCode to 12, it fails to build saying

    Ambiguous use of 'swipeBack'

    On

    self.navigationController?.swipeBack?.isEnabled = false

    2020-09-27_00-46-42

    Any advise will be appreciated. thank you

    opened by Jeminaa 0
  • Setting swipe edge size

    Setting swipe edge size

    Are there any way to set edge size for swipeToDismiss swipe reaction? For example for swipe from left to right i want to dismiss only when swipe begins from left part of screen, not from whole screen. Is it possible now?

    opened by bios90 0
Releases(0.5.0)
Owner
Tatsuya Tanaka
https://twitter.com/tanakasan2525 https://qiita.com/tattn https://zenn.dev/tattn
Tatsuya Tanaka
Library for smooth animation of images during transitions.

ImageTransition ImageTransition is a library for smooth animation of images during transitions. Something looks like below: e.g. UIImageView e.g. UIIm

shtnkgm 207 Dec 3, 2022
🌊 - Jelly is a library for animated, non-interactive & interactive viewcontroller transitions and presentations with the focus on a simple and yet flexible API.

Jelly is a library for animated, non-interactive & interactive viewcontroller transitions and presentations with the focus on a simple and yet flexibl

Sebastian Boldt 2.4k Dec 25, 2022
SamuraiTransition is an open source Swift based library providing a collection of ViewController transitions featuring a number of neat “cutting” animations.

SamuraiTransiton is a ViewController transition framework in Swift. It is an animation as if Samurai cut out the screen with a sword. transition types

hachinobu 273 Dec 29, 2022
Easy interactive interruptible custom ViewController transitions

Introduction Transition is a library that helps you build iOS view controller transitions. Implementing a nice interactive custom view controller tran

Touchwonders 2.6k Dec 20, 2022
The Art World in Your Pocket or Your Trendy Tech Company's Tote, Artsy's mobile app.

Meta State: production Point People: Brian Beckerle, Mounir Dhahri, Pavlos Vinieratos CI : This is an Artsy OSS project. Other mobile projects are Ene

Artsy 3.2k Jan 4, 2023
AlertTransition is a extensible library for making view controller transitions, especially for alert transitions.

AlertTransition AlertTransition is a extensible library for making view controller transitions, especially for alert transitions. Overview AlertTransi

Loopeer 570 Nov 29, 2022
Simple example of view that appears on tap button and dismiss with swipe gesture.

MenuWithSlide Simple SwiftUI example of how to show side menu with slide effect. On button press - appeares, on background tap or swipe right - dissmi

Evgeny 1 Nov 29, 2021
TextDrawer, is a UIView allows you to add text, with gesture, on UIView, or UIImage

TextDrawer TextDrawer, is a UIView allows you to add text, with gesture, on UIView, or UIImage. About Annotating Images TextDrawer is the easiest way

Remi ROBERT 106 Dec 18, 2022
An easy to use UITableViewCell subclass that allows to display swippable buttons with a variety of transitions.

MGSwipeTableCell MGSwipeTableCell is an easy to use UITableViewCell subclass that allows to display swipeable buttons with a variety of transitions. T

Imanol Fernandez 7k Dec 26, 2022
The Effects Library allows developers to create sophisticated and realistic particle systems such as snow, fire, rain, confetti, fireworks, and smoke with no or minimal effort.

The Effects Library allows developers to create sophisticated and realistic particle systems such as snow, fire, rain, confetti, fireworks, and smoke with no or minimal effort.

Stream 182 Jan 6, 2023
Allows a swipe on any part of the screen to start an interruptible pop animation to the previous view

Lazy Pop SwiftUI Swiping on any part of the screen starts an interruptible pop animation to the previous view. Forked from https://github.com/rishi420

Joe Hinkle 150 Dec 18, 2022
🃏 Cardslider is a design UI controller that allows you to swipe through cards with pictures and accompanying descriptions.

CARD SLIDER UI controller that allows you to swipe through cards with pictures. We specialize in the designing and coding of custom UI for Mobile Apps

Ramotion 1.2k Dec 19, 2022
PinpointKit is an open-source iOS library in Swift that lets your testers and users send feedback with annotated screenshots using a simple gesture.

PinpointKit is an open-source iOS library in Swift that lets your testers and users send feedback with annotated screenshots using a simple gesture. F

Lickability 1.1k Jan 6, 2023
Hand-gesture recognition on iOS app using CoreML

GestureAI-CoreML-iOS Hand-gesture recognizer using CoreML Demo Screenshots This app is using RNN(Recurrent Neural network) with CoreML on iOS11. The m

null 151 Nov 2, 2022
You can dismiss modal by using gesture

RPModalGestureTransition You can dismiss modal by using gesture. Usage 1.Define animation You define animator class inherits UIViewControllerAnimatedT

Naoya Sugimoto 90 Apr 21, 2020
Swift interpolation for gesture-driven animations

Interpolate Interpolate is a powerful Swift interpolation framework for creating interactive gesture-driven animations. Usage The ?? idea of Interpola

Roy Marmelstein 1.8k Dec 20, 2022
Image slide-show viewer with multiple predefined transition styles, with ability to create new transitions with ease.

ATGMediaBrowser ATGMediaBrowser is an image slide-show viewer that supports multiple predefined transition styles, and also allows the client to defin

null 200 Dec 19, 2022