Async/Await in Swift

  Рет қаралды 8,507

azamsharp

azamsharp

Күн бұрын

Пікірлер: 9
@bruhmoment3731
@bruhmoment3731 3 жыл бұрын
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
@ripfrauds
@ripfrauds 3 жыл бұрын
same here...confused
@mikaelacaron4694
@mikaelacaron4694 3 жыл бұрын
​@@ripfrauds this is a tuple!
@fedemtz6
@fedemtz6 3 жыл бұрын
How can I call an API function like login from a button?
@wensmusic8636
@wensmusic8636 3 жыл бұрын
How do you put all that into a Table view Controller using UIKIt?
@azamsharp
@azamsharp 3 жыл бұрын
You would use UiTableViewController and probably make a fetch request in viewDidLoad function
@srzurka
@srzurka 3 жыл бұрын
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.
@azamsharp
@azamsharp 3 жыл бұрын
You can use the async closure: onReceive(NotificationCenter.default.publisher(for: UIApplication.didBecomeActiveNotification)) { _ in // call an api async { do { let _ = try await fetchData() } catch { } } }
@srzurka
@srzurka 3 жыл бұрын
@@azamsharp Thank you!
Understanding Actors in Swift
13:11
azamsharp
Рет қаралды 4,8 М.
Live Searching an API Using SwiftUI Searchable
22:55
azamsharp
Рет қаралды 7 М.
Don’t Choose The Wrong Box 😱
00:41
Topper Guild
Рет қаралды 62 МЛН
人是不能做到吗?#火影忍者 #家人  #佐助
00:20
火影忍者一家
Рет қаралды 20 МЛН
Async/Await in Swift | Comparison vs Closures and Combine Framework
19:59
Swift API Calls for Beginners (Networking) - Async Await & JSON
25:35
Understanding associatedtype in Swift
9:39
azamsharp
Рет қаралды 4,4 М.
How to use async / await keywords in Swift  | Swift Concurrency #3
20:40
Swiftful Thinking
Рет қаралды 28 М.
How to use MVVM with Async Await | Swift Concurrency #14
11:42
Swiftful Thinking
Рет қаралды 10 М.
DispatchQueues: Serial, Concurrent, Async, & Sync - Overview
6:02
SwiftUI + Redux (Introduction)
18:58
azamsharp
Рет қаралды 4 М.
Introduction to Mocking in iOS Using Swift
25:44
azamsharp
Рет қаралды 8 М.