Understanding Actors in Swift

Поділитися
Вставка
  • Опубліковано 26 лип 2021
  • In this video, Mohammad Azam will demonstrate how to use Actors in Swift language.
    #iosdev #Swiftlang #swiftactors
    Gist: gist.github.com/azamsharp/cc0...
    If you want to support my work then please consider buying one of my courses below. The links below already have coupons attached which will give you the best deal possible. Thank you for your support!
    Support my channel, become a Patron
    / azamsharp
    Async/Await and Actors - Concurrency in Swift
    www.udemy.com/course/asyncawa...
    Swift for Intermediate and Advanced iOS Developers
    www.udemy.com/course/swift-fo...
    GraphQL with iOS and SwiftUI: The Complete Developers Guide
    www.udemy.com/course/graphql-...
    Passive Income for Developers
    www.udemy.com/course/passive-...
    Core Data in iOS
    www.udemy.com/course/core-dat...
    Flutter and Firebase - Build Real World iOS and Android Apps
    www.udemy.com/course/flutter-...
    Writing Clean Code
    www.udemy.com/course/writing-...
    The Complete Hands-On SwiftUI Apps Using Firebase
    www.udemy.com/course/the-comp...
    Composable SwiftUI Architecture Using Redux
    www.udemy.com/course/composab...
    MVVM Design Pattern in SwiftUI
    www.udemy.com/course/mvvm-des...
    Server Side Swift Using Vapor 4
    www.udemy.com/course/server-s...
    Testing iOS Apps - Behavior Driven Development Using Swift
    www.udemy.com/course/testing-...
    Machine Learning and Artificial Intelligence Using Swift
    www.udemy.com/course/machine-...
    SwiftUI - Declarative Interfaces for any Apple Device
    www.udemy.com/course/swiftui-...
    Flutter and Dart - Build Apps Using MVVM Design Pattern
    www.udemy.com/course/flutter-...
    Mastering RxSwift in iOS
    www.udemy.com/course/masterin...
    MVVM Design Pattern Using Swift in iOS
    www.udemy.com/course/masterin...
    Mastering ARKit for iOS
    www.udemy.com/course/masterin...
    Intermediate and Advanced iOS - Build Real World Apps
    www.udemy.com/course/building...
    The Complete Guide to JSON Parsing in Swift
    www.udemy.com/course/ultimate...
    Data Structures and Algorithms in Swift
    www.udemy.com/course/data-str...
    Design Patterns in iOS Using Swift
    www.udemy.com/course/design-p...
    Mastering MapKit for iOS
    www.udemy.com/course/masterin...
    Machine Learning in iOS Using Swift
    www.udemy.com/course/masterin...
    Mastering Firebase for iOS Using Swift
    www.udemy.com/course/practica...
    Mastering Server Side Swift Using Vapor 3
    www.udemy.com/course/masterin...
    NodeJS - The Complete Developer Bootcamp
    www.udemy.com/course/nodejs-c...
    The Complete Guide to Lean Controllers in iOS
    www.udemy.com/course/a-comple... Check out my courses at
    azamsharp.school/

КОМЕНТАРІ • 11

  • @danielcrompton7818
    @danielcrompton7818 3 місяці тому

    Fascinating!! I’ve just watched the first couple of minutes of about 3 or 4 different videos on this topic and yours is the only one that explained it properly without a whole load of jargon!

  • @GaneshKumar-cg7rn
    @GaneshKumar-cg7rn 3 роки тому +2

    Thanks for example Sir and clean explaination

  • @gergelykovacs6577
    @gergelykovacs6577 Рік тому

    @azamsharp Hi, Nice Video! I wonder why it only works, when I declare the Counter() instance inside the view body. SwiftUI is not really intended to use dependencies like this in a real world app! But if I declare counter - and the Task in a function - outside the body, the numbers are not printed in perfect order even I am using an actor.

    • @gergelykovacs6577
      @gergelykovacs6577 Рік тому

      It also works, if i implement the concurrent function inline in the Button's action and declare the Counter() in view struct's global scope. Strange, why I cannot refactor that function and have the same result.

  • @salmansiddiqui9522
    @salmansiddiqui9522 3 роки тому +1

    Why do we need Task as DispatchQueue.concurrentPerform is an async concurrent queue?

    • @azamsharp
      @azamsharp  3 роки тому +1

      I don't think concurrentPerform uses the new async/await feature.

  • @saurabhbisht2181
    @saurabhbisht2181 2 роки тому

    Nice one !. Just want to add one point here event without actor and then just using Task { } will produce the same result for the example you displayed ....

    • @azaan389
      @azaan389 Рік тому

      if you are doing it with class instead of actor and forget the use of Task{} you will not get the compiler error Actor-isolated instance method 'increment()' can not be referenced from a non-isolated context

  • @davicampos802
    @davicampos802 3 роки тому

    I know there is no relation with the subject of this video , but I am doing a college project and I have no idea how to upload image to a server , for example I take a photo and send it by api, especially formdata , Can someone have a hint ?

    • @bhagyashingale5663
      @bhagyashingale5663 3 роки тому

      try firebase

    • @davicampos802
      @davicampos802 3 роки тому

      @@bhagyashingale5663 after some searching in google I did , I see a video for azarp about camera SwiftUI and how to send a image in a format to api