Clean Architecture iOS [MVC vs MVVM]

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

КОМЕНТАРІ • 49

  • @rebeloper
    @rebeloper  4 роки тому +1

    Which is you favourite MVC or MVVM?

    • @aravindhann9772
      @aravindhann9772 4 роки тому +1

      MVVM is very useful for large application

    • @antonilin3123
      @antonilin3123 4 роки тому

      comprehensive explanation ) Thanks a lot )

    • @rebeloper
      @rebeloper  4 роки тому +2

      Agreed! BTW check out my latest video about building your very own *Custom Frameworks in Swift* : .ua-cam.com/video/oZloIsF1H4g/v-deo.html

  • @Eugene.Berezin
    @Eugene.Berezin 4 роки тому +7

    How about binding? One of the benefits of MVVM that you can create binding and update your view reactively.

    • @rebeloper
      @rebeloper  4 роки тому +1

      Best comment on this video :) I just did not have the time to explain bindings. Reactive programming may be confusing for starters :) BTW check out my latest video about building your very own *Custom Frameworks in Swift* : .ua-cam.com/video/oZloIsF1H4g/v-deo.html

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

    Exactly the tutorial I was looking for, thanks so much for the great video :)

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

      You're very welcome! BTW what do you think of my latest video on Flexible Header in SwiftUI: ua-cam.com/video/TaLA3ZBk6Zo/v-deo.html

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

    This is the best explanation I ever saw about the theme.
    Make it so simple for beginners understand it by comparison.

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

      Glad it helped. MVC and MVVM can be tricky to understand. BTW now you can have a Slide in Menu easily in SwiftUI: ua-cam.com/video/9WKVXHgEFU8/v-deo.html

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

    Thanks for the video. I will integrate a new project and the architecture is Clean MVVM; your video was amazing for my compreension.

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

      Glad it was helpful! If you liked this video you will love *Swift Encryption with Crypto Manager* : ua-cam.com/video/PCKQ6HXIFo4/v-deo.html

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

    I already implemented MMVM architecture in Java MVVM hopefully can implemented it in IOS Swift after knowing detail of Xcode, newcomer in Apple Gadget , thank you Mr for the nice explanation

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

      You are welcome, Johan! BTW if you liked this video you will love my newest tutorial *Google Maps Swift: How to Implement Google Map in iOS* ua-cam.com/video/PFlTqE2ckgI/v-deo.html

  • @SourovDattacse
    @SourovDattacse 4 роки тому +2

    Thanks for your video. However, I did not understand the separation of concern using a view model. Getting Puzzled

    • @rebeloper
      @rebeloper  4 роки тому

      Short story: make sure that your views only display, your controller only controls the views and everything else is moved out of them. It may be confusing at first, but practice makes perfect. BTW check out my latest video about building your very own *Custom Frameworks in Swift* : .ua-cam.com/video/oZloIsF1H4g/v-deo.html

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

    Thanks for your video. ✅
    1/but when we have logic in cell and in its viewController. we one ViewModel contains all the logic or create one for the cell and another for viewController.
    "/ when we have for example three viewController that contains the three steps of creating something. we make one ViewModel instantiated in each ViewController or we make three different ViewModels class (first ViewModel, second view model, their ViewModel)

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

      I would go with one view model moved through the 3 view controllers. BTW if you enjoyed this tutorial make sure you take a look at my latest video about Progress Indicator Examples: ua-cam.com/video/nHr2hh-KgTk/v-deo.html

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

    Thanks for the explanation!

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

      No problem! BTW do you like the Previews in SwiftUI? Find out everything you have to know about Previews here: ua-cam.com/video/rxfter_wMXI/v-deo.html

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

    Sir, can you add also MVP and VIPER architectures?

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

      Noted. Till than take a look at my lates video about 30 Xcode Keyboard Shortcuts You NEED to Know: ua-cam.com/video/CWjHI3vZLSk/v-deo.html

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

    Where did you get this definition of MVVM from? It seems quite different to the original idea from windows

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

      Don't really know where from, it's just is in the iOS community. BTW if you did like this video I think you will enjoy "How to Publish an App to the App Store": ua-cam.com/video/ykiD5wqwSe4/v-deo.html

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

      Hmm I think your example was too simple to really show the benefit of MVVM. Without databinding or the mediator pattern all you have is a simple mapping function.

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

    In your example, is not the same thing that create a utility class wich receive a skillLevel and return a levelname ?

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

      Yes, classes are also okay. If you enjoyed this video I suggest taking a look at Fira Code: ua-cam.com/video/fUk9hLLPvqo/v-deo.html

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

    But what is Clean Architecture?

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

      Sorry the video did not give you an answer.

  • @ОлесяУкраинская-т1д

    Cool video!Thx!

    • @rebeloper
      @rebeloper  4 роки тому

      Glad you liked it! BTW check out my latest video about building your very own *Custom Frameworks in Swift* : .ua-cam.com/video/oZloIsF1H4g/v-deo.html

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

    good explanation

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

      Thanks and welcome! Making MONEY just got EASIER on the App Store (and you didn't even know it!) 👉 ua-cam.com/video/7AVX4r8iV-k/v-deo.html

  • @davidnitzsche-bell5418
    @davidnitzsche-bell5418 3 роки тому

    10:10 couldn't you just create computed properties, name and level, in the model and put the logic in there? Then, for both the MVC and the MVVM, filling in the TableViewCell would be the same two lines.

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

      Yes, but I would not be talking about MVVM. BTW if you did like this video make sure to take a look at how to create a MEME generator in SwiftUI: ua-cam.com/video/QyxQ624ZM94/v-deo.html

    • @davidnitzsche-bell5418
      @davidnitzsche-bell5418 3 роки тому

      @@rebeloper Thank you for answering. Let me rephrase.... I'd like to see a case where MVVM would be 'required' or noticeably better; a case where using computed properties simply wouldn't work. I ask because I'm still trying to really understand the difference between the "C" in MVC and the "VM" in MVVM. So far, no video I've seen really does that.

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

    nice

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

      Thanks, Abel.
      Here's the easiest realtime app I’ve ever built 👇
      ua-cam.com/video/tFA30p1w_vQ/v-deo.html

  • @alexzvarich
    @alexzvarich 4 роки тому

    Amazing!

    • @rebeloper
      @rebeloper  4 роки тому

      Thank you! Cheers! BTW check out my latest video about building your very own *Custom Frameworks in Swift* : .ua-cam.com/video/oZloIsF1H4g/v-deo.html

  • @kishannakum104
    @kishannakum104 4 роки тому

    💥💥💥💥

    • @rebeloper
      @rebeloper  4 роки тому +1

      💥💥💥💥 indeed! BTW check out my latest video about building your very own *Custom Frameworks in Swift* : .ua-cam.com/video/oZloIsF1H4g/v-deo.html

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

    Rebeloper thanks always for your tutorials they are very clear and help the whole community a lot! Thank you!
    I need help .. I have a struct
    struct TimeSelModel {
    let hour: String
    let minute: String
    }
    ------------------------------------------------------
    I recover data this way because I need to view some data in section 0 of my collectionview and other data in section 1
    struct TimeSelData {
    static func dataSec (section: Int, _ completion: @escaping (Result ) -> ()) {
    if section == 0 {completion (.success (dataSec0))}
    else {completion (.success (dataSec1))}
    }
    }
    let dataSec0 = [
    TimeSelModel (hour: "09", minute: ": 30"),
    TimeSelModel (hour: "17", minute: ": 00")
    ]
    let dataSec1 = [
    TimeSelModel (hour: "12", minute: ": 00"),
    TimeSelModel (hour: "19", minute: ": 00")
    ]
    ---------------------------------------------------------------
    I use the data this way inside my controller
    private var section: Int = 0
    var data: [TimeSelModel] = []
    private func fetchData () -> Void {
    TimeSelData.dataSec (section: section) {(result) in
    switch result {
    case.success (let data):
    self.data = date
    case.failure (let error): print (error.localizedDescription)
    }
    }
    }
    func collectionView (_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
    self.section = section
    return data.count}
    func collectionView (_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
    let cell = collectionView.dequeueReusableCell (withReuseIdentifier: TimeSelCell.cellID, for: indexPath) as! TimeSelCell
    cell.dataModel = data [indexPath.item]
    return cell
    }
    It doesn't work I don't get the right data for the sections of my collectionView .. Using your example in your tutorial how can I achieve my goal of displaying different data for 2 different sections of a collectionView?

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

      Explaining this in a comment is hard. I can help you in a mentoring session: rebeloper.com/mentoring
      BTW take a look at my latest video: SwiftUI Animation ua-cam.com/video/z4xcp7QiUrE/v-deo.html

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

      @@rebeloper thanks Rebeloper it's interesting ! if i have big problems i create a session with you! thank you

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

      Awesome Fabio. Looking forward to the sessions when you need them. Do you like SwiftUI? Check out my latest Live Stream on SwiftUI Button Styles: ua-cam.com/video/jzLby63iGvI/v-deo.html

  • @BarbaraGarcia-q2j
    @BarbaraGarcia-q2j 5 днів тому

    Williams David Young Lisa Jackson Kimberly

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

    Thanks for the explanation!

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

      Glad it was helpful! If you enjoyed this video you might want to take a look at my lates video: Chart in iOS in SwiftUI -> ua-cam.com/video/3X2xvgNvlpE/v-deo.html