Latest | 1.0.4 |
---|---|
Homepage | https://github.com/longhorn499/ActivityIndicatingNavigationItem |
License | MIT |
Platforms | ios 10.0, requires ARC |
Authors |
UINavigationItem subclass that indicates activity with UIActivityIndicator for right and left bar button items.
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: "Edit Profile", indicatorStyle: .white)
Start animating side:
activityIndicatingNavigationItem.startAnimating(.right)
Stop animating:
activityIndicatingNavigationItem.stopAnimating(.right)
Configuration
Changing the activity indicator style (default style is gray
):
activityIndicatingNavigationItem.indicatorStyle = .white
Changing the activity indicator color (can also update in Storyboard):
activityIndicatingNavigationItem.indicatorColor = .blue
Requirements
Written in Swift 4.0, requires iOS 10.0 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.
Latest podspec
{ "name": "ActivityIndicatingNavigationItem", "version": "1.0.4", "summary": "UINavigationItem subclass that indicates activity with UIActivityIndicator for right/left bar items", "description": "Use to easily animate the right or left bar button item with this UINavigationItem subclass. Now a common UI practice in iOS for indicating activity while saving data in edit profile screens, etc.", "homepage": "https://github.com/longhorn499/ActivityIndicatingNavigationItem", "license": "MIT", "authors": { "longhorn499": "[email protected]" }, "social_media_url": "http://twitter.com/dirtydan499", "platforms": { "ios": "10.0" }, "source": { "git": "https://github.com/longhorn499/ActivityIndicatingNavigationItem.git", "tag": "1.0.4" }, "source_files": "Source/*.swift", "requires_arc": true, "pushed_with_swift_version": "4.0" }
Tue, 12 Dec 2017 21:40:04 +0000