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 trial

iOS Build a Playlist Browser with Swift Building the Master and Detail Views Displaying Playlist Information

Max Lettenberger
Max Lettenberger
2,017 Points

Labels in view (playlist title, title, description) don't appear when run. (covered by icon?)

My code is identical to Pasan's, but when I run my app, the labels in the view which I added to the image view don't show up. Are they being covered by the image view? If so, how do I bring them to the front?

6 Answers

Daniel Sattler
Daniel Sattler
4,867 Points

Did you check the constraints? If you´ve added constraints to, let´s say the image, then you will need to add constraints to everything else. Fix them in place so to say. Maybe this leads you in the right direction.

Bill Siever
Bill Siever
7,649 Points

I had a similar problem and it appears to have been due to the order of the views (as Justin suggested), but the Storyboard was showing the frames in the expected order (the placeholder in the back and the UIView for the title/description on top). I suspect this may be a glitch in Xcode/Storyboard.

My "Symptoms": If I didn't set the background color, it worked just fine. After setting the background color it no longer showed the title/description view.

My "Fix": I sent the UIImageView (the placeholder) to the FRONT (select it and do Editor->Arrange->Send to Front) AND THEN back to the BACK (Editor->Arrange->Send to Back).

John Borden
John Borden
11,674 Points

Had the same problem, tried this, it worked.

Marie Nipper
Marie Nipper
22,638 Points

Also, check your document outline. It could be something as simple as your Image View is just sitting on top of the other View.

I had the same problem with the description label. I checked the debugging area and on my Playlist.swift file i had this code:

description = playlistDictionary["Description"] as String!

turns out i had description in uppercase when I called it on the dictionary, so i changed it to this:

description = playlistDictionary["description"] as String!

this might be it, if not, check what the other users said too! hope it helps.

Kevin Gary
Kevin Gary
3,788 Points

Thank you for a sizable amount of frustration saved by posting this. I had it as "descript" LOL.

Cyrus Walker
Cyrus Walker
13,801 Points

I selected the View that contains both the Title and Description in the storyboard Document Outline and Sent it to the Front by Editor>Arrange>Send to Front

My description was the only instance not showing up. I just commented out playlistDescription and it worked, but I can't figure out why. All other code is also identical to Pasan's. Anyone have an idea why?

if playlist != nil {
            // playlistDescription.text = playlist!.description
            playlistCoverImage.image = playlist!.largeIcon
            playlistCoverImage.backgroundColor = playlist!.backgroundColor
            playlistTitle.text = playlist!.title
William Hughes
William Hughes
1,949 Points

I have the exact same problem...when I comment the lines out in this same instance they appear, but when they are uncommented they disappear again. Code is identical to Pasan's as well.