Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialmustangxy
3,212 PointsIs it really necessary to call configureView() twice?
I seem to understand that the configureView() method is called firstly inside the didSet observer and secondly inside the viewDidLoad() method to make sure that the necessary changes to the UI are performed. But, since the fact that viewDidLoad() is called means that we're 100% sure all UI elements exist and are not nil (and therefore we can set new values for them with no worries whatsoever), why bother shooting in the dark inside didSet? Aren't we just consuming time and resources for a potentially useless method call? Or is there some advantage in doubling the call?
1 Answer
KB Li
Courses Plus Student 625 PointsI thought about it too. And I hope someone could answer this! Really appreciate it!