Created
September 26, 2017 03:26
-
-
Save izzuddin91/023e1c33b70f1f04b4ce8883daba8122 to your computer and use it in GitHub Desktop.
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
| //create and configure the UI windows view instances | |
| CGRect winFrame = [[UIScreen mainScreen] bounds]; | |
| UIWindow *theWindow = [[UIWindow alloc] initWithFrame:winFrame]; | |
| self.window = theWindow; | |
| CGRect tableframe = CGRectMake(0, 80, winFrame.size.width, winFrame.size.height - 100); | |
| CGRect fieldFrame = CGRectMake(20, 40, 200, 31); | |
| CGRect buttonFrame = CGRectMake(228, 40, 72, 31); | |
| self.taskTable = [[UITableView alloc] initWithFrame:tableframe style:UITableViewStylePlain]; | |
| self.taskTable.separatorStyle = UITableViewCellSeparatorStyleNone; | |
| [self.taskTable registerClass:[UITableViewCell class] forCellReuseIdentifier:@"Cell"]; | |
| self.taskField = [[UITextField alloc] initWithFrame:fieldFrame]; | |
| self.taskField.borderStyle = UITextBorderStyleRoundedRect; | |
| self.taskField.placeholder = @"type a task, tap insert"; | |
| //create and configure a uibutton instance | |
| self.insertButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; | |
| self.insertButton.frame = buttonFrame; | |
| [self.insertButton setTitle:@"Insert" forState:UIControlStateNormal ]; | |
| [self.window addSubview:self.taskTable]; | |
| [self.window addSubview:self.taskField]; | |
| [self.window addSubview:self.insertButton]; | |
| self.window.backgroundColor = [UIColor whiteColor]; | |
| [self.window makeKeyAndVisible]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment