Created
January 3, 2014 04:07
-
-
Save jeradesign/8232548 to your computer and use it in GitHub Desktop.
Hard Coded UI Example
This file contains hidden or 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
// | |
// ViewController.m | |
// HardCodedUITest | |
// | |
// Created by John Brewer on 7/15/13. | |
// Copyright (c) 2013 Jera Design LLC. All rights reserved. | |
// | |
#import "ViewController.h" | |
@interface ViewController () | |
@end | |
@implementation ViewController | |
- (void)viewDidLoad | |
{ | |
[super viewDidLoad]; | |
// Do any additional setup after loading the view, typically from a nib. | |
CGRect frame = CGRectMake(100, 100, 300, 100); | |
_button = [[UIButton alloc] initWithFrame:frame]; | |
[_button setTitle:@"Hello" forState:UIControlStateNormal]; | |
[[self view] addSubview:_button]; | |
[_button addTarget:self action:@selector(doSomething) forControlEvents:UIControlEventTouchUpInside]; | |
} | |
- (void)doSomething { | |
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Hello" message:@"Hello, there." delegate:self cancelButtonTitle:@"Done" otherButtonTitles:nil]; | |
[alertView show]; | |
} | |
- (void)didReceiveMemoryWarning | |
{ | |
[super didReceiveMemoryWarning]; | |
// Dispose of any resources that can be recreated. | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment