Skip to content

aataraxiaa/ActivityNavigationBar

Repository files navigation

ActivityNavigationBar

CI Status Version License Platform

Description

Activity navigation bar provides a custom navigation bar with a build in activity indicator. The activity indicator is styled like a progress bar, but is intended to be used to indicate indeterminate activity time.

To achieve this, the activity is started with a 'waitAt' parameter. The activity bar will then animate progress to this point, and stop. Then, once our indeterminate activity has finished, we finish the activity indicator.

Installation

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

pod "ActivityNavigationBar"

Usage

  • Set the class type of your navigation bar from UINavigationBar to ActivityNavigationBar in your storyboard scene or Xib
  • In the view controller class corresponding to your storyboard scene, create an optional var which will allow you to reference the ActivityNavigationBar;
var activityNavigationBar: ActivityNavigationBar? {
  return navigationController?.navigationBar as? ActivityNavigationBar
}
  • Now, use the ActivityNavigationBar as follows.

Start it;

activityNavigationBar?.startActivity(andWaitAt: 0.8)

Finish it;

activityNavigationBar?.finishActivity(withDuration: duration)

Reset it;

activityNavigationBar?.reset()

Example

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

Sample app screenshot

Author

Pete Smith, peadar81@gmail.com

License

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

About

Navigation bar with a progress bar-style activity indicator

Resources

License

Stars

Watchers

Forks

Packages

No packages published