How to use Combine with MVVM for UIKit and SwiftUI - fetching tweets example project

Поділитися
Вставка
  • Опубліковано 4 лис 2024

КОМЕНТАРІ • 38

  • @alexl2512
    @alexl2512 6 місяців тому

    Love this one. It’s good to see how you use Combine to optimize a project.

  • @developer-juice-Khailenno
    @developer-juice-Khailenno 2 роки тому

    she is going to sink the tweets in the UIViewController on the viewdidload! wow you broke this video up into sections very well. such advanced tutorial!

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

    She is a good teacher indeed

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

    I love how you gently explain that the other you tubers method is awful :) Great video thanks

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

    Finally a video that shows how to refactor from basic MVC to MVVM!!!! On top of that, it uses Combine! You are the best! If you can do more MVVM videos that would be great

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

    As a software engineer, but not as a Swift developer full time, just for my own app: this is incredibly helpful for learning how to make my own code better. This is awesome.

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

    This is very informative, thank you!

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

    Thank you, Karen. The section on @Published and UIKit help me out of a jam. I have been doing a lot of SwiftUI lately and when I went back to UIKit, things weren't working due to the will-set behavior.

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

    This is excellent as a tutorial. a lot of hand on practices. your channel is great keep up the good work.
    would really like to see more videos like this. Advanced tutorials would be even better. All of UA-cam is filled with tutorials for beginners.

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

    Fantastic! Your talking through your thought process really helps me understand the subject. Bravo. Much appreciated.

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

    While a lot of this went over my head for now I love the way you break things down and show how to refactor it!
    Looking forward to checking out more of your videos. :-)

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

    Woman you are a gem

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

    Great Code Great Delivery thanks for your work.

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

    You are THE BEST at explaining Combine. Could you do a video on error handling? Which streams should handle the error, which ones should ignore it

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

    Thank you! You just give me courage to try SwiftUI

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

    compact and perfect lecture

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

    Thanks for awesome video

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

    Thank you for more of these reviews!!!

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

    Incredibly detailed!

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

    Thanks for Sharing This Tutorials

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

    great work!

  • @AndrewDChristie
    @AndrewDChristie 9 місяців тому

    Thanks!

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

    I thought Decodable worked for both cases. Can you please make a video of a simple project using Combine, teaching the simple stuff of MVVM as well?

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

    Great job!

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

    Great tutorial. Can you recommend any resources for learning combine for beginners?

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

      You can have a look at this post www.swiftyplace.com/blog/how-to-learn-combine-framework. I used the books from Ray Wenderlich and Donny Wall.

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

    nice

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

    Well explained, thanks! How do you decide where to use weak self vs unowned self?

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

      This is a good question and not an easy one. Most people go always with weak, because it will never crash your app. But weak means you have to deal with optionals. If I am calling on self inside a closure and I know the closure has self as its only owner, then I use unowned. Maybe this post explains it better vojtastavik.com/2019/10/21/why-you-should-use-unowned-more-often/.

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

    UA-cam is filled with absolute shit tutorials and they all have these massive followings, like LBTA. It's shit code. I'm so glad you're doing this. Keep doing this. Let's clean this stuff up LOL

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

      Thanks for the motivating words!
      I was watching LBTA in the very beginning of my iOS learning. But I realised soon that there is very little valuable information in it. I think people like it because he makes it sound very easy and he skips the more advanced stuff.

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

    Why not use ".replaceError(with: )" insead of "catch { _ }" ?

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

    Just a comment. View Model should only concern itself with Presentation logic. Eg, how to compose & setup a certain view, what state should the view have, what will happen when a button is tapped, etc. TwitterApi struct is definitely Domain logic so it should go to the Model. ViewModel shouldn't even know that the Twitter API existed. It only concern itself with the tweets that has been mapped into their primitive types like string, int, float, Data, etc, and ready to be used by the Views.
    Anyway, that's not really why I am here though. If I were to break down the software engineering of the code, it will take quite some time. I'm just here to learn Combine. Thanks for the content. I use RxSwift all the time and I just found this video out to help me moving from Rx to Combine.

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

      Okay, one more comment. "Why not use Codable". Because YAGNI. You Ain't Gonna Need It. We just use what we need to use at the time. So if you only need to Decode the JSON, you don't really need Codable. We can refactor it to Codable when we do need to do both Encoding and Decoding.

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

    This seems way too advanced.

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

      There are a million ‘intro to Combine’ videos you can check out.
      But very few ‘here’s what you can actually do with Combine’, especially at this pace and level.
      Before long you’ll be as glad for this as I am!

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

    Hi Katrin))
    use `self.` is not required with [unowned self] ...
    ... and in JSON file we have `profile_image_url_https` key.
    Therefore we can remove chunk of code -
    ⚠ remove in TwitterAPI - var jsonDecoder and in.decode() in param decode: use JSONDecoder()
    ✅ add to model of User -
    private enum CodingKeys: String, CodingKey {
    case name
    case profileImageURL = "profile_image_url_https"
    }
    ⚠ remove /.replacingOccurrences(of: , with: )()/
    in ViewController (what in fact UITableViewController) in tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) method
    ✅ as a result line will look like - / cell.profileImage.sd_setImage(with: URL(string: tweet.user.profileImageURL)) /
    I think it looks much neater))