Swift: Combine Basics & Intro (2023, Xcode 12, Swift 5) - iOS Development

Поділитися
Вставка
  • Опубліковано 31 бер 2021
  • In this video we will learn about the basics of the Apple Combine framework with swift and iOS. Combine is Apple's own reactive data framework similar to RxSwift and Redux. Its useful and especially interesting to integrate with SwiftUI.
    💻 Source Code: / iosacademy
    🎥 Subscribe for more: ua-cam.com/users/iOSAcademy?su...
    😎 Like my teaching style? Check out some of my most popular courses! courses.iosacademy.io
    #swift #combine #basics
    ** Like my teaching style? Check out some of my most popular courses!
    ios-academy.teachable.com/p/b...
    Join this channel to get access to perks, code, groups, and more:
    Building TikTok: / @iosacademy
    SwiftUI for Beginners: ios-academy.teachable.com/p/s...
    Join the iOS Academy Community: iosacademy.io/
    ** 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 UA-cam tech channel with TubeBuddy:
    www.tubebuddy.com/iosacademy

КОМЕНТАРІ • 93

  • @iOSAcademy
    @iOSAcademy  3 роки тому +10

    If you like my teaching style, I've started creating my own courses here that you may like! courses.iosacademy.io/

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

      Could you create a tutorial on implementing UISegmentedControl via UICollectionViews?

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

      @@AvantjerTube hey Jerry, I appreciate the feedback. Ill keep in mind to slow down as I create more content. All the best.

  • @hashankannangara8723
    @hashankannangara8723 3 роки тому +22

    Please do more videos about Combine framework ❤️

  • @ryanwesley2006
    @ryanwesley2006 3 роки тому +31

    honestly been waiting for someone to do a "basic" tutorial on Combine... after watching this video I will still be waiting. I appreciate anyone's effort to teach information for free so thank you. Unfortunately, this isn't basic.
    The assumption is knowing nothing about combine and then you code like a person should know what Cancellable and Sink are without explaining it and why/how they get used.
    I am as lost watching this as I am with the paid courses from Mohammad Azam or Ray Wenderlich. Sigh.
    Appreciate the effort though.

    • @iOSAcademy
      @iOSAcademy  3 роки тому +2

      thanks for the feedback

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

      This is a basic tutorial, a table view with buttons which print something to the console is like the "hello world" task of the iOS programming. There is no need to understand every single method / operator in depth, just analyze the example code and you can get the idea of it

    • @AviramNetanel
      @AviramNetanel 2 роки тому +1

      I lost him too there :P

    • @mclandeg1
      @mclandeg1 15 днів тому

      If you feel hard understanding this, then you need a carrier shift

  • @GarethHall
    @GarethHall 3 роки тому +25

    Trying to my hardest to understand what the advantages are. This just seems more cumbersome and messy, e.g. keeping an array of observers. I’m sure and believe this probably is the future, but it just hasn’t clicked yet why this is better.
    Would love to see a direct comparison of implementing something with and without combine, then walk and talk through why each component of doing it via combine is better.

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

      Yes, We could easily handle button taps just by creating variable with type as Function. and just by calling cell.onButtonTapped = { [weak self] in print("tapped" )}. I didn't get why should I migrate to combine to add these additional boilerplate codes

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

      imperative vs declarative

    • @KitsuneSoftware
      @KitsuneSoftware 5 місяців тому +2

      Agreed. The argument for them appears to be "we don't like closures, so… lets make a new API which has two closures and also requires an extra local property". Why bother?

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

    Always love his tutorials, he helped us to digest and organize Combine concepts in understandable and demonstrable manner.

  • @mrVytautasS
    @mrVytautasS Рік тому +2

    Excellent video. Love that this is explained in a real world scenario rather than playgrounds, which I find harder to understand.

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

    Yes, would love to see more Combine examples! Thank you!

  • @nurlanakylbekov7266
    @nurlanakylbekov7266 3 роки тому +7

    Waiting for. Waiting for not playground explanation and examples, waiting for real project examples)) for example how to subscribe or observe (I still can’t understand what for what) some ui elements, if change something in VC1 it will be affected on VC2. In general I have task that I have to update data in my music app. PlayerVC will be dismissed but I want still update artImage, song name, artistName to be updated in ListVC when music has changed.

  • @BABEENGINEER
    @BABEENGINEER 2 роки тому +1

    I love the explanations. Really helpful!

  • @chesterman18g
    @chesterman18g 3 роки тому +3

    thanks for the nice and easy to understand intro!

  • @se7enzz258
    @se7enzz258 3 роки тому +2

    waiting for this video for a long time.❤️
    Hope to see more videos about Combine Framework.

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

    Waiting for your awesome explanation Man 😍❤️

  • @eray9280
    @eray9280 3 роки тому +2

    You rock dude. Keep going!

  • @sahebroy4678
    @sahebroy4678 2 роки тому +2

    2 questions -
    1. Whats the purpose of making a AnyCancellable object and using sink, when we can do that using normal closures.
    2. Whats the purpose of using Passthrough object in a cell, when again this can be achieved by a normal closure.
    Am I missing something or this is just a closure with new syntactic sugar?

    • @navr3505
      @navr3505 Рік тому +1

      yes same for me, feeling confused, Future is nothing but @escaping in closure and Passthrough what ever shit that is, is again similar to what we do using closure completionhandlers, no idea why I should be using this

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

    best video about combine, easy and clear, thank you

  • @KanyantaMubanga
    @KanyantaMubanga 2 роки тому +1

    I like the way you say "cell"

  • @Eugene.Berezin
    @Eugene.Berezin 3 роки тому +1

    Thank you

  • @hashankannangara8723
    @hashankannangara8723 3 роки тому +2

    Waiting for video like this...❤️

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

    thank you

  • @ANILKUMAR-vv1fz
    @ANILKUMAR-vv1fz 3 роки тому +1

    Awesome Video

  • @trendz4422
    @trendz4422 2 роки тому +2

    We could easily handle button taps just by creating variable with type as Function. and just by calling cell.onButtonTapped = { [weak self] in print("tapped" )}. I didn't understand why should I migrate to combine to add these additional boilerplate codes.

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

    1) Can we use PassthroughSubject to Bool isSelected of CellView? Is it possible to assign Model object to action instead of String and print value of Object with indexPath?

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

    you sound like the guy from new boston tutorials. Awesome tuts btw, that deserves a thumbs up

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

    You put the cell on the same page as the ViewController? He's a madman I say. A MADMAN!!!

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

    Thank you for this video. It is very helpful. I have a doubt that why we should use combine instead of delegate or closure approach. What problem of delegation and closure is solved by combine. passthrough object seems like a closure but with extra functionality. if we think it in reverse order that is delegate or closure is solution of complexity of combine then it is right.

  • @AkimboFennec
    @AkimboFennec 7 місяців тому

    Did the new Observable framework substitute combine ?

  • @user-yd9xy3rb4x
    @user-yd9xy3rb4x 3 роки тому +1

    I’ve just realized that there aren’t videos on main frameworks for Swift on UA-cam. You can be the first one to make 😊

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

    10: 15 - Can we have more about memory leaks? I often use self.myModel = result or self.myModel.append(result), then self.collectionView.reloadData or tblView.reloadData. I never used [weak self]. What does it give? Thank you🙏

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

      Read about scenarios when memory leaks happen, you will know.

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

    Yess i really interest in combine, actually i didnt really well knowledge about delegate pattern also, but that generic things and .store .sink is interesting also. maybe i will learn about delegate pattern, then get back here to learn that combine for rxswift if im not mistaken, thankyou so muchh

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

    Please do more Reactive Programming!

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

    In a 4th minute, what did you type for a shortcut for a func? Thanks

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

    There is some crazy shit going on here
    Please do more sir, you are the best

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

    I like how you use combine for the server call but i'd rather use a weak ref closure for the tap as a var instead for cell so i don't have to create that extra array of observables for each cell. just a weak closure that passes back a string value would be less overhead. This if fine just my pref

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

      also since this is a tutorial on combine i get it. just throwin in 2 cents years later :-)

  • @abdalrahmanaboujeeb1049
    @abdalrahmanaboujeeb1049 2 роки тому +5

    Actually I have expected more from Combine as reactive framework, Rx handles data easier and the code is more neat.
    And you don't have to actually reload data when you're using Rx while you need to do it while using Combine.
    Can we have a video comparing both frameworks with pros and cons?
    Your videos are always easy to explain so I would appreciate more contents about Rx frameworks on how to handle variables instead of tableviews or collectionviews.
    Thanks.

  • @user-tq4fv8ie6q
    @user-tq4fv8ie6q 3 роки тому +1

    i love your new mic Afraz. what's the make?

  • @YashSharma-qo1sy
    @YashSharma-qo1sy Рік тому

    I have learnt basic Swift and done GCD and Operations Queue not touched UI yet but i have been ordered to complete basics of Combine Framework and I am not getting anything in this as well as any other video. Can anyone guide what should i learn first, like what should be the order of learning. I don't even know what is viewcontroller in Swift, but i am confused weather I should learn viewController directly or is there something that i should know in prior to this.

  • @laurj00
    @laurj00 4 місяці тому

    Where can I get the code for this example ?

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

    Show some api data handler without future just with anypublisher generic please.

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

    @iOSAcademy bro, the link to the source code is wrong and I also wasn't able to find it in your Git repo. Could u pls add it?

  • @Ipat639
    @Ipat639 2 роки тому +1

    Do we need combine after async/await coming?

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

      They offer different features

  • @davidstreet9419
    @davidstreet9419 3 роки тому +3

    You're a master, a genius. Thanks for all of the incredible content! Nice audio improvement btw!

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

    Please organize the videos to playlist

  • @rev_kous9275
    @rev_kous9275 3 роки тому +2

    I’m waiting for the equivalent: RxSwift.

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

      Coming soon

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

      Me 2 bro

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

      @@motexdevelopers1123 RxSwift is one of the most demanded skill for iOS developer jobs.

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

      @@rev_kous9275 sure btw its work with under ios versions combine just for 13+

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

      @@motexdevelopers1123 Also, MVVM pattern suits best for reactive programming.

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

    Skip the boiler plate ua-cam.com/video/hbY1KTI0g70/v-deo.html

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

    Combine is cool, but UIKit, dude! :D it's 2021, come on!

  • @3ilz
    @3ilz 2 роки тому

    you didn't really explain what any of these combine subscribers do or how they work..

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

    I appreciate the effort but this is not a good video. 80% of the video is typing some UIKit code...and the combine part is not really well explained.

  • @guyincognito5663
    @guyincognito5663 Рік тому +1

    I’m sorry, where tf are “the basics”? It’s just a dump of new terms, none explained… I know less after watching this.

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

    to be honest, i don't understand what you're saying at all

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

    Don't bother. Not really a useful intro to Combine. Half the video is spent on typing UIKit code. On top of this sink is not even explained.

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

    Man … i cant stand your tone … and the contents is not much better .. i’m gonna perhaps go ahead and forget you exist… and no worries, i did go ahead and told yt to go ahead and stop to go ahead and suggest your vids 🙂