SlideShare une entreprise Scribd logo
1  sur  25
Avoiding oversized
 view controllers
      in iOS

 Stewart Gleadow
 Email:
 sgleadow@thoughtworks.com

 Twitter:
 @stewgleadow
What makes a class
easy to maintain?
UIView


UIViewController


                   Model
What makes a
controller easy to
    maintain?
UIViewController

- (id)init;

-   (void)loadView;
-   (void)viewDidLoad;
-   (void)viewWillAppear:(BOOL);
-   (void)viewDidAppear:(BOOL);

- (void)viewWillDisappear:(BOOL);
- (void)viewDidDisappear: (BOOL);
- (void)viewDidUnload;

- (void)dealloc;
UIViewController

- (id)init;

-   (void)loadView;
-   (void)viewDidLoad;
-   (void)viewWillAppear:(BOOL);
-   (void)viewDidAppear:(BOOL);

- (void)viewWillDisappear:(BOOL);
- (void)viewDidDisappear: (BOOL);
- (void)viewDidUnload;

- (void)dealloc;
UIViewController

- (id)init;

-   (void)loadView;
-   (void)viewDidLoad;
-   (void)viewWillAppear:(BOOL);
-   (void)viewDidAppear:(BOOL);

- (void)viewWillDisappear:(BOOL);
- (void)viewDidDisappear: (BOOL);
- (void)viewDidUnload;

- (void)dealloc;
- (id)init;
{
  if ((self = [super init]))
  {
    // create data related objects
  }

    return self;
}

- (void)dealloc;
{
  // release any data related objects

    [super dealloc];
}
- (void)loadView;
{
  [super loadView];

    // create all your views

    // assign delegates
}

- (void)viewDidUnload;
{
  // release any view related

    [super viewDidUnload];
}
@interface MatchViewController : UIViewController

  <UITableViewDelegate,
  UITableViewDataSource,
  UIScrollViewDelegate,
  TTModelDelegate,
  ...>
Coordinated Views

       View One



       View Two




       View Three
Coordinator

- (id)init;

- (UIView *)view;
- (void)releaseView;

- (void)dealloc;
ViewController               Coordinator

- (id)init;                         - (id)init;

-   (void)loadView;                 - (UIView *)view;
-   (void)viewDidLoad;              - (void)releaseView;
-   (void)viewWillAppear:(BOOL);
-   (void)viewDidAppear:(BOOL);     - (void)dealloc;

- (void)viewWillDisappear:(BOOL);
- (void)viewDidDisappear: (BOOL);
- (void)viewDidUnload;

- (void)dealloc;
ViewController               Coordinator

- (id)init;                         - (id)init;

-   (void)loadView;                 - (UIView *)view;
-   (void)viewDidLoad;              - (void)releaseView;
-   (void)viewWillAppear:(BOOL);
-   (void)viewDidAppear:(BOOL);     - (void)dealloc;

- (void)viewWillDisappear:(BOOL);
- (void)viewDidDisappear: (BOOL);
- (void)viewDidUnload;

- (void)dealloc;
ViewController               Coordinator

- (id)init;                         - (id)init;

-   (void)loadView;                 - (UIView *)view;
-   (void)viewDidLoad;              - (void)releaseView;
-   (void)viewWillAppear:(BOOL);
-   (void)viewDidAppear:(BOOL);     - (void)dealloc;

- (void)viewWillDisappear:(BOOL);
- (void)viewDidDisappear: (BOOL);
- (void)viewDidUnload;

- (void)dealloc;
Demo
Stewart Gleadow
Email:
sgleadow@thoughtworks.com

Twitter:
@stewgleadow

Contenu connexe

Similaire à iOS View Coordinators

Creating Container View Controllers
Creating Container View ControllersCreating Container View Controllers
Creating Container View ControllersBob McCune
 
UIViewControllerのコーナーケース
UIViewControllerのコーナーケースUIViewControllerのコーナーケース
UIViewControllerのコーナーケースKatsumi Kishikawa
 
ITB2016 Converting Legacy Apps into Modern MVC
ITB2016 Converting Legacy Apps into Modern MVCITB2016 Converting Legacy Apps into Modern MVC
ITB2016 Converting Legacy Apps into Modern MVCOrtus Solutions, Corp
 
