viewDidLoad and network requests
A teammate kicks off a network request directly in viewDidLoad and updates the UI when the response arrives. What problems can this cause?
A teammate kicks off a network request directly in viewDidLoad and updates the UI when the response arrives. What problems can this cause?
viewDidLoad runs once per instance while the view isn't on screen yet, so returning to the screen doesn't refresh, and a response that lands after the screen is gone is wasted or can crash.
SwiftUIMultiple choiceAdvanced
In a SwiftUI view that loads data, what's the correct statement about how these two…
#lifecycle #task #cancellation
UIKitMultiple choiceIntro
When a screen appears for the first time, which order do the UIViewController lifecycle…
#viewdidload #lifecycle
ConcurrencyShort answerBasics
In Swift Concurrency, when you create a Task { }, when and where does that code run?
#task #cancellation
ConcurrencyMultiple choiceExpert
In this Swift Concurrency code, which statement about what actually happens right after…
#task #cancellation