I have a view that draws a circle, and fills it in with a color. In terms of MVC, would it be more appropriate to have the UIColor property declared in the model, or the view?
If it were in the model, i could use KVO to see when it changes. However, how could I communicate from the controller to the view to fill the circle the specified UIColor?
If it were in the view, I could just manually change the property to the new UIColor and it would work.
So my question is.. does a UIColor property belong as a model property, or a view property?
Thanks
I would say that it depends on your use.
If different colors represent different “things” (ie a red car is different from a blue car), put it in the model, since that is a property of that object.
If the color is just a graphical representation (ie every car that is a 4-door is shown by a red circle and every car that is a 2-door is shown by a blue circle) I would put it in the view (checking the car’s door property and setting the color by looking at that).