Kodeco Forums

Video Tutorial: Swift Scroll View School Part 5: Storyboards and Auto Layout

In this video tutorial you'll learn how to use storyboards and Auto Layout to set up some simple controls inside a scroll view.

This is a companion discussion topic for the original entry at https://www.raywenderlich.com/3911-scroll-view-school/lessons/6

hi greg in this tutorial, after you add constrain to imageview inside scrollview, there are two auto layout issue “Scroll view has ambiguous scrollable content width and height”, I understand that this is because scrollview don’t know the content size of imageview, so when you set the image of the imageview , the error disappear, but what if the image is loaded from PHAsset of from network, in this case scroll view won’t know the content size util the image is loaded, so how should I handle this problem? do I have to add imageview programmatically?

You could set the contentSize property of your UIScrollView programatically:

yourUIScrollView.contentSize = yourUIImage.size

The Challenge Starter project is missing or is there no starter project and is that the intention? Also, why are we seeing comments from previous iterations of the course? This can be confusing.