How to use Actors and non-isolated in Swift | Swift Concurrency #9

แชร์
ฝัง
  • เผยแพร่เมื่อ 9 ก.พ. 2025
  • Actors are possibly the most important update to come out of Swift Concurrency! They are incredibly powerful and solve Data Race problems in our applications! This is crucially important when working in a multi-threaded environment! In this video we will learn:
    1) The problem that Actors solve
    2) How to solve the problem without Actors
    3) How to solve the problem with Actors!
    Next video: • How to use Global Acto...
    Previous video: • Swift: Struct vs Class...
    🤙 WELCOME BACK 🤙
    WEBSITE: www.swiftful-t...
    DISCORD: / discord
    GITHUB: github.com/Swi...
    SAY THANKS: www.buymeacoff...

ความคิดเห็น • 38

  • @3ilz
    @3ilz 2 ปีที่แล้ว +18

    The fact that you are giving this content away for free on TH-cam is amazing! This was an awesome video, didn't know what non isolated was before this

  • @raymondcordero9718
    @raymondcordero9718 ปีที่แล้ว +1

    Awesome video. Best explanation I’ve seen so far for when to use Actors 🙌🏻

  • @satyadodda2386
    @satyadodda2386 2 ปีที่แล้ว +2

    This was amazing.Please post more videos on swift and swiftUI🥺

  • @peterwolf2657
    @peterwolf2657 2 ปีที่แล้ว +5

    Again a nice and easy to understand video. I'm looking forward to the next one.

  • @josemanuelortizsanchez4983
    @josemanuelortizsanchez4983 2 ปีที่แล้ว +2

    Good explication of no isolated and example of differences between actors and classes, thanks!

  • @bruhmoment3731
    @bruhmoment3731 2 ปีที่แล้ว +1

    Excellent tutorials. I really wanna watch the last 3 videos in this playlist now!

  • @andresraigoza2082
    @andresraigoza2082 2 ปีที่แล้ว +7

    So valuable content. Thank you so much Nick!!! you are a great teacher

  • @bhuwin6186
    @bhuwin6186 2 ปีที่แล้ว +2

    Best swift tutorials ever

  • @mafiaboy16
    @mafiaboy16 ปีที่แล้ว

    Hi Nick, this was the one i was looking for. Thanks for everything

  • @hao-bz
    @hao-bz 7 หลายเดือนก่อน

    Amazing, just learned something new today. Thanks for teaching us!

  • @nizamitagiyev705
    @nizamitagiyev705 2 ปีที่แล้ว

    Great explanation! Thank you Nick

  • @GKid1786
    @GKid1786 19 วันที่ผ่านมา

    At 6:40 you mention that you have a whole video where to talk about why you don't recommend using singleton's? Could you point me to that video? I'm curious to learn more!

    • @SwiftfulThinking
      @SwiftfulThinking  19 วันที่ผ่านมา

      The solution to not using Singletons is usually using Dependency Injection. More info:
      How to use Dependency Injection in SwiftUI | Advanced Learning #16
      th-cam.com/video/E3x07blYvdE/w-d-xo.html

    • @GKid1786
      @GKid1786 19 วันที่ผ่านมา

      @@SwiftfulThinking Awesome, thanks! I'll give it a look :)

  • @AhmadEllashy
    @AhmadEllashy 3 หลายเดือนก่อน

    Awesome Content!

  • @navikaushal1795
    @navikaushal1795 6 หลายเดือนก่อน

    HI Nick
    Can you please make a video on what are the different ways of designing a data manager class with their pros and cons?

  • @bonifacy9511
    @bonifacy9511 ปีที่แล้ว

    You are the best!!❤

  • @indomitabletr1834
    @indomitabletr1834 ปีที่แล้ว

    awsome as always

  • @kyunghwankim1269
    @kyunghwankim1269 10 หลายเดือนก่อน

    Wonderful! Thank you 😆

  • @rooo2000
    @rooo2000 ปีที่แล้ว

    very nice explanation

  • @vebbis5961
    @vebbis5961 ปีที่แล้ว

    Good explenation. Thank you!

  • @alexvaiman4966
    @alexvaiman4966 11 หลายเดือนก่อน

    It's important to notice that we should use a serial queue, which is the default in Swift, but was not the case for Objective-C.

  • @tomblah
    @tomblah 8 หลายเดือนก่อน

    11:21 I'm probably misunderstanding, but is this really needed to do on a different background thread? Isn't it this doing it on a different background *queue*? And the queue will, under the hood, choose which thread to use?

  • @JackSparrow-ob8kf
    @JackSparrow-ob8kf 2 ปีที่แล้ว

    Thank you for all these swiftUI tutorials...I've seen almost all of them, I learned a lot and I hope you will take other courses....I'm curious what you think also about flutter and if you' have seen it, I noticed some similarities with SwiftUI

  • @nickfloussov185
    @nickfloussov185 ปีที่แล้ว

    Video is great, but Nick forgot to mention that 'Thread Sanitizer' option is NOT available for ALL devices

  • @daminsamson204
    @daminsamson204 2 ปีที่แล้ว

    This is awesome 👏

  • @federicoramos
    @federicoramos ปีที่แล้ว

    Hey Nick! great content! Can race conditions occur within the same class by using a task group? How to handle this?

  • @AhmedAlshaybani-s4c
    @AhmedAlshaybani-s4c ปีที่แล้ว

    Bravo man

  • @nverabgaryan
    @nverabgaryan ปีที่แล้ว

    Thanks! Just one question here:
    1. How your code becomes threads safe when you add asynchronous queue ? I think there should be serial queue.
    Could you please explain here? Thanks again for amazing videos

    • @nverabgaryan
      @nverabgaryan ปีที่แล้ว

      Ahh, I see default init for DespatchQueue returns serial queue

    • @ArmstrongLiu-j1y
      @ArmstrongLiu-j1y 3 หลายเดือนก่อน

      Hi man, I saw you commented here and I have the same question why using async queue to make thread safe? As my understanding the queue.sync {} can make it serial executed. Am I making something misunderstanding here?

  • @lizakryshkovskaya7412
    @lizakryshkovskaya7412 2 ปีที่แล้ว

    thanks a lot!😍

  • @HUNTELAAR11W
    @HUNTELAAR11W 2 ปีที่แล้ว

    Crazy content, do you also do mentoring?

  • @AndyJMacLeod
    @AndyJMacLeod 6 หลายเดือนก่อน

    19:01 Start of discussion about actors.

  • @visskiss
    @visskiss 2 ปีที่แล้ว

    Nice. Now use combine to publish the string automagically by subscribing to the timer and mapping it...

  • @光莒
    @光莒 2 ปีที่แล้ว

    thanks a lot as always~~~!!!

  • @DannyKerbel
    @DannyKerbel 2 ปีที่แล้ว +1

    I know this wasn't the point of the video but the lock.async closure should have a weak reference to self right?

  • @hashcat5721
    @hashcat5721 2 ปีที่แล้ว

    In Xcode 14 we get an error as we should .