Per MVC design pattern as in GOF, "a view can be disabled so that it doesn't accept input simply by giving it a controller that ignores input events". That means, we decide a view first and then pick a suitable controller to that as the scenario needed.
But iOS storyboard based development is primarily driven by Controller (instantiateViewControllerWithIdentifier) and a view (scene) is tightly bound to a Controller Class. Does this mean iOS lacks this MVC feature? And we are not doing MVC to its full potential?
Can someone help to clarify this?
Thanks.
1 Answer 1
Generally in iOS if you want a view not to respond you should set it to not be enabled for user interactions by calling -[UIView setUserInteractionEnabled:NO]. So it supports MVC just fine, it just does it differently (and in my opinion more intuitively) than the way suggested in GOF.
-
User interaction just one aspect. A context can ask for a controller with different business logic and different level of user interactions.Saran– Saran2017年05月06日 16:32:47 +00:00Commented May 6, 2017 at 16:32