Formacion en movilidad: Conceptos de desarrollo en iOS (III)
Formacion en movilidad: Conceptos de desarrollo en iOS (III) Formacion en movilidad: Conceptos de desarrollo en iOS (III)
Formacion en movilidad: Conceptos de desarrollo en iOS (III) Mobivery
 
Apple Templates Considered Harmful
Apple Templates Considered HarmfulApple Templates Considered Harmful
Apple Templates Considered HarmfulBrian Gesiak
 
Utilising View Controllers
Utilising View ControllersUtilising View Controllers
Utilising View Controllersdanielctull
 
Using view controllers wisely
Using view controllers wiselyUsing view controllers wisely
Using view controllers wiselydefagos
 
ApplicationCoordinator для навигации между экранами / Павел Гуров (Avito)
ApplicationCoordinator для навигации между экранами / Павел Гуров (Avito)ApplicationCoordinator для навигации между экранами / Павел Гуров (Avito)
ApplicationCoordinator для навигации между экранами / Павел Гуров (Avito)Ontico
 
iOS: Implementing a Custom View
iOS: Implementing a Custom ViewiOS: Implementing a Custom View
iOS: Implementing a Custom ViewJussi Pohjolainen
 
View controller life cycle
View controller life cycleView controller life cycle
View controller life cycleSV.CO
 
Daniel Jalkut - dotSwift 2019
Daniel Jalkut - dotSwift 2019Daniel Jalkut - dotSwift 2019
Daniel Jalkut - dotSwift 2019DanielJalkut
 
Building impressive layout systems with vaadin
Building impressive layout systems with vaadinBuilding impressive layout systems with vaadin
Building impressive layout systems with vaadinPeter Lehto
 
iOSインタラクションデザイン
iOSインタラクションデザインiOSインタラクションデザイン
iOSインタラクションデザインhIDDENxv
 

Similaire à iOS View Coordinators (20)

Creating Container View Controllers
Creating Container View ControllersCreating Container View Controllers
Creating Container View Controllers
 
I os 11
I os 11I os 11
I os 11
 
UIViewControllerのコーナーケース
UIViewControllerのコーナーケースUIViewControllerのコーナーケース
UIViewControllerのコーナーケース
 
NongBeer MVP Demo application
NongBeer MVP Demo applicationNongBeer MVP Demo application
NongBeer MVP Demo application
 
iOS
iOSiOS
iOS
 
ITB2016 Converting Legacy Apps into Modern MVC
ITB2016 Converting Legacy Apps into Modern MVCITB2016 Converting Legacy Apps into Modern MVC
ITB2016 Converting Legacy Apps into Modern MVC
 
Formacion en movilidad: Conceptos de desarrollo en iOS (III)
Formacion en movilidad: Conceptos de desarrollo en iOS (III) Formacion en movilidad: Conceptos de desarrollo en iOS (III)
Formacion en movilidad: Conceptos de desarrollo en iOS (III)
 
Apple Templates Considered Harmful
Apple Templates Considered HarmfulApple Templates Considered Harmful
Apple Templates Considered Harmful
 
Utilising View Controllers
Utilising View ControllersUtilising View Controllers
Utilising View Controllers
 
Using view controllers wisely
Using view controllers wiselyUsing view controllers wisely
Using view controllers wisely
 
ApplicationCoordinator для навигации между экранами / Павел Гуров (Avito)
ApplicationCoordinator для навигации между экранами / Павел Гуров (Avito)ApplicationCoordinator для навигации между экранами / Павел Гуров (Avito)
ApplicationCoordinator для навигации между экранами / Павел Гуров (Avito)
 
iOS: Implementing a Custom View
iOS: Implementing a Custom ViewiOS: Implementing a Custom View
iOS: Implementing a Custom View
 
View controller life cycle
View controller life cycleView controller life cycle
View controller life cycle
 
Daniel Jalkut - dotSwift 2019
Daniel Jalkut - dotSwift 2019Daniel Jalkut - dotSwift 2019
Daniel Jalkut - dotSwift 2019
 
Building impressive layout systems with vaadin
Building impressive layout systems with vaadinBuilding impressive layout systems with vaadin
Building impressive layout systems with vaadin
 
