iOS development basic knowledge

戴谷州 KEN_TAI@UUU.COM.TW
AGENDA

 MVC
 Delegation

 Target-Action

 UIApplication Archtecture

 UIViewController Catelog

 UIView Archtecture
MVC


             Model




      View           Controller
MVC

   Model
     Data class/ Entity
     Data Access/Business logic

   View
     Display   component
   Controller
     View behavior definition
     View arrangement
UIKIT ARCHTECTURE


               Model




                view
      UIView           UIViewController
UIKIT ARCHTECTURE

   Model
     Custom

   UIView
     Subclass    of UIView
     .xib / .storyboard

   UIViewController
     View behavior definition
     View arrangement (Hard coding)
DELEGATION

                    delegate
        Component              Behavior




 Component’s behavior is defined in another
  pre-defined class.
 Must keep relationship between component
  and behavior with field relation.
UIKIT DELEGATE

                       delegate
      UITextField                  UITextFieldDelegate




                        delegate
                                   UITableViewDelegat
      UITableView
                                            e




                    dataSource
                                        UITableView
                                        DataSource
TARGET-ACTION
                 Target
     Component            CustomClass

                 Action
                          CustomMethod


 Component’s behavior is defined in custom
  method in custom class.
 Must keep relationship between component
  and behavior with add target and action.
UIKIT TARGET-ACTION



                 Target
      UIButton                self

                 Action
                          clickHandler:
UIAPPLICATION ARCHTECTURE


      UIApplicatio                                  UIViewController
          n
                         rootViewControll
                         er
                                                             view
                                        addSubVie
                                        w
 UIApplicationDelegate       UIWindow                       UIView
UIVIEWCONTROLLER CATALOG
   Container
       UINavigationController
       UITabBarController
       UISplitViewController(iPad)
       UIPopoverController(iPad)
       UIPageViewController
   Build-In
       UITableViewController
       UIMenuController
       UIImagePickerController
   Custom
       Subclass of UIViewController
   ModalViewController  Switch UIViewController
UIVIEW ARCHTECTURE

   All subclasses of UIView
UIAPPLICATION INTERACTS WITH …

                    Http
     UIKit                                         Other Services
                Communication

     Camera      GPS        Heading


     File I/O       Media


    Accelerometer      Localization

                     [ [UIApplication shareApploication]
                     openURL]
                Other App

Objective c design pattens-architetcure

  • 1.
    iOS development basicknowledge 戴谷州 KEN_TAI@UUU.COM.TW
  • 2.
    AGENDA  MVC  Delegation Target-Action  UIApplication Archtecture  UIViewController Catelog  UIView Archtecture
  • 3.
    MVC Model View Controller
  • 4.
    MVC  Model  Data class/ Entity  Data Access/Business logic  View  Display component  Controller  View behavior definition  View arrangement
  • 5.
    UIKIT ARCHTECTURE Model view UIView UIViewController
  • 6.
    UIKIT ARCHTECTURE  Model  Custom  UIView  Subclass of UIView  .xib / .storyboard  UIViewController  View behavior definition  View arrangement (Hard coding)
  • 7.
    DELEGATION delegate Component Behavior  Component’s behavior is defined in another pre-defined class.  Must keep relationship between component and behavior with field relation.
  • 8.
    UIKIT DELEGATE delegate UITextField UITextFieldDelegate delegate UITableViewDelegat UITableView e dataSource UITableView DataSource
  • 9.
    TARGET-ACTION Target Component CustomClass Action CustomMethod  Component’s behavior is defined in custom method in custom class.  Must keep relationship between component and behavior with add target and action.
  • 10.
    UIKIT TARGET-ACTION Target UIButton self Action clickHandler:
  • 11.
    UIAPPLICATION ARCHTECTURE UIApplicatio UIViewController n rootViewControll er view addSubVie w UIApplicationDelegate UIWindow UIView
  • 12.
    UIVIEWCONTROLLER CATALOG  Container  UINavigationController  UITabBarController  UISplitViewController(iPad)  UIPopoverController(iPad)  UIPageViewController  Build-In  UITableViewController  UIMenuController  UIImagePickerController  Custom  Subclass of UIViewController  ModalViewController  Switch UIViewController
  • 13.
    UIVIEW ARCHTECTURE  All subclasses of UIView
  • 14.
    UIAPPLICATION INTERACTS WITH… Http UIKit Other Services Communication Camera GPS Heading File I/O Media Accelerometer Localization [ [UIApplication shareApploication] openURL] Other App