Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

iOS Build a Playlist Browser with Swift Refactoring Our Code Determining Playlists Programmatically

Joshua Michaels
Joshua Michaels
7,306 Points

Layout errors with placeholder UIImageView instances

Getting layout errors when trying to add constraints to the placeholder images to the Playlists view.

See photo to see the orange/red boxes that show up. I'm following the videos exactly.

If you try to update the frames, the images are resized to the actual image size unless you use "Placeholder" in Size Inspector > Intrinsic Views.

Does anyone know how to resolve these issues?

Image Constraints

Joshua Michaels
Joshua Michaels
7,306 Points

Maybe this has to do with an updated version of XCode and Swift but unless you specify the top and bottom constraints with the middle placeholder images, you will get these errors/warnings.

Once those have been specified and the Equal Height/Equal Width boxes are checked, everything works.