Kodeco Forums

MVVM Tutorial with ReactiveCocoa: Part 1/2

Learn how to use the Model-View-ViewModel (MVVM) pattern in your iOS apps with ReactiveCocoa in this 2-part MVVM tutorial series.


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/2346-mvvm-tutorial-with-reactivecocoa-part-1-2

Hi thanks for this tutorial.

But I only know Swift and im looking forward to learn MVVM with swift and I cannot find anything.

Do you plan to update this tuto for Swift ?

Thks !

@gfelot
See here GitHub - jechol/mvvm-tutorial-with-reactivecocoa-in-swift: Swift 2.1 + Reactive Cocoa 4.0 translation for http://www.raywenderlich.com/74106/mvvm-tutorial-with-reactivecocoa-part-1

1 Like

How can I make the first task work(show title and text) If I am using a storyboard?

This tutorial is not as good as the ReactiveCocoa tutorial. It basically keeps adding components without adequately explaining their role:

  • What is the role of ViewModelServices? What service should it provide to ViewModels? If I were executing a login request, and i received a token in the response - would ViewModelServices handle saving the token to the keychain?
  • This ViewModel is for search, it consists only of a single NSString searchTerm property. If I was building a registration form consisting of 10 fields, would the ViewModel consist of 10 properties, one for each field?
  • Why is the ViewModel supplied by the AppDelegate and not an instantiated in the View Controller? What benefit does this achieve?
  • It would make a lot more sense to have a group named Model and a subgroup: Model/services. Likewise a group named ViewModels and a subgroup ViewModels/Services.

Thank you for this tutorial. Would you update it for swift 3.0 and reactivecocoa 5.0?

Podfile in the project needs to be updated. target is missing.

the pod install throws error

[!] The dependency `ReactiveCocoa (= 2.1.8)` is not used in any concrete target. 
The dependency `objectiveflickr (= 2.0.4)` is not used in any concrete target.
The dependency `LinqToObjectiveC (= 2.0.0)` is not used in any concrete target.
The dependency `SDWebImage (= 3.6)` is not used in any concrete target.

This tutorial is more than six months old so questions regarding it are no longer supported for the moment. We will update it as soon as possible. Thank you! :]