Load only View you are scrolled to on BBwalkthrough purge the rest.
New here? Learn about Bountify and follow @bountify to get notified of new bounties! x

The UIPageViewController repo https://github.com/ariok/BWWalkthrough instanciates all your views on load. I need it so it loads the view it is scrolling to and removes the others. This is to save memory for the alphabet app I am making. Presently it bloats the memory to 300+mb due to the views all being in memory.

Thing is, depending on how you're working with this, you could de-instantiate all the views once you're done with the entire walkthrough. The main problem with loading up the view each time is that you're going to kill battery life. On top of that, just keep in mind that you're only going to be able to unload the pages 2 ahead and 2 behind. Any chance you could provide a bit more information on how you're implementing this?
SkeletonSlayerz over 5 years ago
After doing a quick test with the example provided by ariok ( BWWalkthrough Dev ), I found that 1 Page in the Walkthrough took up only .3mb. So I'm guessing you have a lot on each view then ? Or you have a memory leak somewhere.
SkeletonSlayerz over 5 years ago
Hi SkeletonSlayerz, thanks for the interest. I am doing it like the example app in the project. I have 27 views that are instantiated. The WalkthroughPageViewController has all the labels and sounds that are common to all screens. Then each view has an animal image. The images are loaded via the assets library (with images at @2 and @3 res from sketch). If you add some images to your project then the size of the memory goes up. Without images its all very small. I also have sounds but it doesn't make any difference to the size if I remove the sound or the @3 size images from the assets. I don't think there is a memory leak as the memory is steady and doesn't rise as after loading all the pages. Thanks for the help as I am stuck!!
sashalondon over 5 years ago
awarded to Be The Match

Crowdsource coding tasks.

0 Solutions