Using UIImageViews for "pages" in an iPhone / iPad app?

I'm new to iPhone programming, and well, what seems obvious to me may seem silly to an experienced coder. I've done a few "view switches" on Youtube, and basically they seem to work fine for adding pages to a storybook app. You add a UIViewController and its associated view for each page.

My question is, will it be insanely slow or a memory spike if I continue with this method, say .... 35+ pages? Each page will also have a sound file associated with it, which will play the narration when the page loads and pause when we leave. Basically, think of an app like a powerpoint, with sound, possibly animated picture elements, Next and Back buttons.

I'm probably thinking about this in a very simplistic way, but where is my experience at the moment. Any insight or advice on improving and / or using the methods effectively would be greatly appreciated.

+2


a source to share


2 answers


What you can do is unload the pages you are not using, so you don’t have to worry about any number of pages. Perhaps you can also save the pages that come next and the one that comes earlier, so there won't be any lag between clicking the next and the previous one and viewing the new page.



+1


a source


In addition to Daniel's suggestion, which should happen automatically since pages UIViewController

rendering pages are no longer rendered, you should subclass UIViewController

all common behavior (next / back, play sounds) and make your pages either subclass or instances of that class with the desired values ​​in it.



For PowerPoint animation (more precisely Keynote), take a look at Core Animation.

+1


a source







All Articles