Reusable iOS's behavior drag or swipe to pop ViewController

Overview

DLSwipeToPopController

Reusable iOS's behavior to pop ViewController base on SwipeRightToPopController:

  • Swipe from Right to Left to pop ViewController.
    • Customize base on velocity
  • Drag from Right to Left to pop ViewController.
    • Customize base on percent of distance with the screen width

Requirements

  • Xcode 11+
  • Swift 5.0+

Installing

There are three ways to install DLSwipeToPopController

1. CocoaPods

Just add to your project's Podfile:

pod 'DLSwipeToPopController', '~> 1.0'

2. Carthage

Add following to Cartfile:

1.0 ">
github "lengocduy/DLSwipeToPopController" ~> 1.0

3. Swift Package Manager

Create a Package.swift file:

// swift-tools-version:5.0

import PackageDescription

let package = Package(
        name: "TestSwipeToPopController",

        dependencies: [
            .package(url: "https://github.com/lengocduy/DLSwipeToPopController.git", from: "1.0.0"),
        ],

        targets: [
            .target(
                    name: "TestSwipeToPopController",
                    dependencies: ["DLSwipeToPopController"])
        ]
)

Architecture

Architecture

License

DLSwipeToPopController is available under the MIT license. See the LICENSE file for more info.

You might also like...
An opinionated starting point for awesome, reusable Swift 5 modules

Swift 5 Module Template Use this template as a starting point for any Swift 5 module that you want other people to include in their projects. STATUS:

Freddy - A reusable framework for parsing JSON in Swift.
Freddy - A reusable framework for parsing JSON in Swift.

Why Freddy? Parsing JSON elegantly and safely can be hard, but Freddy is here to help. Freddy is a reusable framework for parsing JSON in Swift. It ha

A custom reusable circular / progress slider control for iOS application.
A custom reusable circular / progress slider control for iOS application.

HGCircularSlider Example To run the example project, clone the repo, and run pod install from the Example directory first. You also may like HGPlaceho

Declarative, configurable & highly reusable UI development as making Lego bricks.
Declarative, configurable & highly reusable UI development as making Lego bricks.

LeeGo is a lightweight Swift framework that helps you decouple & modularise your UI component into small pieces of LEGO style's bricks, to make UI dev

UIPheonix is a super easy, flexible, dynamic and highly scalable UI framework + concept for building reusable component/control-driven apps for macOS, iOS and tvOS
UIPheonix is a super easy, flexible, dynamic and highly scalable UI framework + concept for building reusable component/control-driven apps for macOS, iOS and tvOS

UIPheonix is a super easy, flexible, dynamic and highly scalable UI framework + concept for building reusable component/control-driven apps for macOS, iOS and tvOS

All the reusable code that we need in each project

SwiftyUtils SwiftyUtils groups all the reusable code that we need to ship in each project. This framework contains: Extensions Protocols Structs Subcl

A reusable Slider View made with SwiftUI
A reusable Slider View made with SwiftUI

ZSlider A reusable Slider View made with SwiftUI. Installation: Minimum version iOS 13 In Xcode go to File - Swift Packages - Add Package Dependency

This little app aims to help teach me how to implement more then one API in one single application in a reusable and properly structured manner.

LilAPI App News & Weather This little API app combines two of Jordan Singers Lil Software API's into one app. The goal with this app was to learn how

Reusable & customizable SwiftUI settings sheet as a Swift package

PackAPrefPane Reusable & customizable SwiftUI settings sheet as a Swift package Features Swift package 100% Swift 99% SwiftUI Simple design Lightweigh

Cluster's reusable pre-permissions utility that lets developers ask the users on their own dialog for photos or contacts access, before making the system-based request.
Cluster's reusable pre-permissions utility that lets developers ask the users on their own dialog for photos or contacts access, before making the system-based request.

Cluster's reusable pre-permissions utility that lets developers ask the users on their own dialog for photos or contacts access, before making the system-based request. This is based on the Medium post by Cluster describing the different ways to ask for iOS permissions (https://medium.com/p/96fa4eb54f2c).

A custom reusable slider control with 2 thumbs (range slider).
A custom reusable slider control with 2 thumbs (range slider).

