//
//  ProgressBar.m
//  SKCore
//
//  Created by u on 2014. 9. 10..
//  Copyright (c) 2014 ACCVUER. All rights reserved.
//

#import "ProgressBar.h"


@implementation ProgressBar

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {

    }
    return self;
}

- (void)drawRect:(CGRect)rect
{
//    [self.frame setBackgroundColor: [UIColor blackColor]];
    CGRect rectangle = CGRectMake(0, 0, rect.size.width*m_progressRatio, rect.size.height);
    CGContextRef context = UIGraphicsGetCurrentContext();
    CGContextFillRect(context, rectangle);
    
    self.layer.cornerRadius = 5;
    self.layer.masksToBounds = YES;
}

-(void)setProgressValue:(float)progress{
    m_progressRatio = progress;
    [self setNeedsDisplay];
}

@end
