Created
September 10, 2013 14:41
-
-
Save iesta/6510410 to your computer and use it in GitHub Desktop.
Create a button programmatically
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect]; | |
[button addTarget:self | |
action:@selector(aMethod:) | |
forControlEvents:UIControlEventTouchDown]; | |
[button setTitle:@"Show View" forState:UIControlStateNormal]; | |
button.frame = CGRectMake(80.0, 210.0, 160.0, 40.0); | |
[view addSubview:button]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment