This is a companion discussion topic for the original entry at https://www.raywenderlich.com/1941154-fundamental-ios-design-patterns/lessons/21
This is a companion discussion topic for the original entry at https://www.raywenderlich.com/1941154-fundamental-ios-design-patterns/lessons/21
Hi! The final project for observer doesn’t work, it shows 100% on the cells after completing any of it? Mine also doesn’t update the cells after putting the code in. Anyway the resources can be updated with correct final code? thanks!
@jrg.developer, it looks like we directly access the value in model by a cell view. Is it ok in MVC? Or please explain what I misunderstood? =)
@jrg.developer Can you please help with this when you get a chance? Thank you - much appreciated! :]
This isn’t a “completed,” but rather, a “score” for the questions that you go right versus the total questions answered. Hence, if you mark 8 questions are right and 2 as wrong, your score is 80% (8 / (8 + 2).
Make sure you typed everything correctly and exactly as shown. If needed, you can also copy/paste from the final project too. If you have any specific problems/questions not addressed, let me know! :]
Design patterns are a starting point –– a template, not a complete solution. As most things, there are tradeoffs with each decision.
When evaluating whether a decision is “okay” or not for a given question, I normally ask two questions,
-
“Does it violate SOLID?”
-
And if it does, “Am I okay with the consequences that will result?”
I go into more details about SOLID on this thread.
TLDR:
It’s probably okay, as long as you understand the consequences of doing so. If you anticipate a problem that it will cause, design for it.