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 trialCole Enabnit
3,414 PointsWhy did we create those outlets and add the code to the viewDidLoad method?
Pretty basic questions here but I just don't quite understand:
1) Why did we create outlets for the cover image, title, and description? What purpose do the outlets serves in the grand scheme of the app?
2) Why did we then add the code to the viewDidLoad method? In the PlaylistDetailViewControler.swift file, we created an instance of the Playlist struct from the Playlist.swift file, right? And we're getting the specific playlist data from the PlaylistMasterViewController.swift indexing the MusicLibrary.swift file, right? So why do we need this viewDidLoad function? The documentation says viewDidLoad is "Called after the controller's view is loaded into memory." Huh?
I realize these are concepts I probably should already understand. Please feel free to point to specific videos in the course or articles in the documentation. I haven't been able to find the place(s) where Pasan explains these things. Thanks in advance!