Advertisement
Guest User

Untitled

a guest
Feb 8th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. #import "ViewController.h"
  2.  
  3. @interface ViewController ()
  4.  
  5. @end
  6.  
  7.  
  8. @implementation ViewController
  9.  
  10. @synthesize myButton;
  11.  
  12. - (void)viewDidLoad {
  13. [super viewDidLoad];
  14. // Do any additional setup after loading the view, typically from a nib.
  15.  
  16. self.myButton = [UIButton buttonWithType:UIButtonTypeCustom];
  17. self.myButton.frame = CGRectMake(10, 100, 200, 40);
  18. [self.myButton setBackgroundColor:[UIColor cyanColor]];
  19. [self.myButton addTarget:self action:@selector(changeColor) forControlEvents:UIControlEventTouchUpInside];
  20.  
  21.  
  22.  
  23. }
  24.  
  25. - (void)didReceiveMemoryWarning {
  26. [super didReceiveMemoryWarning];
  27. // Dispose of any resources that can be recreated.
  28. }
  29.  
  30. -(void)changeColor{
  31.  
  32. float randomNum = ((float)rand() / RAND_MAX) * 25;
  33.  
  34.  
  35. }
  36.  
  37. @end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement