Giter Club home page Giter Club logo

jwd-ali / rprogressview Goto Github PK

View Code? Open in Web Editor NEW
10.0 3.0 3.0 3.24 MB

This animation is inspired from #Reddit application i downloaded few days back and love its progress view. so i try to implement that with number of customisations options. You can add as many number of circles you want ... You can have multicolour progress view also speed and width of circles are also customisable

License: MIT License

Swift 91.15% Objective-C 3.73% Ruby 5.12%
ios swift ui ui-components uikit progress progress-bar progress-view progressview reddit

rprogressview's Introduction

RProgressView

Inspired from Reddit app.... Add Progress Animation in just 2 steps in your view

CI Status CocoaPods Version Carthage Compatible License Platform Swift 5.1




Requirements

  • iOS 10.0+ / Mac OS X 10.9+ / watchOS 2.0+ / tvOS 9.0+
  • Xcode 8.0+

Installation

To integrate RProgressView into your Xcode project using CocoaPods, specify it in your Podfile:

 use_frameworks!

 pod 'RProgressView'

Then, run the following command:

 $ pod install

To integrate RProgressView into your Xcode project using Carthage, specify it in your Cartfile:

 github "jwd-ali/RProgressView"

Manually

If you prefer not to use a dependency manager, you can integrate RProgressView into your project manually.

  • Add sources into your project:
    • Drag RProgressView.swift and CALayer+Extension.swift

Usage

If you are using any dependency manager (pods , carthage , package manager)to integrate RProgressView. Import RProgressView first:

import RProgressView

And for Manuall install you dont need to import anything

You need to simply initiate progressView

var progessView = RProgressView() 

You can set number of circles you want in your progress view set numberOfCircles property

progress.numberOfCircles = 4

You can show multi color Circles for that turn on isMultiColour to true and add colours dotColors according to number of circles like this

     private lazy var progessViewMultiColour:RProgressView = {
       let progress = RProgressView()
       progress.isMultiColour = true
       progress.mainDotColor = .black
       progress.dotColors = [.red, .green, .blue , .brown]
       progress.numberOfCircles = 4
       return progress
  }()

And if you want to show it i one colour you need. to set isMultiColour to false and you don't need to give dotColors as they are not needed

.    private lazy var progessViewPlain:RProgressView = {
      let progress = RProgressView()
      progress.isMultiColour = false
      progress.numberOfCircles = 2
      progress.translatesAutoresizingMaskIntoConstraints = false
      return progress
     }()

Then in which view you want to show progress call

progess.StartAnimating(in: self.view)

To stop and hide call

progess.stopAnimating()

For better understanding framework includes example project as well

Congratulations! You're done.

Contributing

I’d love to have help on this project. For small changes please open a pull request, for larger changes please open an issue first to discuss what you’d like to see.

License

RProgressView is under MIT. See LICENSE file for more info.

rprogressview's People

Contributors

jawad-digitify avatar jwd-ali avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  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.