Skip to content

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

Notifications You must be signed in to change notification settings

jwd-ali/RProgressView

Repository files navigation

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.

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published