Numworks Epsilon  1.4.1
Graphing Calculator Operating System
dynamic_view_controller.h
Go to the documentation of this file.
1 #ifndef ESCHER_DYNAMIC_VIEW_CONTROLLER_H
2 #define ESCHER_DYNAMIC_VIEW_CONTROLLER_H
3 
5 
6 /* Dynamic view controllers dynamically construct their views when appearring
7  * and delete them when disappearing.
8  * The load method is called before any methods viewWillAppear,
9  * didEnterResponderChain and didBecomeFirstResponder. The unload method is
10  * called after viewWillDisappear, willExitResponderChain or
11  * willResignFirstResponder. */
12 
14 public:
17  DynamicViewController(const DynamicViewController& other) = delete;
21  View * view() override;
22  void viewWillAppear() override;
23  void viewDidDisappear() override;
24 private:
25  void loadViewIfNeeded();
26  void unloadViewIfNeeded();
27  virtual View * loadView() = 0;
28  virtual void unloadView(View * view) = 0;
29  View * m_view;
30 };
31 
32 #endif
DynamicViewController(Responder *parentResponder)
Responder * parentResponder() const
Definition: responder.cpp:12
DynamicViewController & operator=(const DynamicViewController &other)=delete
Definition: view.h:23