Awesome Open Source
Awesome Open Source

Platform Swift Cocoapods Carthage compatible License

Overview

BlowinSwiper makes it possible to swipe back from anywhere on the screen at UINavigationController!
I developed BlowinSwiper for handling with various gestures. But only right swipe...

Features

In this library, I considered what to do the handling of the horizontal scroll. It is like a search screen on Twitter Client App.
It is the screen on the right. Sample is thinking about handling with SwipeMenuViewController.

  • Support iPhone, iPad and iPhone X! 🎉








Translation

Mr. Gargo translated this README into Russian!🙇‍♂️

Requirements

  • Xcode 9.0+
  • iOS 10+
  • Swift 4.0+

Installation

CocoaPods

pod 'BlowinSwiper'

Carthage

github "horitaku46/BlowinSwiper"

Usage

See Example, for more details.

Normal

《1》 Please add UIGestureRecognizerDelegate to UINavigationController. Because to enable edge swipe back.

import UIKit

final class NavigationController: UINavigationController {
    override func viewDidLoad() {
        super.viewDidLoad()
        interactivePopGestureRecognizer?.delegate = self
    }
}

extension NavigationController: UIGestureRecognizerDelegate {
    func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer,
                           shouldBeRequiredToFailBy otherGestureRecognizer: UIGestureRecognizer) -> Bool {
        return true
    }
}

《2》 Please set BlowinSwipeable to UIViewController, and set configureSwipeBack() to viewDidAppear.

import UIKit

final class ViewController: UIViewController, BlowinSwipeable {

    var blowinSwiper: BlowinSwiper?

    override func viewDidAppear(_ animated: Bool) {
        super.viewDidAppear(animated)
        configureSwipeBack()
    }
}

Horizontal scroll handling

《1》 Please do 《1》 of Normal.
《2》 Please refer to the following source code.
Set BlowinSwipeable to UIViewController.
Set configureSwipeBack(isLowSensitivity: true) and enabledRecognizeSimultaneously(scrollView: swipeMenuView.contentScrollView) to viewDidAppear.
Set disabledRecognizeSimultaneously() to viewDidDisappear.

import UIKit

final class ViewController: UIViewController, BlowinSwipeable {

    var blowinSwiper: BlowinSwiper?

    override func viewDidAppear(_ animated: Bool) {
        super.viewDidAppear(animated)
        configureSwipeBack(isInsensitive: true)
        enabledRecognizeSimultaneously(scrollView: swipeMenuView.contentScrollView)
    }

    override func viewDidDisappear(_ animated: Bool) {
        super.viewDidDisappear(animated)
        disabledRecognizeSimultaneously()
    }
}

extension MenuViewController: SwipeMenuViewDelegate {
    func swipeMenuViewDidScroll(_ contentScrollView: UIScrollView) { // added itself to this delegate.
        handleScrollRecognizeSimultaneously(scrollView: contentScrollView)
    }
}

Author

Takuma Horiuchi

License

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


Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Swift (95,541) 
Cocoapods (1,974) 
Swift4 (1,488) 
Carthage (817) 
Swipe (300) 
Pop (138) 
Related Projects
Advertising 📦 9
All Projects
Application Programming Interfaces 📦 120
Applications 📦 181
Artificial Intelligence 📦 72
Blockchain 📦 70
Build Tools 📦 111
Cloud Computing 📦 79
Code Quality 📦 28
Collaboration 📦 30
Command Line Interface 📦 48
Community 📦 81
Companies 📦 60
Compilers 📦 60
Computer Science 📦 74
Configuration Management 📦 39
Content Management 📦 167
Control Flow 📦 197
Data Formats 📦 77
Data Processing 📦 266
Data Storage 📦 132
Economics 📦 60
Frameworks 📦 198
Games 📦 122
Graphics 📦 103
Hardware 📦 148
Integrated Development Environments 📦 47
Learning Resources 📦 147
Legal 📦 28
Libraries 📦 119
Lists Of Projects 📦 21
Machine Learning 📦 336
Mapping 📦 61
Marketing 📦 15
Mathematics 📦 55
Media 📦 228
Messaging 📦 97
Networking 📦 304
Operating Systems 📦 84
Operations 📦 120
Package Managers 📦 52
Programming Languages 📦 229
Runtime Environments 📦 96
Science 📦 42
Security 📦 375
Social Media 📦 26
Software Architecture 📦 70
Software Development 📦 68
Software Performance 📦 57
Software Quality 📦 127
Text Editors 📦 45
Text Processing 📦 131
User Interface 📦 310
User Interface Components 📦 465
Version Control 📦 29
Virtualization 📦 68
Web Browsers 📦 38
Web Servers 📦 25
Web User Interface 📦 194