Search code examples
iosswiftautolayout

UIViewController autolayout infinite content


I have a viewcontroller created via storyboard, but the content in the viewcontroller is dynamic, it can have a lot of data or practically none, the problem is that when the content is a lot the data isn't showing because its bigger than the viewcontroller or the screen height, is there a way to set like a UIScrollView so that when the data in the controller exceeds the screen height i can simply scroll down or up?, thanks in advance.

i mean, for example, normally the screen should look like this:

1

but sometimes it looks like this:

2

as you can see the when the info exceeds the screen height, i can't see the data correctly


Solution

  • Depends what type of data it is. I suggest for your case to use a UIScrollView, which will allow you to scroll up or down.

    enter image description here