Skip to content
This repository has been archived by the owner on Dec 5, 2019. It is now read-only.

Document how we do MVVM #2

Open
jspahrsummers opened this issue Jul 1, 2013 · 7 comments
Open

Document how we do MVVM #2

jspahrsummers opened this issue Jul 1, 2013 · 7 comments

Comments

@jspahrsummers
Copy link
Member

Especially how hierarchies work and line up to the view and model layers (or don't).

@paulyoung
Copy link

This would be most excellent.

+@jwilling +@CodaFi

@oleksii-demedetskyi
Copy link

👍 for description.
Most interesting aspect for me - how screen transition performed, who sit above the view-models.
I practicing writing MVVM-like code little more than half of last year, so I want to look how another people will implement it, and have some reliable source for answering: "Why you do this?". :)

@tonyxiao
Copy link

On this note, I'd love to see some sample app written MVVM style also!

@tonyarnold
Copy link

I would love to see some real-world examples of MVVM in use, as well as how to appropriately test the various components. 👍 from me as well.

@DuneParkSoftware
Copy link

If anyone is interested, I have started building a small demo app (https://github.com/DuneParkSoftware/RAC_MVVMDemo) to explore the MVVM pattern with RAC on iOS. I am fairly new to MVVM and RAC. If you check out the code and notice that I'm doing something inefficiently (or just plain wrong), please make a pull request.

So far, I have a singleton object that "does some work" in the background. Meanwhile, a view model watches the singleton's property and converts it for the view controller. The view controller, in turn, updates the display.

There is also a RACCommand on the view model that is bound to the view, and simulates sending next/error/complete signals based on the singleton's state.

In the past, I have experienced issues with the viewModel not being released when its owning viewController is discarded. Therefore, the code is liberally commented with NSLog's so I can make sure the viewModel gets dealloc'd properly and doesn't leak.

I'm not certain that I'm using the RVMViewModel active property and signals correctly. Also, I don't understand how the forwardSignalWhileActive: and throttleSignalWhileInactive: signals are meant to be used.

@ashfurrow
Copy link
Member

I've also gone ahead and opened an app that uses this repo: https://github.com/AshFurrow/C-41 Pull requests welcome :)

Not sure how it relates to how you do MVVM, but if it's similar I wouldn't mind writing the documentation for it for this repo. Let me know.

@jspahrsummers
Copy link
Member Author

I also have an example project at jspahrsummers/GroceryList.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants