Skip to content

Instantly share code, notes, and snippets.

@izzuddin91
Created September 26, 2017 03:26
Show Gist options
  • Select an option

  • Save izzuddin91/023e1c33b70f1f04b4ce8883daba8122 to your computer and use it in GitHub Desktop.

Select an option

Save izzuddin91/023e1c33b70f1f04b4ce8883daba8122 to your computer and use it in GitHub Desktop.
//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