Storyboards Slides

Preview:

DESCRIPTION

 

Citation preview

Storyboards

@techieGary

Tuesday, January 17, 12

IDE

Tuesday, January 17, 12

Control - Drag

Tuesday, January 17, 12

Connections

Relationship

Modal

Push

Custom

Tuesday, January 17, 12

Top Level Objects

Tuesday, January 17, 12

What Changed?

• AppDelegate inherits from UIResponder

• UIWindow is not an outlet

• main.m - last param StringFromClass([AppDeletate Class])

Tuesday, January 17, 12

What Changed?

• didFinishLaunching... Returns YES;

• Can store objects in App Delegate but will need to drill down to access (*)self.window.rootViewController;

• info.plist/settings file adds Main storyboard file UIMainStoryboardFile

Tuesday, January 17, 12

Build an App

Tuesday, January 17, 12

Initial View Controller

First View on ScreenFirst View on Screen

1.1.

2.2.

Tuesday, January 17, 12

Dynamic

Tuesday, January 17, 12

Static

Tuesday, January 17, 12

UITableView Cells

Basic

Right Detail

Left Detail

Subtitle

Tuesday, January 17, 12

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ static NSString *CellIdentifier = @"GameCell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; } cell.textLabel.text = [games objectAtIndex:indexPath.row]; return cell;}

Tuesday, January 17, 12

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"GameCell"];

cell.textLabel.text = [games objectAtIndex:indexPath.row]; return cell;}

Tuesday, January 17, 12

Gotchas!

Tuesday, January 17, 12

Identifier All Segues

Tuesday, January 17, 12

Add Identifier to UITableViewCell

Tuesday, January 17, 12

Don’t forget...- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{ if ([segue.identifier isEqualToString:@"PickGame"]) {

GamePickerViewController *gamePickerViewController = segue.destinationViewController;

gamePickerViewController.delegate = self; gamePickerViewController.game = game; }}

Tuesday, January 17, 12

One More Thing...;)

[self performSegueWithIdentifier:@"SegueRegister" sender:nil];

Tuesday, January 17, 12

Hands On!

Tuesday, January 17, 12

Follow:@MobileDevNJ@TechieGary

Tuesday, January 17, 12