All Projects → sgr-ksmt → Pulltodismiss

sgr-ksmt / Pulltodismiss

Licence: mit
You can dismiss modal viewcontroller like Facebook Messenger by pulling scrollview or navigationbar in Swift.

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Pulltodismiss

Koyomi
Simple customizable calendar component in Swift 📆
Stars: ✭ 716 (+57.02%)
Mutual labels:  swift-framework, cocoapods, carthage
Swiftinstagram
Instagram API client written in Swift
Stars: ✭ 570 (+25%)
Mutual labels:  swift-framework, cocoapods, carthage
Bluecap
iOS Bluetooth LE framework
Stars: ✭ 669 (+46.71%)
Mutual labels:  swift-framework, cocoapods, carthage
Swiftlyext
SwiftlyExt is a collection of useful extensions for Swift 3 standard classes and types 🚀
Stars: ✭ 31 (-93.2%)
Mutual labels:  swift-framework, cocoapods, carthage
Loadingshimmer
An easy way to add a shimmering effect to any view with just one line of code. It is useful as an unobtrusive loading indicator.
Stars: ✭ 1,180 (+158.77%)
Mutual labels:  swift-framework, cocoapods, carthage
L10n Swift
Localization of the application with ability to change language "on the fly" and support for plural form in any language.
Stars: ✭ 177 (-61.18%)
Mutual labels:  swift-framework, cocoapods, carthage
Contentful.swift
A delightful Swift interface to Contentful's content delivery API.
Stars: ✭ 132 (-71.05%)
Mutual labels:  swift-framework, cocoapods, carthage
Xcglogger
A debug log framework for use in Swift projects. Allows you to log details to the console (and optionally a file), just like you would have with NSLog() or print(), but with additional information, such as the date, function name, filename and line number.
Stars: ✭ 3,710 (+713.6%)
Mutual labels:  swift-framework, cocoapods, carthage
Stepslider
StepSlider its custom implementation of slider such as UISlider for preset integer values.
Stars: ✭ 391 (-14.25%)
Mutual labels:  cocoapods, carthage
Coding Ios
CODING iOS 客户端源代码
Stars: ✭ 3,771 (+726.97%)
Mutual labels:  cocoapods, carthage
Sidemenu
An interactive iOS side menu with rich features.
Stars: ✭ 442 (-3.07%)
Mutual labels:  cocoapods, carthage
Hokusai
A Swift library to provide a bouncy action sheet
Stars: ✭ 431 (-5.48%)
Mutual labels:  cocoapods, carthage
Taggerkit
🏷 TaggerKit helps you to quickly implement tags in your UIKit apps, so you can go on and test your idea without having to worry about logic and custom collection layouts.
Stars: ✭ 390 (-14.47%)
Mutual labels:  cocoapods, carthage
Swiftyjson
The better way to deal with JSON data in Swift.
Stars: ✭ 21,042 (+4514.47%)
Mutual labels:  cocoapods, carthage
Vgplayer
📺 A simple iOS video player by Vein.
Stars: ✭ 383 (-16.01%)
Mutual labels:  cocoapods, carthage
Gradientcircularprogress
Customizable progress indicator library in Swift
Stars: ✭ 407 (-10.75%)
Mutual labels:  cocoapods, carthage
Simpleimageviewer
A snappy image viewer with zoom and interactive dismissal transition.
Stars: ✭ 408 (-10.53%)
Mutual labels:  cocoapods, carthage
Restofire
Restofire is a protocol oriented networking client for Alamofire
Stars: ✭ 377 (-17.32%)
Mutual labels:  cocoapods, carthage
Viperit
Viper Framework for iOS using Swift
Stars: ✭ 404 (-11.4%)
Mutual labels:  cocoapods, carthage
Urweatherview
Show the weather effects onto view written in Swift4.2
Stars: ✭ 439 (-3.73%)
Mutual labels:  cocoapods, carthage

PullToDismiss

PullToDismiss provides dismiss modal viewcontroller function like Facebook Messenger by pulling scrollview or navigationbar with smooth and rich background effect.

GitHub release Language Carthage Compatible CocoaPods CocoaPodsDL Awesome Reviewed by Hound


sample blur sample
gif gif

Feature

  • Support all scroll views. (UIScrollView, UITableView, UICollectionView, UIWebView, WKWebView)
  • Customizable. (dismiss background color, alpha, height percentage of dismiss)
  • Available in UIViewController, UINavigationController.
  • Automatically add pan gesture to navigation bar.
  • Blur effect support.
  • Objective-C support. (from v2.1~)

Migration guide

If you update from 1.x to 2.0, see migration guide if needed.

Usage

Getting Started

(1) Setup PullToDismiss

import PullToDismiss

class SampleViewController: UIViewController {
    @IBOutlet private weak var tableView: UITableView!
    private var pullToDismiss: PullToDismiss?
    override func viewDidLoad() {
        super.viewDidLoad()
        pullToDismiss = PullToDismiss(scrollView: tableView)
    }
}

(2) Create view controller and set modalPresentationStyle. Then present view controller

let vc = SampleViewController()
let nav = UINavigationController(rootViewController: vc)
nav.modalPresentationStyle = .overCurrentContext

self.present(nav, animated: true, completion: nil)

👍👍👍

Use (UIScrollView|UITableView|UICollectionView)Delegate

You can use all scroll view's delegate by set pullToDismiss.delegate.

import PullToDismiss

class SampleViewController: UIViewController {
    @IBOutlet private weak var tableView: UITableView!
    private var pullToDismiss: PullToDismiss?
    override func viewDidLoad() {
        super.viewDidLoad()
        pullToDismiss = PullToDismiss(scrollView: tableView)
        pullToDismiss?.delegate = self
    }
}

extension SampleViewController: UITableViewDelegate {
    func scrollViewDidScroll(_ scrollView: UIScrollView) {
        // ...
    }

    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
        // ...
    }
}

Customize

You can customize backgroundEffect, dismissableHeightPercentage:

Shadow background effet

  • background (default: ShadowEffect.default, [color: black, alpha: 0.8])

img1

pullToDismiss?.background = ShadowEffect(color: .red, alpha: 0.5) // color: red, alpha: 0.5

Blur background effect

New feature for v1.0.

gif

// preset blur (.extraLight, .light, .dark)
pullToDismiss?.background = BlurEffect.extraLight

// set custom Blur
pullToDismiss?.background = BlurEffect(color: .red, alpha: 0.5, blurRadius: 40.0, saturationDeltaFactor: 1.8)

dismissableHeightPercentage

img2

// to pull half size of view controller, dismiss view controller.
pullToDismiss?.dismissableHeightPercentage = 0.5

Requirements

  • iOS 8.0+ (blur effect: iOS 9.0+)
  • Xcode 8.1+
  • Swift 3.0+

Installation

Carthage

  • Add the following to your Cartfile:
# Swift 5.0 or later
github "sgr-ksmt/PullToDismiss" ~> 2.2
# Swift 3
github "sgr-ksmt/PullToDismiss", 2.1
  • Run carthage update
  • Add the framework as described.
    Details: Carthage Readme

CocoaPods

PullToDismiss is available through CocoaPods. To install it, simply add the following line to your Podfile:

# Swift 5.0 or later
pod 'PullToDismiss', '~> 2.2'
# Swift 3
pod 'PullToDismiss', '2.1'

and run pod install

Manually Install

Download all *.swift files and put your project.

Change log

Change log is here.

Communication

  • If you found a bug, open an issue.
  • If you have a feature request, open an issue.
  • If you want to contribute, submit a pull request.💪

License

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].