Mobile App Development 2021W Lecture 11

From Soma-notes
Revision as of 17:04, 22 February 2021 by Soma (talk | contribs) (Created page with "==Video== Video for the lecture give on February 22, 2021 [https://homeostasis.scs.carleton.ca/~soma/mad-2021w/lectures/comp1601-2021w-lec11-20210222.m4v is now available]....")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Video

Video for the lecture give on February 22, 2021 is now available.

Notes

Lecture 11
----------

Tutorial 4 solutions
Assignment 1 questions
Android!

Android (standard)/iOS Storyboard
 - event handlers update display directly or indirectly

iOS SwiftUI/Android Jetpack Compose
 - display is updated based on changes in state variables
   - programmer doesn't directly control when display is updated

Why use state variables?
 - you never have inconsistent display state, as you can with event handlers

With event handlers
 - you have to check if the variable has changed
 - *if* it has changed, update the display
 - so the programmer has to make sure all possible paths that lead
   to state changes also update displays
    - HUGE source of bugs
 - also, requires more code generally