{"id":19179181,"url":"https://github.com/melling/noniballcode","last_synced_at":"2026-06-18T22:31:09.683Z","repository":{"id":11564118,"uuid":"14051195","full_name":"melling/NoNibAllCode","owner":"melling","description":"An iOS program that does UI with only code.  No storyboards or nibs.","archived":false,"fork":false,"pushed_at":"2013-11-02T03:21:23.000Z","size":208,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-23T01:35:40.208Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/melling.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-11-01T18:57:29.000Z","updated_at":"2013-11-02T03:21:23.000Z","dependencies_parsed_at":"2022-09-23T23:51:46.523Z","dependency_job_id":null,"html_url":"https://github.com/melling/NoNibAllCode","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/melling/NoNibAllCode","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melling%2FNoNibAllCode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melling%2FNoNibAllCode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melling%2FNoNibAllCode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melling%2FNoNibAllCode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/melling","download_url":"https://codeload.github.com/melling/NoNibAllCode/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melling%2FNoNibAllCode/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34510281,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-18T02:00:06.871Z","response_time":128,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T10:42:23.121Z","updated_at":"2026-06-18T22:31:09.667Z","avatar_url":"https://github.com/melling.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NoNibAllCode\n\nAn iOS program that does UI with only code.  No storyboards or nibs.\n\n\n1. Create a new project of type 'Empty Application'\n\n2. Change AppDelegate to create a Navigation Controller and add a top level view controller\n\n\u003cpre\u003e\n- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions\n{\n    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];\n    \n    UINavigationController *navController = [[UINavigationController alloc] init];\n    self.window.rootViewController = navController;\n    // Do we want a tableview controller or regular uiviewcontroller?\n    \n//    UITableViewController *topLevelController = [[UITableViewController alloc] initWithStyle:UITableViewStylePlain];\n    UIViewController *topLevelController = [[UIViewController alloc] init];\n    topLevelController.view.backgroundColor = [UIColor greenColor];\n    \n    [navController addChildViewController: topLevelController];\n    //    self.window.backgroundColor = [UIColor whiteColor];\n    [self.window makeKeyAndVisible];\n    return YES;\n\n}\n\n\u003c/pre\u003e\n\nSee git branch: Step_1\n\n## Register custom UITableViewCell\n\n3. Create custom UITableViewController for main nav.  Had to subclass UITableViewCell so I could register them.  Might be better to give in and use xib's for table cells?\n\n[Setting style of UITableViewCell when using iOS 6 UITableView dequeueReusableCellWithIdentifier:forIndexPath:](http://stackoverflow.com/questions/13174972/setting-style-of-uitableviewcell-when-using-ios-6-uitableview-dequeuereusablecel)\n\u003cpre\u003e\n[self.tableView registerClass:[MainNavTableCell class] forCellReuseIdentifier:@\"MainNavCell\"];\n\u003c/pre\u003e\n\nHere's what it looks like when we register a nib:\n\n\u003cpre\u003e\n  [self.tableView registerNib:[UINib nibWithNibName:@\"MissedWordTableCell\" bundle:[NSBundle mainBundle]] forCellReuseIdentifier:@\"MissedWordCell\"];\n\u003c/pre\u003e\n\n## Create Detail View Controllers\n\nIn MainNavTableViewController.m, add the following UITableViewController delegate method:\n\u003cpre\u003e\n- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath\n{\n    UIViewController *vc = [[UIViewController alloc] init];\n    vc.title = [NSString stringWithFormat:@\"ViewController #%d\", indexPath.row];\n    vc.view.backgroundColor = self.viewControllerColors[indexPath.row]; // Add a little color\n    [self.navigationController pushViewController:vc animated:YES];\n\n}\n\u003c/pre\u003e\n\nWe are creating a new UIViewController instance on every selection and having the navigationController push it onto its stack.  What we want to do, of course, is create our own custom UIViewController subclasses.\n\nSee git branch: Step_2\n\n## Autolayout\n\n\u003cpre\u003e\n- (UIButton *)createButton:(NSString *)title {\n    UIButton *aBtn;\n\n    aBtn = [[UIButton alloc] init];\n    [aBtn setTitle:NSLocalizedString(title, @\"Button Title\") forState:UIControlStateNormal];\n    aBtn.translatesAutoresizingMaskIntoConstraints = NO;\n\n    aBtn.layer.borderWidth = 1.f;\n    aBtn.layer.borderColor = [UIColor blackColor].CGColor;\n    aBtn.layer.cornerRadius = 5.f;\n    aBtn.titleLabel.adjustsFontSizeToFitWidth = YES;\n    aBtn.isAccessibilityElement = YES;\n    aBtn.accessibilityLabel = title;\n    \n    return aBtn;\n}\n\u003c/pre\u003e\n\n\u003cpre\u003e\n// Using (id)sender is common but autocompletion is better with type\n\n- (IBAction)transition1BtnAction:(UIButton *)sender { \n    NSLog(@\"Button #1 Pressed\");\n}\n\n- (IBAction)transition2BtnAction:(UIButton *)sender {\n    NSLog(@\"Button #2 Pressed\");\n}\n\n- (IBAction)transition3BtnAction:(UIButton *)sender {\n    NSLog(@\"Button #3 Pressed\");\n}\n\n- (IBAction)transition4BtnAction:(UIButton *)sender {\n    NSLog(@\"Button #4 Pressed\");\n}\n\u003c/pre\u003e\n\n\u003cpre\u003e\n- (void)drawiPhoneScreen {\n    \n    self.transition1Btn = [self createButton:NSLocalizedString(@\"Transition #1\", @\"\")];\n    [self.transition1Btn addTarget:self action:@selector(transition1BtnAction:) forControlEvents:UIControlEventTouchUpInside];\n\n    self.transition2Btn = [self createButton:NSLocalizedString(@\"Transition #2\", @\"\")];\n    [self.transition2Btn addTarget:self action:@selector(transition1BtnAction:) forControlEvents:UIControlEventTouchUpInside];\n\n    self.transition3Btn = [self createButton:NSLocalizedString(@\"Transition #3\", @\"\")];\n    [self.transition3Btn addTarget:self action:@selector(transition3BtnAction:) forControlEvents:UIControlEventTouchUpInside];\n    \n    self.transition4Btn = [self createButton:NSLocalizedString(@\"Transition #4\", @\"\")];\n    [self.transition4Btn addTarget:self action:@selector(transition4BtnAction:) forControlEvents:UIControlEventTouchUpInside];\n    \n    [self.view addSubview: self.transition1Btn];\n    [self.view addSubview: self.transition2Btn];\n    [self.view addSubview: self.transition3Btn];\n    [self.view addSubview: self.transition4Btn];\n    \n    // Just put all buttons in our view dictionary\n    NSDictionary *viewDictionary = NSDictionaryOfVariableBindings(_transition1Btn, _transition2Btn, _transition3Btn, _transition4Btn);\n    \n    NSString *rowH1Constraint = @\"H:|-15-[_transition1Btn(\u003e=100)]-15-[_transition2Btn(==_transition1Btn)]-15-|\";\n    \n    NSString *rowH2Constraint = @\"H:|-15-[_transition3Btn(\u003e=100)]-15-[_transition4Btn(==_transition1Btn)]-15-|\";\n\n    NSString *rowV1Constraint = @\"V:|-175-[_transition1Btn(==50)]-50-[_transition3Btn(==_transition1Btn)]\";\n    \n    NSString *rowV2Constraint = @\"V:|-175-[_transition2Btn(==_transition1Btn)]-50-[_transition4Btn(==_transition1Btn)]\";\n    \n    [self.view addConstraints: [NSLayoutConstraint\n                                constraintsWithVisualFormat:rowH1Constraint\n                                options:0\n                                metrics:nil\n                                views:viewDictionary]];\n\n    [self.view addConstraints: [NSLayoutConstraint\n                                constraintsWithVisualFormat:rowH2Constraint\n                                options:0\n                                metrics:nil\n                                views:viewDictionary]];\n    \n    [self.view addConstraints: [NSLayoutConstraint\n                                constraintsWithVisualFormat:rowV1Constraint\n                                options:0\n                                metrics:nil\n                                views:viewDictionary]];\n\n    [self.view addConstraints: [NSLayoutConstraint\n                                constraintsWithVisualFormat:rowV2Constraint\n                                options:0\n                                metrics:nil\n                                views:viewDictionary]];\n\n\n}\n\n\u003c/pre\u003e\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmelling%2Fnoniballcode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmelling%2Fnoniballcode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmelling%2Fnoniballcode/lists"}