iOS_Presentation
iOS_PresentationiOS_Presentation
iOS_Presentation
 
Koin
KoinKoin
Koin
 
iOSインタラクションデザイン
iOSインタラクションデザインiOSインタラクションデザイン
iOSインタラクションデザイン
 
PhotoFlipCardView
PhotoFlipCardViewPhotoFlipCardView
PhotoFlipCardView
 
Routing to components
Routing to componentsRouting to components
Routing to components
 

Plus de sgleadow

Evolving Mobile Architectures @ Mi9
Evolving Mobile Architectures @ Mi9Evolving Mobile Architectures @ Mi9
Evolving Mobile Architectures @ Mi9sgleadow
 
Evolving for Multiple Screens
Evolving for Multiple ScreensEvolving for Multiple Screens
Evolving for Multiple Screenssgleadow
 
Mobile: more than just an app
Mobile: more than just an appMobile: more than just an app
Mobile: more than just an appsgleadow
 
Evolving Mobile Architectures
Evolving Mobile ArchitecturesEvolving Mobile Architectures
Evolving Mobile Architecturessgleadow
 
Building mobile teams and getting a product to market
Building mobile teams and getting a product to marketBuilding mobile teams and getting a product to market
Building mobile teams and getting a product to marketsgleadow
 
iOS Unit Testing
iOS Unit TestingiOS Unit Testing
iOS Unit Testingsgleadow
 
iOS app case study
iOS app case studyiOS app case study
iOS app case studysgleadow
 
Frank iOS Testing
Frank iOS TestingFrank iOS Testing
Frank iOS Testingsgleadow
 
Multithreaded Data Transport
Multithreaded Data TransportMultithreaded Data Transport
Multithreaded Data Transportsgleadow
 
A few design patterns
A few design patternsA few design patterns
A few design patternssgleadow
 
GPU Programming
GPU ProgrammingGPU Programming
GPU Programmingsgleadow
 

Plus de sgleadow (11)

Evolving Mobile Architectures @ Mi9
Evolving Mobile Architectures @ Mi9Evolving Mobile Architectures @ Mi9
Evolving Mobile Architectures @ Mi9
 
Evolving for Multiple Screens
Evolving for Multiple ScreensEvolving for Multiple Screens
Evolving for Multiple Screens
 
Mobile: more than just an app
Mobile: more than just an appMobile: more than just an app
Mobile: more than just an app
 
Evolving Mobile Architectures
Evolving Mobile ArchitecturesEvolving Mobile Architectures
Evolving Mobile Architectures
 
Building mobile teams and getting a product to market
Building mobile teams and getting a product to marketBuilding mobile teams and getting a product to market
Building mobile teams and getting a product to market
 
iOS Unit Testing
iOS Unit TestingiOS Unit Testing
iOS Unit Testing
 
iOS app case study
iOS app case studyiOS app case study
iOS app case study
 
Frank iOS Testing
Frank iOS TestingFrank iOS Testing
Frank iOS Testing
 
Multithreaded Data Transport
Multithreaded Data TransportMultithreaded Data Transport
Multithreaded Data Transport
 
A few design patterns
A few design patternsA few design patterns
A few design patterns
 
GPU Programming
GPU ProgrammingGPU Programming
GPU Programming
 

Dernier

Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 

Dernier (20)

Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 

