Skip to content

Instantly share code, notes, and snippets.

@funmia
Created July 15, 2018 10:49
Show Gist options
  • Select an option

  • Save funmia/db8a386ccf284e48c168b2dabcf8ee20 to your computer and use it in GitHub Desktop.

Select an option

Save funmia/db8a386ccf284e48c168b2dabcf8ee20 to your computer and use it in GitHub Desktop.
Simple App Structure (notes from ray wenderlich tutorial)

AppDelegate:

This is where you usually handle application events like; the app being moved into the background and notifications.

View Controller:

This is where is you have the logic of a current screen and to also access any controls that are on the screen. The UIViewController class defines the methods and properties for managing your views, handling events, transitioning from one view controller to another. You subclass UIViewController (or one of its subclasses) and add the custom code you need to implement your app’s behavior.

Main Storyboard

This where you can layout and customise all the screens in your app. Storyboard’s visual editor allows you to visually see all the screens at once, showing you the user flow of the app.

Notes

  • Each screen is managed by a View Controller and it has a reference to all the controls within it. Each control is a type of UIView that can contain other UIViews, usually referred to as subviews.

  • The View Controller also contains references to Models and this is how it gets Data

ViewController Lifecycle

  • viewDidLoad: called once the VC has been created; which is the first time the VC’s view property is accessed. This is a good place for initialising controls that VC needs.
  • viewWillAppear: called right before the view is displayed on screen. This is a good place to populate views from the models. E.g setting the text on a UILabel.
  • viewDidAppear: called after the view is displayed
  • viewDidLayoutSubviews
  • viewWillDisappear: Called before the view disappears from the screen
  • viewDidDisappear: Called after the view disappears from the screen
  • didReceiveMemoryWarning: called when the device is low on memory, the app will crash if the memory gets too low.

Xcode IDE

  • PLAY button
  • Simulators; allows you download more devices
  • Different editors; Standard Editor, Assistant Editor and Version Editor/source control.
  • Panes; Navigation Area, Debug Area, Inspector, Library, Pre-Packaged Code, Object Library, Media Library
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment