Guest User

Untitled

a guest
Nov 20th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. - (void)drawRect:(CGRect)rect
  2. {
  3. [super drawRect:rect];
  4.  
  5. CGContextRef context = UIGraphicsGetCurrentContext();
  6.  
  7. UIGraphicsPushContext(context);
  8.  
  9. [self.fillColor set];
  10.  
  11. CGRect valueRect = CGRectMake(0, 0, self.frame.size.width * _value, self.frame.size.height);
  12.  
  13. UIRectFill(valueRect);
  14.  
  15. CGContextSetBlendMode(context, kCGBlendModeScreen);
  16.  
  17. [self.highlightColor set];
  18. UIRectFrame(valueRect);
  19.  
  20. UIGraphicsPopContext();
  21. }
  22.  
  23.  
  24.  
  25.  
  26. - (IBAction) tap:(UITapGestureRecognizer*)sender
  27. {
  28. if([sender state] == UIGestureRecognizerStateEnded)
  29. {
  30. [UIView animateWithDuration:1.5
  31. delay:0
  32. options:UIViewAnimationOptionCurveLinear | UIViewAnimationOptionAutoreverse | UIViewAnimationOptionBeginFromCurrentState
  33. animations:^{
  34. //self.frame = CGRectMake(self.frame.origin.x, self.frame.origin.y, 100, 100);
  35. self.backgroundColor = [UIColor colorWithWhite:1.0 alpha:0.5];
  36. }
  37. completion:^(BOOL finished){NSLog(@"Done");} ];
  38. }
  39. }
Add Comment
Please, Sign In to add comment