iOS View Coordinators

  • 1. Avoiding oversized view controllers in iOS Stewart Gleadow Email: sgleadow@thoughtworks.com Twitter: @stewgleadow
  • 2.
  • 3. What makes a class easy to maintain?
  • 5.
  • 6. What makes a controller easy to maintain?
  • 7.
  • 8.
  • 9. UIViewController - (id)init; - (void)loadView; - (void)viewDidLoad; - (void)viewWillAppear:(BOOL); - (void)viewDidAppear:(BOOL); - (void)viewWillDisappear:(BOOL); - (void)viewDidDisappear: (BOOL); - (void)viewDidUnload; - (void)dealloc;
  • 10. UIViewController - (id)init; - (void)loadView; - (void)viewDidLoad; - (void)viewWillAppear:(BOOL); - (void)viewDidAppear:(BOOL); - (void)viewWillDisappear:(BOOL); - (void)viewDidDisappear: (BOOL); - (void)viewDidUnload; - (void)dealloc;
  • 11. UIViewController - (id)init; - (void)loadView; - (void)viewDidLoad; - (void)viewWillAppear:(BOOL); - (void)viewDidAppear:(BOOL); - (void)viewWillDisappear:(BOOL); - (void)viewDidDisappear: (BOOL); - (void)viewDidUnload; - (void)dealloc;
  • 12.
  • 13. - (id)init; { if ((self = [super init])) { // create data related objects } return self; } - (void)dealloc; { // release any data related objects [super dealloc]; }
  • 14.
  • 15. - (void)loadView; { [super loadView]; // create all your views // assign delegates } - (void)viewDidUnload; { // release any view related [super viewDidUnload]; }
  • 16.
  • 17. @interface MatchViewController : UIViewController <UITableViewDelegate, UITableViewDataSource, UIScrollViewDelegate, TTModelDelegate, ...>
  • 18. Coordinated Views View One View Two View Three
  • 19. Coordinator - (id)init; - (UIView *)view; - (void)releaseView; - (void)dealloc;
  • 20.
  • 21. ViewController Coordinator - (id)init; - (id)init; - (void)loadView; - (UIView *)view; - (void)viewDidLoad; - (void)releaseView; - (void)viewWillAppear:(BOOL); - (void)viewDidAppear:(BOOL); - (void)dealloc; - (void)viewWillDisappear:(BOOL); - (void)viewDidDisappear: (BOOL); - (void)viewDidUnload; - (void)dealloc;
  • 22. ViewController Coordinator - (id)init; - (id)init; - (void)loadView; - (UIView *)view; - (void)viewDidLoad; - (void)releaseView; - (void)viewWillAppear:(BOOL); - (void)viewDidAppear:(BOOL); - (void)dealloc; - (void)viewWillDisappear:(BOOL); - (void)viewDidDisappear: (BOOL); - (void)viewDidUnload; - (void)dealloc;
  • 23. ViewController Coordinator - (id)init; - (id)init; - (void)loadView; - (UIView *)view; - (void)viewDidLoad; - (void)releaseView; - (void)viewWillAppear:(BOOL); - (void)viewDidAppear:(BOOL); - (void)dealloc; - (void)viewWillDisappear:(BOOL); - (void)viewDidDisappear: (BOOL); - (void)viewDidUnload; - (void)dealloc;
  • 24. Demo

Notes de l'éditeur

  1. \n
  2. \n
  3. \n
  4. - small classes\n- small methods\n- single responsibility\n- not much logic, just decoupling\n
  5. - nav controller push/pop\n- low memory conditions (recycle the views)\n\n
  6. - nav controller push/pop\n- low memory conditions (recycle the views)\n\n
  7. \n
  8. \n
  9. \n
  10. \n
  11. - one UIViewController to rule them all (single responsibility?)\n- sub UIViewControllers: complicated lifecycle\n- custom UIView subclasses shouldn&amp;#x2019;t have delegate callbacks\n
  12. - automatic layout in full width horizontal\n- independent sections of the screen\n
  13. - simplified view controller\n- managed the creation of the view (holds it)\n- hides callbacks (can&amp;#x2019;t use UIView for that)\n
  14. - same object lifecycle, for delegate callbacks\n- simpler view lifecycle\n- automatic layout using stacked view\n
  15. - same object lifecycle, for delegate callbacks\n- simpler view lifecycle\n- automatic layout using stacked view\n
  16. - same object lifecycle, for delegate callbacks\n- simpler view lifecycle\n- automatic layout using stacked view\n
  17. - same object lifecycle, for delegate callbacks\n- simpler view lifecycle\n- automatic layout using stacked view\n
  18. - same object lifecycle, for delegate callbacks\n- simpler view lifecycle\n- automatic layout using stacked view\n
  19. - same object lifecycle, for delegate callbacks\n- simpler view lifecycle\n- automatic layout using stacked view\n
  20. - same object lifecycle, for delegate callbacks\n- simpler view lifecycle\n- automatic layout using stacked view\n
  21. - same object lifecycle, for delegate callbacks\n- simpler view lifecycle\n- automatic layout using stacked view\n
  22. \n
  23. \n