Skip to content

Instantly share code, notes, and snippets.

@tmaybe
Created April 10, 2013 19:34
Show Gist options
  • Save tmaybe/5357731 to your computer and use it in GitHub Desktop.
Save tmaybe/5357731 to your computer and use it in GitHub Desktop.
Snippet for a quick UIButton in Objective-C
UIButton *tmpButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
tmpButton.frame = CGRectMake(0, 0, 100, 50);
[tmpButton addTarget:self action:@selector(pressButton:) forControlEvents:UIControlEventTouchUpInside];
[tmpButton setTitle:@"TEST" forState:UIControlStateNormal];
[self.view addSubview:tmpButton];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment