YLProgressBar Class Reference
Inherits from | UIView |
Declared in | YLProgressBar.h |
Overview
The YLProgressBar is an UIProgressView replacement with an highly and fully customizable animated progress bar.
The YLProgressBar class provides properties for managing the style of the track and the progress bar, managun its behavior and for getting and setting values that are pinned to the progress of a task.
Unlike the UIProgressView, the YLProgressBar can be used for as an indeterminate progress indicator thanks to its pre-made behaviors.
Note: The YLProgressBar is conform to the UIAppearance protocol, however, because of the current version of the appledoc project, the UI_APPEARANCE_SELECTOR macros are not taken into account, that’s why they are commented.
Tasks
Managing the Progress Bar
-
progress
property -
– setProgress:animated:
Modifying the Progress Bar’s Behavior
-
behavior
property
Configuring the Progress Bar
-
hideGloss
property -
progressTintColors
property -
progressTintColor
property -
trackTintColor
property -
indicatorTextLabel
property -
indicatorTextDisplayMode
property -
type
property
Configuring the Stripes
-
stripesAnimated
property -
stripesDirection
property -
stripesAnimationVelocity
property -
stripesOrientation
property -
stripesWidth
property -
stripesColor
property -
stripesDelta
property -
hideStripes
property
Properties
behavior
The behavior of the progress bar. A behavior defines how the progress bar needs to react in certain cases. For example the “default” behavior of the progress bar displays the stripes everytime whereas the “waiting” behavior displays them only when the progress value is nearby the max value.
@property (nonatomic, assign) YLProgressBarBehavior behavior
Discussion
The default value is YLProgressBarBehaviorDefault.
Declared In
YLProgressBar.h
hideGloss
A Boolean value that determines whether the gloss effet is hidden.
@property (nonatomic, assign) BOOL hideGloss
Discussion
Setting the value of this property to YES hides the gloss effect
and setting it to NO shows the gloss effect whatever the progress type
(YLProgressBarTypeRounded
or YLProgressBarTypeFlat
). The value is updated
each time the type change.
Declared In
YLProgressBar.h
hideStripes
A Boolean value that determines whether the stripes are hidden.
@property (nonatomic, assign) BOOL hideStripes
Discussion
Setting the value of this property to YES hides the stripes and setting it to NO shows the stripes. The default value is NO.
Declared In
YLProgressBar.h
indicatorTextDisplayMode
The display indicator text mode. It defines where the indicator text needs to display.
@property (nonatomic, assign) YLProgressBarIndicatorTextDisplayMode indicatorTextDisplayMode
Discussion
The default value is set to
YLProgressBarIndicatorTextDisplayModeNone
.
Declared In
YLProgressBar.h
indicatorTextLabel
A label to display some indications for the user. When the label text is set to nil it shows the progress value as a percentage. You can configure its font color, the font size, the text alignement, etc. as any other labels.
@property (nonatomic, strong) UILabel *indicatorTextLabel
Discussion
By default the label text is set to nil and its text color change using the background color.
Declared In
YLProgressBar.h
progress
The current progress shown by the receiver.
@property (atomic, assign) CGFloat progress
Discussion
The current progress is represented by a floating-point value between 0.0 and 1.0, inclusive, where 1.0 indicates the completion of the task.
The default value is 0.0. Values less than 0.0 and greater than 1.0 are pinned to those limits.
Declared In
YLProgressBar.h
progressTintColor
The color shown for the portion of the progress bar that is filled.
@property (nonatomic, strong) UIColor *progressTintColor
Declared In
YLProgressBar.h
progressTintColors
The colors shown for the portion of the progress bar that is filled.
@property (nonatomic, strong) NSArray *progressTintColors
Discussion
All the colors in the array are drawn as a gradient visual of equal size.
Declared In
YLProgressBar.h
stripesAnimated
The animated vs. nonanimated stripes of the progress bar.
@property (nonatomic, getter=isStripesAnimated) BOOL stripesAnimated
Discussion
If YES, the stripes over the progress bar is moving from the left to the right side.
The default value for this property is YES.
Declared In
YLProgressBar.h
stripesAnimationVelocity
The velocity of the stripes during the animation. Higher is the value, greater the distance traveled by the stripes during a frame is.
@property (nonatomic, assign) double stripesAnimationVelocity
Discussion
The absolute value of the property is taken into account. By
default the velocity is 1
.
Declared In
YLProgressBar.h
stripesColor
The color show for the stripes over the progress bar.
@property (nonatomic, strong) UIColor *stripesColor
Declared In
YLProgressBar.h
stripesDelta
The x-coordinate distance in pixels between the top point and the bottom point of a slanted stripe.
@property (nonatomic, assign) NSInteger stripesDelta
Discussion
Default value is YLProgressBarDefaultStripeDelta
. Positive
integers are expected for correct effect. Has no effect when
stripesOrientation property is YLProgressBarStripesOrientationVertical
.
Declared In
YLProgressBar.h
stripesDirection
The direction of the movement during the animation.
@property (nonatomic, assign) YLProgressBarStripesDirection stripesDirection
Discussion
The default value for this property is
YLProgressBarStripesDirectionRight
.
Declared In
YLProgressBar.h
stripesOrientation
The orientation of the stripes.
@property (nonatomic, assign) YLProgressBarStripesOrientation stripesOrientation
Discussion
The default value for this property is
YLProgressBarStripesOrientationRight
.
Declared In
YLProgressBar.h
stripesWidth
The width of the stripes drawn over the progress bar.
@property (nonatomic, assign) NSInteger stripesWidth
Discussion
If the property is less or equal than 0 the sprites are hidden.
The default value for this property is equal to the
YLProgressBarDefaultStripeWidth
value.
Declared In
YLProgressBar.h
trackTintColor
The color shown for the portion of the progress bar that is not filled.
@property (nonatomic, strong) UIColor *trackTintColor
Declared In
YLProgressBar.h
type
The type of the progress bar.
@property (nonatomic, assign) YLProgressBarType type
Discussion
The default value is set to YLProgressBarTypeRounded
.
Declared In
YLProgressBar.h
Instance Methods
setProgress:animated:
Adjusts the current progress shown by the receiver, optionally animating the change.
- (void)setProgress:(CGFloat)progress animated:(BOOL)animated
Parameters
- progress
The new progress value.
- animated
YES if the change should be animated, NO if the change should happen immediately.
Discussion
The current progress is represented by a floating-point value between 0.0 and 1.0, inclusive, where 1.0 indicates the completion of the task. The default value is 0.0. Values less than 0.0 and greater than 1.0 are pinned to those limits.
Declared In
YLProgressBar.h