4:18 Why does that constant have 2 names? data and response? I've never seen anything like let (data, response) before. Is there a name for this kind of syntax? Thx
@ripfrauds3 жыл бұрын
same here...confused
@mikaelacaron46943 жыл бұрын
@@ripfrauds this is a tuple!
@fedemtz63 жыл бұрын
How can I call an API function like login from a button?
@wensmusic86363 жыл бұрын
How do you put all that into a Table view Controller using UIKIt?
@azamsharp3 жыл бұрын
You would use UiTableViewController and probably make a fetch request in viewDidLoad function
@srzurka3 жыл бұрын
Thanks for this video. Nice work, as always. Say you wanted to fetchMovies asynchronously every time the user went back to the app, how would you do that in SwiftUI? My first thought was to use .onReceive and UIApplication.willEnterForegroundNotification but that can only call synchronous functions.
@azamsharp3 жыл бұрын
You can use the async closure: onReceive(NotificationCenter.default.publisher(for: UIApplication.didBecomeActiveNotification)) { _ in // call an api async { do { let _ = try await fetchData() } catch { } } }