View controller appearance lifecycle
In a UIKit screen, which pair of lifecycle methods would you add and remove a subscription in, like a NotificationCenter observer you only need while the screen is visible?
In a UIKit screen, which pair of lifecycle methods would you add and remove a subscription in, like a NotificationCenter observer you only need while the screen is visible?
A subscription you only need while the screen is visible goes in a pair that's called the same number of times. Add in viewWillAppear and remove in viewWillDisappear, or use the didAppear and didDisappear pair to stay clear of the transition animation, and the subscription is never doubled or missing when the screen comes back after a trip away.
App lifecycle and systemShort answerBasics
For a manager round assignment you built "a screen that explains our notification…
#view-lifecycle
App lifecycle and systemShort answerBasics
If you call NotificationCenter.default.post on a background thread, which thread does the…
#observer
ArchitectureShort answerIntro
How does Cocoa MVC in UIKit differ from the textbook MVC?
#uikit
ArchitectureMultiple choiceBasics
In MVVM, which of these should a ViewModel not have? Select all that apply.
#uikit