macdevnet / mvvmc-demo Goto Github PK
View Code? Open in Web Editor NEWSample code from MVVM-C In Practice Talk
Sample code from MVVM-C In Practice Talk
In this project,I did not saw any code like 'push' 、'present' and 'dismiss'.
and in real-world, I must push some controller use navigationController.
with my own mind, I think should put this push or dismiss code in 'pageCoordinate',
some thing like this:
In ListCoordinator.swift :
extension ListCoordinator: ListViewModelCoordinatorDelegate
{
func listViewModelDidSelectData(_ viewModel: ListViewModel, data: DataItem)
{
detailCoordinator = DetailCoordinator(window: window, dataItem: data, nav:self.navigationController)
detailCoordinator?.delegate = self
detailCoordinator?.start() // within ,push detail controller
}
}
extension ListCoordinator: DetailCoordinatorDelegate
{
func detailCoordinatorDidFinish(detailCoordinator: DetailCoordinator)
{
self.detailCoordinator = nil
self.dismiss ...
}
}
is it a right way?
Hi,
do you have some starting point for a MacOS app based around the NSWindowController. Not entirely sure whether to pass that one around or how to best refactor this?
Thanks,
Daniel
As far as I understand MVVM, the operations (CRUD) should happen inside the model but the operations triggered from a view into the view -model, should happen inside the view-model only.
In this case, when I hit the login button, the login function which checks the Username and Password should be there in the MVVMCAuthenticateViewModel and not inside MVVMCAuthenticateModel. Could you please take out some time and see what I am referring to? Overall wonderful lecture in the video, it cleared a lot of my doubts.
Question: Who should be responsible for detecting model-changes?
In the sample app you display a list of people and their rank. I guess that list does not change to often, but lets say it did. Who would then be responsible for doing these updates/refetches?
Possibility 1: It's the models responsibility and it should contain a timer function to periodically do the refetch. But then I guess the model would need a way to notify the viewModel about the update?
Possibility 2: It's the viewModels responsibility. If would have a timer function and periodically call the model.items function to update/refetch.
(Of course you could do it easy and put a "refresh" button in the view that the user has to click to get the latest data, but I would like it to be more "event driven")
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.