A simple customised ProgressView (LoadingView).
It has three modes ;shown in the screenshots below :
1-fullModeProgress : just one circle that keeps rotating.
2-halfModeProgress : two circles.
3-quarterModeProgress : four circles.
To run the example project, clone the repo, and run pod install
from the Example directory first.
XProgressRing is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "XProgressRing"
just drag and drop into your project the files:
1-KDCircularProgress.swift
.
2-XProgressRing.swift
.
After the installation, you can use it straight forward with xib/storyboard.
1-Drag and Drop View in your xib/storyboard and give constraints that you want . It is important to set the same value for width and height.
2-In the inpector set the custome class as "XProgressRing".
3-In the attribute inpector tab, set the value for:
- Raduis : raduis for the view. It is important to set this value the same as width and height to get rounded circle.
- Progress speed : the speed of cycling animation.
- Progress thickness : the thickness of animated track that keeps cycling.
- Progess Color : the color of the progess.
- BackgroundColor : the color of the view (the silent part in XProgressRing).
4- After linking the view with @IBOutlet, you should call the following methodth @IBOutlet
@IBOutlet var xProgressRing: XProgressRing!
override func viewDidLoad() {
super.viewDidLoad()
xProgressRing.startAnimation(ProgressMode: ProgressMode.quarterModeProgress);
}
In the `startAnimation` you should pass the mode for ProgressView (fullModeProgress ,halfModeProgress ,quarterModeProgress and the default one is `quarterModeProgress`).
To stop the animation and hide progressView call: `stopAnimation()`.
## Important feature When the progressView is Displayed for the user; the interaction between the user and the components below the progressView should be forbidden, to implement this action, `addSeparableView` method can be invoked.
xProgressRing.stopAnimation()
XProgressRing is available under the MIT license. See the LICENSE file for more info.