2016-12-28 11:55:26 +01:00
2016-12-28 11:42:55 +01:00
2016-12-28 11:42:55 +01:00
2016-12-28 11:42:55 +01:00
2016-12-28 11:55:26 +01:00
2016-12-28 11:54:58 +01:00
2016-12-28 11:42:55 +01:00

GradientLoadingBar

Swift3.0 An animated gradient loading bar. Inspired by iOS Style Gradient Progress Bar with Pure CSS/CSS3.

Example

Integration

GradientLoadingBar can be added to your project using CocoaPods by adding the following line to your Podfile:

pod 'GradientLoadingBar', '~> 1.0'

How to use

First you need to import "GradientLoadingBar". After that you can use "GradientLoadingBar.sharedInstance()" to retrieve an instance to the loading bar. To show it, simply call the "show()" method and after you're done call "hide()".

// Show loading bar
GradientLoadingBar.sharedInstance().show()

// Do e.g. server calls etc.

// Hide loading bar
GradientLoadingBar.sharedInstance().hide()

Configuration

You can overwrite the default configuration by calling the initializers with the optional params "height" and "durations":

let loadingBar = GradientLoadingBar(
    height: 1.0,
    durations: Durations(fadeIn: 1.0, fadeOut: 2.0, progress: 3.00)
)

If you don't want to save the instance on a variable and use the singleton instead, you can use the "saveInstance()" method. Add the following code to your app delegate "didFinishLaunchingWithOptions" method:

GradientLoadingBar(
    height: 1.0,
    durations: Durations(fadeIn: 1.0, fadeOut: 2.0, progress: 3.00)
).saveInstance()

After that you can use "GradientLoadingBar.sharedInstance()" as mentioned above.

Version

1.0.0

Author

Felix Mau (contact(@)felix.hamburg)

S
Description
️A customizable animated gradient loading bar.
Readme MIT 201 MiB
Languages
Swift 97.4%
Makefile 2.6%