Global Actors in Swift (2022) - iOS

  Рет қаралды 6,434

iOS Academy

iOS Academy

2 жыл бұрын

In this video we will learn about global actors in Swift. We will walk through a few different examples to learn, use, understand the benefits of global actors. We will also spend some time talking about the main actor which is commonly used. As always we will work in the latest version of Xcode and Swift.
SwiftLee Article: www.avanderlee.com/swift/main...
💻 Source Code: / iosacademy
🎥 Subscribe for more: kzfaq.info?su...
😎 Like my teaching style? Check out some of my most popular courses! courses.iosacademy.io
👉🏼 Connect (personal LinkedIn) / afrazsiddiqui
🚀 Follow on LinkedIn / ios-academy
** Popular Series
Building Instagram: courses.iosacademy.io/p/build...
Building TikTok: / @iosacademy
SwiftUI for Beginners: ios-academy.teachable.com/p/s...
** Get Skillshare free for 2 Months and learn iOS
www.skillshare.com/r/user/afraz
** Manage all your investments from app earnings on Betterment!
bit.ly/3eBwlI9
** Grow your own KZfaq tech channel with TubeBuddy:
www.tubebuddy.com/iosacademy
#swift

Пікірлер: 19
@iOSAcademy
@iOSAcademy 2 жыл бұрын
Are you an iOS Dev? Let's connect 🎉 linkedin.com/in/afrazsiddiqui
@LukeVanIn
@LukeVanIn Жыл бұрын
Thank you for the video. I have a few questions: 1. You defined a global actor. Is this used anywhere? 2. You mention that global actors "allow you to act on a particular queue". Is this correct? 3. In the run method, is there a reason to define resultType? Would T not always be defined by the closure? 4. Also in the run method, why do you catch and throw the exception? Can you not just call `return try await body()` without the enclosing do/catch?
@gofudgeyourselves9024
@gofudgeyourselves9024 2 жыл бұрын
Do more on async await, actors. Love the content. Thanks
@iOSAcademy
@iOSAcademy 2 жыл бұрын
Thanks! I plan to
@codylimongello
@codylimongello 2 жыл бұрын
Thank you for great content man. Would love to see more realm db videos.. Like writing NFC data to realm database or using realm and bar charts together.
@iOSAcademy
@iOSAcademy 2 жыл бұрын
Youre welcome
@junglee-bee
@junglee-bee 2 жыл бұрын
But... You didn't really use the `globalActor` you created 😶
@_sabot
@_sabot Жыл бұрын
I'm totally confused on that run method you added to MainActor. That's already available by default and the header declares it's available from iOS13 onward, so it was already there when you created the video 9 month ago?
@ihorzhukov
@ihorzhukov 9 ай бұрын
also didn't get it. it seems redundant.
@Jannemandevries
@Jannemandevries 2 жыл бұрын
So all the trouble in the last five minutes is just to make the async call slightly shorter? Is it really worth the extra complexity for you and your team?
@iOSAcademy
@iOSAcademy 2 жыл бұрын
Subjective
@victorriurean
@victorriurean 2 жыл бұрын
🔥🔥🔥
@iOSAcademy
@iOSAcademy 2 жыл бұрын
Thanks
@kimseungwon6125
@kimseungwon6125 2 жыл бұрын
Hi, I'm enjoying your video. I'm curious about the theme, can you tell me which theme you use?
@iOSAcademy
@iOSAcademy 2 жыл бұрын
Thanks & midnight
@AmitBiswastunebox
@AmitBiswastunebox 2 жыл бұрын
Hi Afraz, do you think this GlobalActor and MainActor is easy to use in our code? I am sorry…seems very complex first time when I see. Don’t know when where to use it. Swift is growing so fast.
@billvivino
@billvivino 2 жыл бұрын
Afraz, what is the benefit of not calling the main actor directly here?
@lincolndickerson1293
@lincolndickerson1293 Жыл бұрын
I have used actors but not global actors
@iOSAcademy
@iOSAcademy Жыл бұрын
Nice
Swift: Dynamic Member Lookup Intro (Xcode 13, 2022) - iOS
10:55
iOS Academy
Рет қаралды 9 М.
AsyncStreams Intro in Swift (Concurrency) - 2022
8:53
iOS Academy
Рет қаралды 7 М.
World’s Deadliest Obstacle Course!
28:25
MrBeast
Рет қаралды 158 МЛН
Looks realistic #tiktok
00:22
Анастасия Тарасова
Рет қаралды 34 МЛН
Tom & Jerry !! 😂😂
00:59
Tibo InShape
Рет қаралды 66 МЛН
MEGA BOXES ARE BACK!!!
08:53
Brawl Stars
Рет қаралды 35 МЛН
Object IDs: Dependency Injection Fundamentals (iOS) - 2022
15:30
iOS Academy
Рет қаралды 4,8 М.
3 MISTAKES to avoid when using Async / Await in Swift 😌
4:41
Vincent Pradeilles
Рет қаралды 10 М.
You hate DispatchQueue.main.async { } ? Good news, @MainActor killed it ☠️
11:51
Debugging in Xcode 13: Tips & Tricks (2022) - iOS
14:02
iOS Academy
Рет қаралды 42 М.
Swift Subscripts Tutorial (2021) - Xcode 13
11:58
iOS Academy
Рет қаралды 8 М.
Swift: Actors Introduction (2023, Xcode 13) - iOS
8:54
iOS Academy
Рет қаралды 38 М.
World’s Deadliest Obstacle Course!
28:25
MrBeast
Рет қаралды 158 МЛН