Ramotion / navigation-stack

:octocat: NavigationStack is a stack-modeled UI navigation controller. Swift UI library made by @Ramotion

Home Page:https://www.ramotion.com/agency/app-development/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Memory issues

Ahmedshubber opened this issue · comments

@einsteinx2 @durul @Juriv @hyb175 @yurypaleev Hi I'm using this project for my app and I'm using it for about 15 view controller so that when you swipe back you can go back and see the other view controllers with one swipe using your great project. But I was experiencing bad memory issues, I backtracked it and found out that your project was the reason. And I backtracked it to the exact line and saw that it was because of the snapshots you were taking of each view controller that was causing this issue. Could you resolve this problem with your project. Here is the log I have explaining the memory distribution as to why this is happening with your project. Theres an image below
screen shot 2017-06-03 at 10 20 04 pm

The screenshots are necessary for this to work at all. The first question is why is your app designed to go so many levels deep? That seems a bit questionable from a UX perspective.

However if you must do it, you can just resize the images to be smaller to use less memory, though the quality of the effect will not be as good. Or potentially you could modify it to save and load images from disk and load the oldest ones from disk during scrolling but they may not be smooth. Just some suggestions.

Since the project is open source, I'd suggest trying some things out and submitting a pull request if you resolve the issue in a reusable way. That's what I did (note I'm not a creator of this project, I just used it in my app and improved the display quality).