Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #import "ViewController.h"
- @interface ViewController ()
- @end
- @implementation ViewController
- @synthesize myButton;
- - (void)viewDidLoad {
- [super viewDidLoad];
- // Do any additional setup after loading the view, typically from a nib.
- self.myButton = [UIButton buttonWithType:UIButtonTypeCustom];
- self.myButton.frame = CGRectMake(10, 100, 200, 40);
- [self.myButton setBackgroundColor:[UIColor cyanColor]];
- [self.myButton addTarget:self action:@selector(changeColor) forControlEvents:UIControlEventTouchUpInside];
- }
- - (void)didReceiveMemoryWarning {
- [super didReceiveMemoryWarning];
- // Dispose of any resources that can be recreated.
- }
- -(void)changeColor{
- float randomNum = ((float)rand() / RAND_MAX) * 25;
- }
- @end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement