Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (void)drawRect:(CGRect)rect
- {
- [super drawRect:rect];
- CGContextRef context = UIGraphicsGetCurrentContext();
- UIGraphicsPushContext(context);
- [self.fillColor set];
- CGRect valueRect = CGRectMake(0, 0, self.frame.size.width * _value, self.frame.size.height);
- UIRectFill(valueRect);
- CGContextSetBlendMode(context, kCGBlendModeScreen);
- [self.highlightColor set];
- UIRectFrame(valueRect);
- UIGraphicsPopContext();
- }
- - (IBAction) tap:(UITapGestureRecognizer*)sender
- {
- if([sender state] == UIGestureRecognizerStateEnded)
- {
- [UIView animateWithDuration:1.5
- delay:0
- options:UIViewAnimationOptionCurveLinear | UIViewAnimationOptionAutoreverse | UIViewAnimationOptionBeginFromCurrentState
- animations:^{
- //self.frame = CGRectMake(self.frame.origin.x, self.frame.origin.y, 100, 100);
- self.backgroundColor = [UIColor colorWithWhite:1.0 alpha:0.5];
- }
- completion:^(BOOL finished){NSLog(@"Done");} ];
- }
- }
Add Comment
Please, Sign In to add comment