Navigation bar with a progress bar-style activity indicator
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
ActivityNavigationBar
Assets
Example
.gitattributes
.gitignore
.travis.yml
ActivityNavigationBar.podspec
LICENSE
README.md
_Pods.xcodeproj

README.md

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.