MARKRangeSlider A custom reusable slider control with 2 thumbs (range slider). Values range is between minimumValue and maximumValue (from 0 to 1 by d

A custom reusable circular / progress slider control for iOS application.
A custom reusable circular / progress slider control for iOS application.

HGCircularSlider Example To run the example project, clone the repo, and run pod install from the Example directory first. You also may like HGPlaceho

A generic small reusable components for data source implementation for UITableView/UICollectionView in Swift.
A generic small reusable components for data source implementation for UITableView/UICollectionView in Swift.

GenericDataSource A generic small reusable components for data source implementation for UITableView/UICollectionView written in Swift. Features Basic

All the reusable code that we need in each project

SwiftyUtils SwiftyUtils groups all the reusable code that we need to ship in each project. This framework contains: Extensions Protocols Structs Subcl

An opinionated starting point for awesome, reusable Swift 5 modules

Swift 5 Module Template Use this template as a starting point for any Swift 5 module that you want other people to include in their projects. STATUS:

CustomReusableComponentWithLazyVar - Custom Reusable Component With LazyVar
CustomReusableComponentWithLazyVar - Custom Reusable Component With LazyVar

Custom Reusable Component With LazyVar Vista creada con: Programmatically + Auto

SwiftUI components and extensions that seem to be highly reusable

SwiftUI components and extensions that seem to be highly reusable

Reusable GridView with excellent performance and customization that can be time table, spreadsheet,  paging and more.
Reusable GridView with excellent performance and customization that can be time table, spreadsheet, paging and more.

GridView GridView can tile the view while reusing it. It has an API like UIKit that works fast. Even when device rotates it smoothly relayout. Appetiz

A custom ImageView that is used to cover the surface of other view like a scratch card, user can swipe the mulch to see the view below.
A custom ImageView that is used to cover the surface of other view like a scratch card, user can swipe the mulch to see the view below.

MCScratchImageView GIF Showcase Requirments iOS 8.0+ Xcode 7.2+ Swift 4.0 Installation CocoaPods pod "MCScratchImageView" Manually Just drag MCScratch

Releases(v1.1.4)
  • v1.1.4(Dec 13, 2021)

  • v1.1.3(Dec 9, 2021)

  • v1.1.2(Dec 8, 2021)

  • v1.1.1(Nov 13, 2021)

  • v1.1.0(Nov 9, 2021)

    • Support configuration for maximum of vertical distance (coordinate y) maximumOfVerticalDistance
      • Only recognize the gesture when user drag of swipe in the range of this property's value
      • In the case vertical distance larger than the configured value. It will skip recognizing and delegate for other components in the chain
    Source code(tar.gz)
    Source code(zip)
  • v1.0.0(Oct 31, 2021)

    • Swipe from Right to Left to pop ViewController
      • Customize via velocity when swipe gesture was recognized
    • Drag from Right to Left to pop ViewController
      • Customize via percent distance move per screen's width
    • Built-in Controllers: SwipeToPopViewController & SwipeToPopTableViewController
    Source code(tar.gz)
    Source code(zip)
Owner
Le Ngoc Duy
Try to make everything simple if we can
Le Ngoc Duy
A generic small reusable components for data source implementation for UITableView/UICollectionView in Swift.

GenericDataSource A generic small reusable components for data source implementation for UITableView/UICollectionView written in Swift. Features Basic

null 132 Sep 8, 2021
This component allows for the transfer of data items between collection views through drag and drop

Drag and Drop Collection Views Written for Swift 4.0, it is an implementation of Dragging and Dropping data across multiple UICollectionViews. Try it

Michael Michailidis 508 Dec 19, 2022
Allows trendy transitions using swipe gesture such as "swipe back anywhere".

SwipeTransition allows trendy transitions using swipe gesture such as "swipe back". Try the demo on the web (appetize.io): https://appetize.io/app/peb

Tatsuya Tanaka 294 Dec 27, 2022
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
Present a sheet ViewController easily and control ViewController height with pangesture

PanControllerHeight is designed to present a sheet ViewController easily and control ViewController height with pangesture.

null 2 May 3, 2022
Codable, but with Super power made custom Codable behavior easy.

Codable, but with Super power made custom Codable behavior easy.

Tsungyu Yu 24 Aug 30, 2022
A custom paging behavior that peeks the previous and next items in a collection view

MSPeekCollectionViewDelegateImplementation Version 3.0.0 is here! ?? The peeking logic is now done using a custom UICollectionViewLayout which makes i

Maher Santina 353 Dec 16, 2022
Simple app install/update behavior detection.

App-Update-Tracker AppUpdateTracker is a simple, lightweight iOS library intended to determine basic app install/update behavior. The following is a l

Aaron 25 Dec 13, 2022
UIWindow subclass to enable behavior like adaptive round-corners & detecting when Control Center is opened.

UIWindow subclass to enable behavior like adaptive round-corners & detecting when Control Center is opened.

Aaron Abentheuer 481 Jul 28, 2022
TestKit has been upgraded to a full solution for implementing Behavior-Driven Development (BDD) in Swift iOS apps.

The easiest way to implement full BDD in your Swift iOS projects! Use plain English specs (Gherkin) to drive tests that include both UI automation and interacting with application data & state.

Daniel Hall 11 Sep 14, 2022