beginning i os part 2 sam kirchmeier
DESCRIPTION
Mobile March 2012TRANSCRIPT
![Page 1: Beginning i os part 2 sam kirchmeier](https://reader037.vdocument.in/reader037/viewer/2022102901/554f59efb4c905524c8b5426/html5/thumbnails/1.jpg)
iOS TrainingPart 2
@skirchmeier
Tuesday, March 20, 2012
![Page 2: Beginning i os part 2 sam kirchmeier](https://reader037.vdocument.in/reader037/viewer/2022102901/554f59efb4c905524c8b5426/html5/thumbnails/2.jpg)
Getting Started
•MobileMarch_Part_2_Start
•https://github.com/skirchmeier/mobilemarch-2012-ios
Tuesday, March 20, 2012
![Page 3: Beginning i os part 2 sam kirchmeier](https://reader037.vdocument.in/reader037/viewer/2022102901/554f59efb4c905524c8b5426/html5/thumbnails/3.jpg)
•MobileMarch_Part_2_Start
•https://github.com/skirchmeier/mobilemarch-2012-ios
Tuesday, March 20, 2012
![Page 4: Beginning i os part 2 sam kirchmeier](https://reader037.vdocument.in/reader037/viewer/2022102901/554f59efb4c905524c8b5426/html5/thumbnails/4.jpg)
Topics
•Storyboards
•Navigation Controllers
•Table View Controllers
Tuesday, March 20, 2012
![Page 5: Beginning i os part 2 sam kirchmeier](https://reader037.vdocument.in/reader037/viewer/2022102901/554f59efb4c905524c8b5426/html5/thumbnails/5.jpg)
Goals
1. Display a list of tomorrow’s sessions
2. Display a live Twitter feed
3. Bask in the glory of our iOS prowess
Tuesday, March 20, 2012
![Page 6: Beginning i os part 2 sam kirchmeier](https://reader037.vdocument.in/reader037/viewer/2022102901/554f59efb4c905524c8b5426/html5/thumbnails/6.jpg)
Storyboards
Tuesday, March 20, 2012
![Page 7: Beginning i os part 2 sam kirchmeier](https://reader037.vdocument.in/reader037/viewer/2022102901/554f59efb4c905524c8b5426/html5/thumbnails/7.jpg)
ScenesView Controllers
SeguesTransitions
Tuesday, March 20, 2012
![Page 8: Beginning i os part 2 sam kirchmeier](https://reader037.vdocument.in/reader037/viewer/2022102901/554f59efb4c905524c8b5426/html5/thumbnails/8.jpg)
Tuesday, March 20, 2012
![Page 9: Beginning i os part 2 sam kirchmeier](https://reader037.vdocument.in/reader037/viewer/2022102901/554f59efb4c905524c8b5426/html5/thumbnails/9.jpg)
Scene
Tuesday, March 20, 2012
![Page 10: Beginning i os part 2 sam kirchmeier](https://reader037.vdocument.in/reader037/viewer/2022102901/554f59efb4c905524c8b5426/html5/thumbnails/10.jpg)
Scene
Segue
Tuesday, March 20, 2012
![Page 11: Beginning i os part 2 sam kirchmeier](https://reader037.vdocument.in/reader037/viewer/2022102901/554f59efb4c905524c8b5426/html5/thumbnails/11.jpg)
Segues- (IBAction)showAboutView:(id)sender{ // Use presentModalViewController to // display the view controller.}
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{ // Grab a reference to the view controller via // [segue destinationViewController].}
Old Way
New Way
Tuesday, March 20, 2012
![Page 12: Beginning i os part 2 sam kirchmeier](https://reader037.vdocument.in/reader037/viewer/2022102901/554f59efb4c905524c8b5426/html5/thumbnails/12.jpg)
Demo
Tuesday, March 20, 2012
![Page 13: Beginning i os part 2 sam kirchmeier](https://reader037.vdocument.in/reader037/viewer/2022102901/554f59efb4c905524c8b5426/html5/thumbnails/13.jpg)
Goal #1Display a list of sessions
Tuesday, March 20, 2012
![Page 14: Beginning i os part 2 sam kirchmeier](https://reader037.vdocument.in/reader037/viewer/2022102901/554f59efb4c905524c8b5426/html5/thumbnails/14.jpg)
Navigation Controller
Tuesday, March 20, 2012
![Page 15: Beginning i os part 2 sam kirchmeier](https://reader037.vdocument.in/reader037/viewer/2022102901/554f59efb4c905524c8b5426/html5/thumbnails/15.jpg)
Tuesday, March 20, 2012
![Page 16: Beginning i os part 2 sam kirchmeier](https://reader037.vdocument.in/reader037/viewer/2022102901/554f59efb4c905524c8b5426/html5/thumbnails/16.jpg)
Tuesday, March 20, 2012
![Page 17: Beginning i os part 2 sam kirchmeier](https://reader037.vdocument.in/reader037/viewer/2022102901/554f59efb4c905524c8b5426/html5/thumbnails/17.jpg)
View Controller 1 View Controller 2
Tuesday, March 20, 2012
![Page 18: Beginning i os part 2 sam kirchmeier](https://reader037.vdocument.in/reader037/viewer/2022102901/554f59efb4c905524c8b5426/html5/thumbnails/18.jpg)
Demo
Tuesday, March 20, 2012
![Page 19: Beginning i os part 2 sam kirchmeier](https://reader037.vdocument.in/reader037/viewer/2022102901/554f59efb4c905524c8b5426/html5/thumbnails/19.jpg)
Table View Controller
Tuesday, March 20, 2012
![Page 20: Beginning i os part 2 sam kirchmeier](https://reader037.vdocument.in/reader037/viewer/2022102901/554f59efb4c905524c8b5426/html5/thumbnails/20.jpg)
Tuesday, March 20, 2012
![Page 21: Beginning i os part 2 sam kirchmeier](https://reader037.vdocument.in/reader037/viewer/2022102901/554f59efb4c905524c8b5426/html5/thumbnails/21.jpg)
Tuesday, March 20, 2012
![Page 22: Beginning i os part 2 sam kirchmeier](https://reader037.vdocument.in/reader037/viewer/2022102901/554f59efb4c905524c8b5426/html5/thumbnails/22.jpg)
Navigation Controller
Tuesday, March 20, 2012
![Page 23: Beginning i os part 2 sam kirchmeier](https://reader037.vdocument.in/reader037/viewer/2022102901/554f59efb4c905524c8b5426/html5/thumbnails/23.jpg)
Navigation Controller
View Controller
Tuesday, March 20, 2012
![Page 24: Beginning i os part 2 sam kirchmeier](https://reader037.vdocument.in/reader037/viewer/2022102901/554f59efb4c905524c8b5426/html5/thumbnails/24.jpg)
Navigation Controller
View Controller
Table View
Tuesday, March 20, 2012
![Page 25: Beginning i os part 2 sam kirchmeier](https://reader037.vdocument.in/reader037/viewer/2022102901/554f59efb4c905524c8b5426/html5/thumbnails/25.jpg)
Navigation Controller
View Controller
Table View
Navigation Controller
Table View Controller
Table ViewBuilt In
Tuesday, March 20, 2012
![Page 26: Beginning i os part 2 sam kirchmeier](https://reader037.vdocument.in/reader037/viewer/2022102901/554f59efb4c905524c8b5426/html5/thumbnails/26.jpg)
Navigation Controller
View Controller
Table View
Tuesday, March 20, 2012
![Page 27: Beginning i os part 2 sam kirchmeier](https://reader037.vdocument.in/reader037/viewer/2022102901/554f59efb4c905524c8b5426/html5/thumbnails/27.jpg)
Navigation Controller
View Controller
Table View
Delegate
Data Source
Tuesday, March 20, 2012
![Page 28: Beginning i os part 2 sam kirchmeier](https://reader037.vdocument.in/reader037/viewer/2022102901/554f59efb4c905524c8b5426/html5/thumbnails/28.jpg)
Navigation Controller
View Controller
Table View
Delegate
Data SourceData Source Object
Number of rowsNumber of sections
Data to display in each row
Tuesday, March 20, 2012
![Page 29: Beginning i os part 2 sam kirchmeier](https://reader037.vdocument.in/reader037/viewer/2022102901/554f59efb4c905524c8b5426/html5/thumbnails/29.jpg)
Navigation Controller
View Controller
Table View
Delegate ObjectHandle touch events
Header and footer viewsRearrange rows
Delegate
Data SourceData Source Object
Number of rowsNumber of sections
Data to display in each row
Tuesday, March 20, 2012
![Page 30: Beginning i os part 2 sam kirchmeier](https://reader037.vdocument.in/reader037/viewer/2022102901/554f59efb4c905524c8b5426/html5/thumbnails/30.jpg)
Navigation Controller
View Controller
Table View
Delegate ObjectHandle touch events
Header and footer viewsRearrange rows
Delegate
Data SourceData Source Object
Number of rowsNumber of sections
Data to display in each row
UITableViewDataSource
UITableViewDelegate
Tuesday, March 20, 2012
![Page 31: Beginning i os part 2 sam kirchmeier](https://reader037.vdocument.in/reader037/viewer/2022102901/554f59efb4c905524c8b5426/html5/thumbnails/31.jpg)
Navigation Controller
Table View Controller
Table ViewBuilt In
Tuesday, March 20, 2012
![Page 32: Beginning i os part 2 sam kirchmeier](https://reader037.vdocument.in/reader037/viewer/2022102901/554f59efb4c905524c8b5426/html5/thumbnails/32.jpg)
Navigation Controller
Table View Controller
Table ViewBuilt In
Data Source
Delegate
Tuesday, March 20, 2012
![Page 33: Beginning i os part 2 sam kirchmeier](https://reader037.vdocument.in/reader037/viewer/2022102901/554f59efb4c905524c8b5426/html5/thumbnails/33.jpg)
UITableViewDataSource- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ // Return the number of rows here.}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
// Configure the cell here. return cell;}
Tuesday, March 20, 2012
![Page 34: Beginning i os part 2 sam kirchmeier](https://reader037.vdocument.in/reader037/viewer/2022102901/554f59efb4c905524c8b5426/html5/thumbnails/34.jpg)
UITableViewDelegate– tableView:didSelectRowAtIndexPath:
– tableView:heightForRowAtIndexPath:
– tableView:viewForHeaderInSection:
– tableView:viewForFooterInSection:
(and lots more)
Tuesday, March 20, 2012
![Page 35: Beginning i os part 2 sam kirchmeier](https://reader037.vdocument.in/reader037/viewer/2022102901/554f59efb4c905524c8b5426/html5/thumbnails/35.jpg)
UITableViewCell
Tuesday, March 20, 2012
![Page 36: Beginning i os part 2 sam kirchmeier](https://reader037.vdocument.in/reader037/viewer/2022102901/554f59efb4c905524c8b5426/html5/thumbnails/36.jpg)
Basic
Tuesday, March 20, 2012
![Page 37: Beginning i os part 2 sam kirchmeier](https://reader037.vdocument.in/reader037/viewer/2022102901/554f59efb4c905524c8b5426/html5/thumbnails/37.jpg)
Right Detail
Tuesday, March 20, 2012
![Page 38: Beginning i os part 2 sam kirchmeier](https://reader037.vdocument.in/reader037/viewer/2022102901/554f59efb4c905524c8b5426/html5/thumbnails/38.jpg)
Left Detail
Tuesday, March 20, 2012
![Page 39: Beginning i os part 2 sam kirchmeier](https://reader037.vdocument.in/reader037/viewer/2022102901/554f59efb4c905524c8b5426/html5/thumbnails/39.jpg)
Subtitle
Tuesday, March 20, 2012
![Page 40: Beginning i os part 2 sam kirchmeier](https://reader037.vdocument.in/reader037/viewer/2022102901/554f59efb4c905524c8b5426/html5/thumbnails/40.jpg)
Demo
Tuesday, March 20, 2012
![Page 41: Beginning i os part 2 sam kirchmeier](https://reader037.vdocument.in/reader037/viewer/2022102901/554f59efb4c905524c8b5426/html5/thumbnails/41.jpg)
Goal #2Display a Twitter feed
Tuesday, March 20, 2012
![Page 42: Beginning i os part 2 sam kirchmeier](https://reader037.vdocument.in/reader037/viewer/2022102901/554f59efb4c905524c8b5426/html5/thumbnails/42.jpg)
Twitter Framework
Tuesday, March 20, 2012
![Page 43: Beginning i os part 2 sam kirchmeier](https://reader037.vdocument.in/reader037/viewer/2022102901/554f59efb4c905524c8b5426/html5/thumbnails/43.jpg)
TWRequestTWRequest *request = [[TWRequest alloc] initWithURL:URL parameters:parameters requestMethod:TWRequestMethodGET];
[request performRequestWithHandler:^( NSData *responseData, NSHTTPURLResponse *urlResponse, NSError *error){ // Invoked after the response is complete. // Parse response and display tweets.}];
Tuesday, March 20, 2012
![Page 44: Beginning i os part 2 sam kirchmeier](https://reader037.vdocument.in/reader037/viewer/2022102901/554f59efb4c905524c8b5426/html5/thumbnails/44.jpg)
^(NSData *responseData, NSHTTPURLResponse *urlResponse, NSError *error){ // Invoked after the response is complete. // Parse response and display tweets.}
Request Handler Block
[request performRequestWithHandler: ];Request Handler Block
Tuesday, March 20, 2012
![Page 45: Beginning i os part 2 sam kirchmeier](https://reader037.vdocument.in/reader037/viewer/2022102901/554f59efb4c905524c8b5426/html5/thumbnails/45.jpg)
Threads[request performRequestWithHandler: ];Request Handler Block
This handler is not guaranteed to be called on any particular
thread.
Apple
Tuesday, March 20, 2012
![Page 46: Beginning i os part 2 sam kirchmeier](https://reader037.vdocument.in/reader037/viewer/2022102901/554f59efb4c905524c8b5426/html5/thumbnails/46.jpg)
Danger^(NSData *responseData, NSHTTPURLResponse *urlResponse, NSError *error){ // Parse the Twitter response. ...
// Assign an array of tweets to our tweets property. ...
// Reload the table view. // This might not work! [self.tableView reloadData];}
Request Handler Block
Tuesday, March 20, 2012
![Page 47: Beginning i os part 2 sam kirchmeier](https://reader037.vdocument.in/reader037/viewer/2022102901/554f59efb4c905524c8b5426/html5/thumbnails/47.jpg)
OK^(NSData *responseData, NSHTTPURLResponse *urlResponse, NSError *error){ // Parse the Twitter response. ...
// Assign an array of tweets to our tweets property. ...
// Reload the table view. This will work! [self.tableView performSelectorOnMainThread:@selector(reloadData) withObject:nil waitUntilDone:NO];}
Request Handler Block
Tuesday, March 20, 2012
![Page 48: Beginning i os part 2 sam kirchmeier](https://reader037.vdocument.in/reader037/viewer/2022102901/554f59efb4c905524c8b5426/html5/thumbnails/48.jpg)
JSON
{ "completed_in": 0.108, "page": 1, "results_per_page": 100, "query": "%23mobilemarch+OR+%40mobilemarchtc", ... "results": [ { "created_at": "Thu, 15 Mar 2012 16:41:16 +0000", "from_user": "teruterubouzu", "text": "@mobilemarchtc How late ...", ... }, { "created_at": "Thu, 15 Mar 2012 14:20:49 +0000", "from_user": "billyspringer", "text": "RT @smbmsp: RT @philson: ...", ...
Twitter RequestGET http://search.twitter.com/search.json
Twitter Response
Tuesday, March 20, 2012
![Page 49: Beginning i os part 2 sam kirchmeier](https://reader037.vdocument.in/reader037/viewer/2022102901/554f59efb4c905524c8b5426/html5/thumbnails/49.jpg)
Twitter ResponseNSData
[NSJSONSerialization JSONObjectWithData: options:0 error:&error];
Twitter Response NSData
Twitter ResponseNSDictionary
Tuesday, March 20, 2012
![Page 50: Beginning i os part 2 sam kirchmeier](https://reader037.vdocument.in/reader037/viewer/2022102901/554f59efb4c905524c8b5426/html5/thumbnails/50.jpg)
Demo
Tuesday, March 20, 2012
![Page 51: Beginning i os part 2 sam kirchmeier](https://reader037.vdocument.in/reader037/viewer/2022102901/554f59efb4c905524c8b5426/html5/thumbnails/51.jpg)
Next Steps
•Start your own app!
•Apple’s Getting Started Guide
•Apple’s Sample Code
•WWDC Videos
Tuesday, March 20, 2012
![Page 52: Beginning i os part 2 sam kirchmeier](https://reader037.vdocument.in/reader037/viewer/2022102901/554f59efb4c905524c8b5426/html5/thumbnails/52.jpg)
#prowess
Sam Kirchmeier, Livefront@skirchmeier
Bob McCune, TapHarmonic@bobmccune
Tuesday, March 20, 2012