Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/horitaku46/blowinswiper
BlowinSwiper makes it possible to swipe back from anywhere on the screen.
https://github.com/horitaku46/blowinswiper
carthage cocoapods pop swift swift4 swipe swipeback uinavigationcontroller
Last synced: 2 months ago
JSON representation
BlowinSwiper makes it possible to swipe back from anywhere on the screen.
- Host: GitHub
- URL: https://github.com/horitaku46/blowinswiper
- Owner: horitaku46
- License: mit
- Created: 2018-02-02T14:22:13.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2020-10-15T23:07:57.000Z (about 4 years ago)
- Last Synced: 2024-09-29T22:21:49.686Z (3 months ago)
- Topics: carthage, cocoapods, pop, swift, swift4, swipe, swipeback, uinavigationcontroller
- Language: Swift
- Homepage:
- Size: 600 KB
- Stars: 48
- Watchers: 4
- Forks: 5
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Platform](http://img.shields.io/badge/platform-iOS-blue.svg?style=flat)](https://developer.apple.com/iphone/index.action)
![Swift](https://img.shields.io/badge/Swift-4.0-orange.svg)
[![Cocoapods](https://img.shields.io/badge/Cocoapods-compatible-brightgreen.svg)](https://img.shields.io/badge/Cocoapods-compatible-brightgreen.svg)
[![Carthage compatible](https://img.shields.io/badge/Carthage-Compatible-brightgreen.svg?style=flat)](https://github.com/Carthage/Carthage)
[![License](http://img.shields.io/badge/license-MIT-lightgrey.svg?style=flat)](http://mit-license.org)## 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](https://github.com/yysskk/SwipeMenuViewController).- Support iPhone, iPad and iPhone X! 🎉
## Translation
Mr. [Gargo](https://github.com/Gargo) translated [this README into Russian](http://gargo.of.by/blowinswiper/)!🙇♂️## Requirements
- Xcode 9.0+
- iOS 10+
- Swift 4.0+## Installation
### CocoaPods
```ruby
pod 'BlowinSwiper'
```
### Carthage
```ruby
github "horitaku46/BlowinSwiper"
```## Usage
**See [Example](https://github.com/horitaku46/BlowinSwiper/tree/master/Example), for more details.**### Normal
**《1》** Please add `UIGestureRecognizerDelegate` to `UINavigationController`. Because to enable edge swipe back.```swift
import UIKitfinal 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`.
```swift
import UIKitfinal 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`.```swift
import UIKitfinal 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
- [Facebook](https://www.facebook.com/profile.php?id=100008388074028)
- [Twitter](https://twitter.com/horitaku_)
- [GitHub](https://github.com/horitaku46)## License
`BlowinSwiper` is available under the MIT license. See the [LICENSE](./LICENSE) file for more info.