ActivityIndicatingNavigationItem 1.0.4

ActivityIndicatingNavigationItem 1.0.4

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Dec 2017
SwiftSwift Version 4.0
SPMSupports SPM

Maintained by Kevin Johnson.



ActivityIndicatingNavigationItem

UINavigationItem subclass that indicates activity with UIActivityIndicator for right and left bar button items.

Platform iOS
CocoaPods compatible
MIT license

Description

UINavigationItem subclass you can use to animate a UIActivityIndicatorView in the left/right positions - then when finished animating revert to your preset bar button items.

  • Helpful for indicating activity with Save/Done bar button items
  • Common in iOS UI/UX design for edit profile screens, save avatar screens, etc.

Installation

With CocoaPods, add ActivityIndicatingNavigationItem to your Podfile:

pod 'ActivityIndicatingNavigationItem'

Then install with pod install.

Or you can manually import the files from the Source folder.

Usage

If you're using a Storyboard, set the name of the Class and Module, then create an outlet:

@IBOutlet weak var activityIndicatingNavigationItem: ActivityIndicatingNavigationItem!

Or set up programmatically:

let activityIndicatingNavigationItem = ActivityIndicatingNavigationItem.init(title: "Title", indicatorStyle: .white)

Start animating side:

activityIndicatingNavigationItem.startAnimating(.right)

Stop animating:

activityIndicatingNavigationItem.stopAnimating(.right)

Changing the style (default style is gray):

activityIndicatingNavigationItem.indicatorStyle = .white

Requirements

Written in Swift 4.0, requires iOS 10.3 and above, Xcode 9.0 and above.

Credits

Created by Kevin Johnson.

License

Available under the MIT license. See the LICENSE file for more info.