All,
I am running into some performance/memory issues when using several ChildViewControllers
in my ParentViewController
. Here is my situation: I have a ParentViewController
with a dynamic number of ChildViewControllers
- some times as many as 20. They are contained in a UIScrollView
, and are paged through. I'm running into problems when I have several on the page (I'm only loading the first two, then building the others as I swipe), however, having that many within the ParentViewController
is starting to cause some crashes due to memory.
The ChildViewController
has a lot going on in it, and I'm going through it to make sure it's as efficient as possible, however, I have concerns about this approach working on older devices (as is, I'm getting crashes on the 5S).
It seems that it would help to change the view controllers to just be views, but it'd be a pretty large endeavor as the VC is complex. One suggestion I had was to create a view from the existing view controller's view, and set several delegate methods on the view and interact with the views from the ParentViewController
that way. Does any one have any thoughts on the efficiency of that method as a opposed to the current method of using ChildViewControllers
?
Another thought I had was to build a custom ContainerViewController
and have all the children in there to swipe through, but I wasn't sure if that would give me an advantage over using the children in a UIScrollView
.
Any thoughts?