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


Ben Rogers
Ben Rogers
6,767 Points

Artwork is stretching

I followed the code word for word, but when I run the app, the artwork stretches horizontally very noticably. The only thing I can think of is that my version of XCode (10.1) could have behavioral differences.

Is anyone else having a similar issue?

Which course/video is this for?

2 Answers

Did you set your content mode on the image to Aspect Fit? By default it is Scale to Fill which would cause the horizontal stretching.

artworkView.contentMode = .scaleAspectFit

Also make sure that the 'Beginning' image in storyboards for ViewController is set to aspect fill.

Ben Rogers
Ben Rogers
6,767 Points

Brandon Mahoney,

The course is "Build an Interactive Story App with Swift" and the specific video is titled "Creating Views Programmatically". I believe it's in the third part of the course