Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
iOS Training                             Part 2                            Sam Kirchmeier                           sam@li...
Getting Started                    •MobileMarch_Part_2_Start                    •https://github.com/skirchmeier/          ...
•MobileMarch_Part_2_Start                    •https://github.com/skirchmeier/                          mobilemarch-2012-io...
Topics                    •Storyboards                    •Navigation Controllers                    •Table View Controlle...
Goals                    1. Display a list of tomorrow’s sessions                    2. Display a live Twitter feed       ...
StoryboardsTuesday, March 20, 2012
Scenes                          View Controllers                           Segues                            TransitionsTu...
Tuesday, March 20, 2012
SceneTuesday, March 20, 2012
Segue                          SceneTuesday, March 20, 2012
Segues                 Old Way                  - (IBAction)showAboutView:(id)sender                  {                   ...
DemoTuesday, March 20, 2012
Goal #1                Display a list of sessionsTuesday, March 20, 2012
Navigation ControllerTuesday, March 20, 2012
Tuesday, March 20, 2012
Tuesday, March 20, 2012
View Controller 1   View Controller 2Tuesday, March 20, 2012
DemoTuesday, March 20, 2012
Table View ControllerTuesday, March 20, 2012
Tuesday, March 20, 2012
Tuesday, March 20, 2012
Navigation ControllerTuesday, March 20, 2012
Navigation Controller                          View ControllerTuesday, March 20, 2012
Navigation Controller                          View Controller                            Table ViewTuesday, March 20, 2012
Navigation Controller   Navigation Controller                          View Controller    Table View Controller           ...
Navigation Controller                          View Controller                            Table ViewTuesday, March 20, 2012
Navigation Controller                          View Controller                            Table View                      ...
Navigation Controller                          View Controller                            Table View                      ...
Navigation Controller                          View Controller                            Table View                      ...
Navigation Controller                          View Controller                                             UITableViewData...
Navigation Controller                          Table View Controller                               Table View             ...
Navigation Controller                          Table View Controller                               Table View             ...
UITableViewDataSource         - (NSInteger)tableView:(UITableView *)tableView           numberOfRowsInSection:(NSInteger)s...
UITableViewDelegate                          – tableView:didSelectRowAtIndexPath:                          – tableView:hei...
UITableViewCellTuesday, March 20, 2012
BasicTuesday, March 20, 2012
Right DetailTuesday, March 20, 2012
Left DetailTuesday, March 20, 2012
SubtitleTuesday, March 20, 2012
DemoTuesday, March 20, 2012
Goal #2                Display a Twitter feedTuesday, March 20, 2012
Twitter FrameworkTuesday, March 20, 2012
TWRequest          TWRequest *request = [[TWRequest alloc]                                   initWithURL:URL              ...
Request Handler Block                          ^(NSData *responseData,                            NSHTTPURLResponse *urlRe...
Threads              [request performRequestWithHandler: Request Handler Block ];                                    This ...
Danger           Request Handler Block           ^(NSData *responseData,             NSHTTPURLResponse *urlResponse,      ...
OK           Request Handler Block           ^(NSData *responseData,             NSHTTPURLResponse *urlResponse,          ...
JSON                          Twitter Request                          GET http://search.twitter.com/search.json          ...
Twitter Response                                                             NSData                      [NSJSONSerializat...
DemoTuesday, March 20, 2012
Next Steps                    •Start your own app!                    •Apple’s Getting Started Guide                    •A...
#prowess                      Sam Kirchmeier, Livefront                             @skirchmeier                 Bob McCun...
Upcoming SlideShare
Loading in …5
×

Beginning i os part 2 sam kirchmeier

1,152 views

Published on

Mobile March 2012

Published in: Technology, News & Politics
  • Be the first to comment

Beginning i os part 2 sam kirchmeier

  1. 1. iOS Training Part 2 Sam Kirchmeier sam@livefront.com @skirchmeierTuesday, March 20, 2012
  2. 2. Getting Started •MobileMarch_Part_2_Start •https://github.com/skirchmeier/ mobilemarch-2012-iosTuesday, March 20, 2012
  3. 3. •MobileMarch_Part_2_Start •https://github.com/skirchmeier/ mobilemarch-2012-iosTuesday, March 20, 2012
  4. 4. Topics •Storyboards •Navigation Controllers •Table View ControllersTuesday, March 20, 2012
  5. 5. Goals 1. Display a list of tomorrow’s sessions 2. Display a live Twitter feed 3. Bask in the glory of our iOS prowessTuesday, March 20, 2012
  6. 6. StoryboardsTuesday, March 20, 2012
  7. 7. Scenes View Controllers Segues TransitionsTuesday, March 20, 2012
  8. 8. Tuesday, March 20, 2012
  9. 9. SceneTuesday, March 20, 2012
  10. 10. Segue SceneTuesday, March 20, 2012
  11. 11. Segues Old Way - (IBAction)showAboutView:(id)sender { // Use presentModalViewController to // display the view controller. } New Way - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { // Grab a reference to the view controller via // [segue destinationViewController]. }Tuesday, March 20, 2012
  12. 12. DemoTuesday, March 20, 2012
  13. 13. Goal #1 Display a list of sessionsTuesday, March 20, 2012
  14. 14. Navigation ControllerTuesday, March 20, 2012
  15. 15. Tuesday, March 20, 2012
  16. 16. Tuesday, March 20, 2012
  17. 17. View Controller 1 View Controller 2Tuesday, March 20, 2012
  18. 18. DemoTuesday, March 20, 2012
  19. 19. Table View ControllerTuesday, March 20, 2012
  20. 20. Tuesday, March 20, 2012
  21. 21. Tuesday, March 20, 2012
  22. 22. Navigation ControllerTuesday, March 20, 2012
  23. 23. Navigation Controller View ControllerTuesday, March 20, 2012
  24. 24. Navigation Controller View Controller Table ViewTuesday, March 20, 2012
  25. 25. Navigation Controller Navigation Controller View Controller Table View Controller Table View Table View Built InTuesday, March 20, 2012
  26. 26. Navigation Controller View Controller Table ViewTuesday, March 20, 2012
  27. 27. Navigation Controller View Controller Table View Data Source DelegateTuesday, March 20, 2012
  28. 28. Navigation Controller View Controller Table View Data Source Object Number of rows Data Source Number of sections Data to display in each row DelegateTuesday, March 20, 2012
  29. 29. Navigation Controller View Controller Table View Data Source Object Number of rows Data Source Number of sections Data to display in each row Delegate Object Handle touch events Delegate Header and footer views Rearrange rowsTuesday, March 20, 2012
  30. 30. Navigation Controller View Controller UITableViewDataSource Table View Data Source Object Number of rows Data Source Number of sections Data to display in each row UITableViewDelegate Delegate Object Handle touch events Delegate Header and footer views Rearrange rowsTuesday, March 20, 2012
  31. 31. Navigation Controller Table View Controller Table View Built InTuesday, March 20, 2012
  32. 32. Navigation Controller Table View Controller Table View Built In Data Source DelegateTuesday, March 20, 2012
  33. 33. 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
  34. 34. UITableViewDelegate – tableView:didSelectRowAtIndexPath: – tableView:heightForRowAtIndexPath: – tableView:viewForHeaderInSection: – tableView:viewForFooterInSection: (and lots more)Tuesday, March 20, 2012
  35. 35. UITableViewCellTuesday, March 20, 2012
  36. 36. BasicTuesday, March 20, 2012
  37. 37. Right DetailTuesday, March 20, 2012
  38. 38. Left DetailTuesday, March 20, 2012
  39. 39. SubtitleTuesday, March 20, 2012
  40. 40. DemoTuesday, March 20, 2012
  41. 41. Goal #2 Display a Twitter feedTuesday, March 20, 2012
  42. 42. Twitter FrameworkTuesday, March 20, 2012
  43. 43. TWRequest TWRequest *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
  44. 44. Request Handler Block ^(NSData *responseData, NSHTTPURLResponse *urlResponse, NSError *error) { // Invoked after the response is complete. // Parse response and display tweets. } [request performRequestWithHandler: Request Handler Block ];Tuesday, March 20, 2012
  45. 45. Threads [request performRequestWithHandler: Request Handler Block ]; This handler is not guaranteed to be called on any particular thread. AppleTuesday, March 20, 2012
  46. 46. Danger Request Handler Block ^(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]; }Tuesday, March 20, 2012
  47. 47. OK Request Handler Block ^(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]; }Tuesday, March 20, 2012
  48. 48. JSON Twitter Request GET http://search.twitter.com/search.json Twitter Response { "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: ...", ...Tuesday, March 20, 2012
  49. 49. Twitter Response NSData [NSJSONSerialization JSONObjectWithData: Twitter Response NSData options:0 error:&error]; Twitter Response NSDictionaryTuesday, March 20, 2012
  50. 50. DemoTuesday, March 20, 2012
  51. 51. Next Steps •Start your own app! •Apple’s Getting Started Guide •Apple’s Sample Code •WWDC VideosTuesday, March 20, 2012
  52. 52. #prowess Sam Kirchmeier, Livefront @skirchmeier Bob McCune, TapHarmonic @bobmccuneTuesday, March 20, 2012

×