Latest1.0.14
Homepagehttps://github.com/horitaku46/BlowinSwiper
LicenseMIT
Platformsios 10.0
Authors

BlowinSwiper

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…

BlowinSwiperBlowinSwiper

Features

BlowinSwiper

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! 🎉

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.

Latest podspec

{
    "name": "BlowinSwiper",
    "version": "1.0.14",
    "summary": "BlowinSwiper makes it possible to swipe back from anywhere on the screen.",
    "description": "BlowinSwiper makes it possible to swipe back from anywhere on the screen at UINavigationController!",
    "homepage": "https://github.com/horitaku46/BlowinSwiper",
    "license": {
        "type": "MIT",
        "file": "./LICENSE"
    },
    "authors": {
        "Takuma Horiuchi": "[email protected]"
    },
    "social_media_url": "https://twitter.com/horitaku46",
    "platforms": {
        "ios": "10.0"
    },
    "source": {
        "git": "https://github.com/horitaku46/BlowinSwiper.git",
        "tag": "1.0.14"
    },
    "source_files": "BlowinSwiper/**/*.{swift}",
    "swift_version": "4.0"
}

Pin It on Pinterest

Share This