Pj Vea
Pj Vea

Reputation: 15

Multiple UIViewControllers in one storyboard

I am working on an app that deals with a book. The app uses tables views as the navigation. There is easily over 500 chapters all together. I was going to make a single UIViewController for each chapter. As you can guess that is causing my computer to run out of memory(I have 8GBs). Is there a way to iterate this process? Each UIViewController has the exact same layout.

Thank you for your time,

PJ.

Upvotes: 1

Views: 139

Answers (1)

RollRoll
RollRoll

Reputation: 8472

one UIViewController for each chapter is crazy

Use UIScrollview with NSMMUtable array with UIView inside of it with your content

Something like that:

Storyboard: UIViewcontroller contains UIScrollView;

Code: Bind NSMutableArray with your content (custom objects or text depending of the requirement); Display the content for each element in a UIView; Add UIView to the UIScrollView;

Upvotes: 0

Related Questions