Upgrade to Pro — share decks privately, control downloads, hide ads and more …

20150225_iqon.pdf

 20150225_iqon.pdf

iQON iOS

3d5e25f0ab058f8c44419c1ae41be86e?s=128

WorldDownTown

February 25, 2015
Tweet

Transcript

  1. iQON

  2. None
  3. App Store BEST of 2012 App Store "Essential"

  4. Index 1. Storyboard 2. UITableView 3. Transitioning Animation

  5. 1. Storyboard

  6. 96 ViewControllers

  7. Past 1 Storyboard / 96 VC

  8. Now 1 Storyboard / 1 VC

  9. Advantage • conflict͠ʹ͘͘ͳͬͨ • ʮViewController͕ݟ͔ͭΒͳ͍ʯͱ͍͏͜ͱ͕ͳ͘ͳͬͨ

  10. Disadvantage • Segue͕࢖͑ͳ͍

  11. But ... • Segueͩͱσʔλ͕౉ͮ͠Β͍ - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { if

    ([segue.identifier isEqualToString:NSStringFromClass([UserDetailViewController class])]) { UserDetailViewController *vc = segue.destinationViewController; vc.userId = self.userId; } } • ҰͭͷVCΛෳ਺ͷVC͔ΒSegueͰܨ͙ͱΧΦεʹͳΔ
  12. Advantage > Disadvantage

  13. None
  14. 2. UITableView

  15. None
  16. None
  17. Past 1 Card / 1 Cell

  18. Bad Performance

  19. Now 1 Card / 1 Section

  20. None
  21. 1 Card / 1 Section / N Cells

  22. 1 Card / 1 Section / N Cells ɹ 1ͭ1ͭͷηϧͷߴ͕͞খ͘͞ͳΔ

    ↓ ηϧͷੜ੒ύϑΥʔϚϯε޲্ ↓ εΫϩʔϧύϑΥʔϚϯε޲্
  23. None
  24. UITableViewDataSource ≠ ViewController

  25. None
  26. Past UITableViewDataSource == ViewController SetListViewController : 1000 lines SetSearchViewController :

    1100 lines
  27. Now UITableViewDataSource == SetListDataSource SetListViewController : 150 lines SetSearchViewController :

    250 lines SetListDataSource : 800 lines
  28. ࣅͨσβΠϯͷVCʹ͓͍ͯ UITableViewDataSource, UITableViewDelegate ͷ ࣮૷͕ҰՕॴʹͳͬͨ ↓ ίʔυྔݮগ && ࠶ར༻ੑ޲্

  29. None
  30. 3. Transitioning Animation

  31. None
  32. Ξχϝʔγϣϯ͸VC಺Ͱ࣮૷ͤͣʹ Ξχϝʔγϣϯઐ༻Ϋϥεʹ೚ͤΔ

  33. UIViewControllerAnimatedTransitioning ɹ UIViewControllerTransitioningDelegate

  34. UIViewControllerAnimatedTransitioning • ը໘ભҠΞχϝʔγϣϯॲཧͰݺͼग़͞ΕΔϝιουͷϓϩ τίϧ UIViewControllerTransitioningDelegate • ը໘ભҠͷσϦήʔτ

  35. // BlurTransition.h @interface BlurTransition : NSObject <UIViewControllerAnimatedTransitioning, UIViewControllerTransitioningDelegate> @end //

    BlurTransition.m // ׂѪ BlurTransition.h BlurTransition.m
  36. // BlurViewController.m (ભҠઌͷVC) - (void)sharedInit { [super sharedInit]; _transition =

    [BlurTransition new]; self.transitioningDelegate = _transition; } // SomeViewController.m (ભҠݩͷVC) BlurViewController *vc = [BlurViewController new]; [self presentViewController:vc animated:yes]; // ը໘ભҠ࣌͸௨ৗͷϞʔμϧදࣔͱಉ࣮͡૷
  37. Advantage • ෳࡶͳΞχϝʔγϣϯॲཧ͸TransitionΫϥεʹ೚ͤͯɺVC ͸ભҠ͢Δ͜ͱ͚ͩʹूதͰ͖Δ • ࠶ར༻΋؆୯