Tanner
Tanner

Reputation: 183

Use ViewControllers in UIScrollView

I want to use a UIScrollView and a UIPageController to display my View controllers instead of using a navigation controller. How would I go about this? Is it possible to load a view controller inside of a UIScrollView or is there a different way? I doesn't need to have a UISCrollView I just want to be able to scroll between my View Controllers.

Upvotes: 1

Views: 823

Answers (3)

Edwin Iskandar
Edwin Iskandar

Reputation: 4119

If you're using storyboards and ios6+ you can place multiple "container views" within the scroll view. Then embed your individual view controllers to them. Clean and no code required for layout.

Upvotes: 2

Lithu T.V
Lithu T.V

Reputation: 20021

Nope scrollview cannot handle UIViewcontroller.Just get the view from your VCs and add as subview in scrollview

Upvotes: 1

Artem Shmatkov
Artem Shmatkov

Reputation: 1433

UIViewController is not a UIView descendant. You can add views of your viewControllers to UIScrollView.

Upvotes: 1

Related Questions