Giter Club home page Giter Club logo

sliderprogress's Introduction

SliderProgress

Version Platform iOS License MIT

Requirements

To run the example project, clone the repo, and run pod install from the Example directory first.

Installation

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

pod 'SliderProgress'

Author

Landon Vago-Hughes, Contact: [email protected]

License

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

Swipe down usage

This usage if for if you wish to swipe down and see how much you need to swipe down until the view will dismiss

import SliderProgress

class ViewController: UIViewController, UIScrollViewDelegate {

weak var progressBar: SwipeProgression!

override func viewDidLoad() {
    let progressions: SwipeProgression = SwipeProgression(frame: CGRect.zero)
    self.view.addSubview(progressions)
    progressions.setup()
    self.progressBar = progressions
    }

func scrollViewDidScroll(_ scrollView: UIScrollView) {
    if progressBar == nil {
            self.dismiss(animated: true, completion: nil)
        } else {
            progressBar.animateWidth(scrollheight: 150, scrollviewcurrent: scrollView, targetviewcontroller: self)
        }
    }
}

Swipe up usage

The only difference in this use case is we have a function called swipeDownProgress which will let you know how much longer you have left until the end of the scrollView. The function itself just removes the view from the superview. The dismiss function is what I have added to show how it can be applied.

func scrollViewDidScroll(_ scrollView: UIScrollView) {
    if progressBar == nil {
            self.dismiss(animated: true, completion: nil)
        } else {
            progressions.swipeUpProgress(scrollviewcurrent: scrollView)
        }
    }
}

sliderprogress's People

Contributors

lvh1g15 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.