ADVProgressBar for iOS
iPhone widget
 All Classes Functions Enumerations Properties Pages
Instance Methods | Protected Types | Properties | List of all members
ADVPercentProgressBar Class Reference

Define a Custom UIView to depict the progress of a task over time. More...

#import <ADVPercentProgressBar.h>

Inheritance diagram for ADVPercentProgressBar:

Instance Methods

(id) - initWithFrame:andProgressBarColor:
 Override initWithFrame if the view is added programmatically.
 
(id) - initWithCoder:
 Override initWithCoder if the view is loaded from a nib or storyboard.
 

Protected Types

enum  ADVProgressBarColor { ADVProgressBarGreen, ADVProgressBarRed, ADVProgressBarBrown, ADVProgressBarBlue }
 Set of progressImageView horizontal bar colors.
 

Properties

CGFloat progress
 The current amount of the task that has completed (default 0.0).
 
ADVProgressBarColor progressBarColor
 The progressImageView horizontal bar color in the ADVProgressBarColor set (default ADVProgressBarBlue).
 
CGFloat minProgressValue
 Minimum in the range of progress values (default 0.0).
 
CGFloat maxProgressValue
 Maximum in the range of progress values (default 1.0).
 
BOOL showPercent
 Toggle between percent or integral view of current progress (default YES = percent)
 

Detailed Description

Define a Custom UIView to depict the progress of a task over time.

The amount of progress is displayed by a horizontal bar, called progressImageView, that represents a range of values. This range is controlled by the minProgressValue and the maxProgressValue properties, whose default values are 0.0 and 1.0 respectively.

The user can customize the appearance of the progressImageView horizontal bar selecting its color in the ADVProgressBarColor set.

The current progress is represented by a floating-point value (default 0.0) between minProgressValue and maxProgressValue, inclusive; values less or greater are pinned to those limits.

The current progress is shown by the position of a cursor, coupled with the progressImageView and called percentView; within its bounds, it is shown a textual indication of the amount of the task that has completed. The way this indication is displayed, is controlled by the showPercent property: by default its value is YES and the current progress is formatted as a percent complete respect the range of values.

The user can set to NO the showPercent property to display the integral amount of the task that has completed. Since the width of the progressImageView cursor is fixed to 3 textual characters wide, if maxProgressValue is greater than 999, then the current progress is formatted as a percent even if the showPercent property is set to NO.

The showPercent property isn't taken in account also when the maxProgressValue is less or equal to 1.0: the current progress will be always formatted as a percent.

This Custom UIView can be created and instantiated both in-code (programmatically) or via a nib (storyboard). For this reason, are supported both initWithFrame:andProgressBarColor: and initWithCoder: methods respectively.

CREDITS

How is view initialized when loaded via a storyboard

iPhone : Getting the size of an image after AspectFt

Method Documentation

- (id) initWithCoder: (NSCoder *)  coder

Override initWithCoder if the view is loaded from a nib or storyboard.

Parameters
coderA nib or storyboard object.
Returns
An ADVPercentProgressBar initialized from a nib or storyboard.
- (id) initWithFrame: (CGRect)  frame
andProgressBarColor: (ADVProgressBarColor barColor 

Override initWithFrame if the view is added programmatically.

Initializes and returns a newly allocated ADVPercentProgressBar view object. The view is allocated with the specified frame rectangle and the progressImageView horizontal bar color.

Parameters
frameThe frame rectangle for the view, measured in points. The origin of the frame is relative to the superview in which you plan to add it.
barColorThe progressImageView horizontal bar color in the ADVProgressBarColor set.
Returns
An initialized ADVPercentProgressBar view object or nil if the object couldn't be created.

Property Documentation

- (ADVProgressBarColor) progressBarColor
readwritenonatomicassign

The progressImageView horizontal bar color in the ADVProgressBarColor set (default ADVProgressBarBlue).


The documentation for this class was generated from the following files: