Skip to content

oliverfoggin/OJFSegmentedProgressView

Repository files navigation

#OJFSegmentedProgressView#

OJFSegmentedProgressView is a replacement for UIProgressView that displays in segments.

It has been written to have all the same properties and methods as UIProgressView (except the setProgress:animated: and the initWithStyle: constructor).

##Style enum##

typedef enum {
    OJFSegmentedProgressViewStyleDiscrete,
    OJFSegmentedProgressViewStyleContinuous,
} OJFSegmentedProgressViewStyle;

##Properties##

  1. OJFSegmentedProgressViewStyle style
  2. NSUInteger numberOfSegments
  3. float segmentSeparatorSize
  4. float progress
  5. UIColor trackTintColor
  6. UIColor progressTintColor

##Constructor##

  • (id)initWithNumberOfSegments:(NSUInteger)numberOfSegments;

##Example Usage##

- (void)viewDidLoad
{
    [super viewDidLoad];

    OJFSegmentedProgressView *progressView = [[OJFSegmentedProgressView alloc] initWithNumberOfSegments:13];
    [progressView setFrame:CGRectMake(20, 100, 280, 20)];
    [progressView setTrackTintColor:[UIColor lightGreyColor]];
    [progressView setProgressTintColor:[UIColor darkGreyColor]];
    [progressView setStyle:OJFSegmentedProgressViewStyleContinuous];
    [self.view addSubView:progressView];
}

##CocoaPods text##

pod 'OJFSegmentedProgressView', '~> 0.0.1'

About

A segmented progress view that works like UIProgressView.

Resources

License

Stars

Watchers

Forks

Packages