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

Applications mobiles, CheatSheet

antdesc
March 31, 2016

Applications mobiles, CheatSheet

Présentation faite à la license IEM à de l'IUT Lyon 1 de Bourg en Bresse le 31/03/2016.

antdesc

March 31, 2016
Tweet

More Decks by antdesc

Other Decks in Technology

Transcript

  1. MainViewController.m -­‐ (void)viewDidLoad {   [super  viewDidLoad];   {...}  

    } #pragma mark  -­‐ view initialization {...}   #pragma mark  -­‐ data  initialization {...}   #pragma mark  – IBActions {...}   #pragma mark  -­‐ api  calls   {...} #pragma mark  -­‐ ui animations {...}   #pragma mark  -­‐ delegatesX {...}   #pragma mark  -­‐ delegatesY   {...}  
  2. @implementation MainPresenter id<MainView> view; ApiManager *apiManager; -­‐ (void) retrieveDatas {

    [self.apiManager retrieveDatas:^(NSArray *result) { [self.view displayDatas:result]; }]; } @implementation MainViewController <MainView> MainPresenter *presenter; -­‐(void)viewDidLoad{ [super viewDidLoad]; [self.presenter retrieveDatas]; } #pragma mark  -­‐ protocol implementation -­‐(void) displayDatas:(NSArray *) datas { //  ui refresh withobjects retrieved {...} } @protocol MainView -­‐(void) displayDatas:(NSArray *) datas; Presenter View ViewImpl @implementationApiManager -­‐(void) retrieveDatas:((void (^)(NSArray *result)) responseBlock { //  AFNetworking call  &  parsing {...} } Model MainPresenter.m MainView.h ApiManager.m MainViewController.m
  3. Module  Interface Module  Implementation public  interface  ModuleProgress { void displayIndeterminateProgress(Activity

     activity); } public  class  ModuleProgressImpl extends ModuleProgress { @Override public  void displayIndeterminateProgress(Activity  activity)  { displayMaterialDialogIndeterminate(activity); } private void displayMaterialDialogIndeterminate (Activity   activity)  { //  specific library implementation {...} } } ModuleProgress.java ModuleProgressImpl.java
  4. View implementation MainFragment.java public  class  MainFragment extends Fragment  implements MainView

    { @Inject private ModuleProgress moduleProgress; @Override public  void displayIndeterminate()  { moduleProgress.displayIndeterminateProgress(getActivity()); } }
  5. public  class  ItemDetailPresenter { public  void loadItemDetail(String  id)  { Item

     item  =  DbManager.getInstance().getItemById(id); view.displayContent(item); } }
  6. public  class  ItemDetailPresenter { private DbManager dbManager; public  ItemDetailPresenter()  {

    dbManager=  DbManager.getInstance(); } public  void loadItemDetail(String  id)  { Item  item  =  dbManager.getItemById(id); view.displayContent(item); } }
  7. public  class  ItemDetailPresenter { private DbManager dbManager; public  ItemDetailPresenter(DbManagerImpldbManager)  {

    this.dbManager=  dbManager; } public  void loadItemDetail(String  id)  { Item  item  =  dbManager.getItemById(id); view.displayContent(item); } }