I have a UIPageViewController with a possibly infinite number of controllers in it for looking at images in a gallery type fashion. Disposing of these images is of course very important to avoid infinite memory growth.
Upon testing it looks like my custom view controllers that are used in my UIPageViewControllerDataSource are never getting their dispose method called, only ViewDidDisappear.
What is the proper way to dispose/cleanup memory in this case?
So far my options seem to be:
Use the GetPreviousViewController/GetNextViewController methods to dispose of the reference view controller.
Call Dispose in ViewDidDisappear for my view controllers.
Interact with ViewControllers or ChildViewControllers and dispose of some in FinishedAnimating
None of these seem exactly perfect. Am I missing something?