I'm creating a calendar app and i want to lay it out in a UIPageViewController kind of style. So where each page displays a day. Each page will be exactly the same (as in UI components) but just contains different data. I would like to use the same ViewController to do this as it would obviously be a lot neater. But i'm just wondering if this would possible? And if so how would i go about doing it? Thanks guys.
When you say "same ViewController", do you mean same class or same instance of that class? The former is trivial. The latter is problematic because as you swipe from one page to another, you're seeing the multiple instances at the same time, so you would have to keep track of a series of instances, knowing when one was no longer needed, etc. That would probably introduce a complexity that is likely not warranted. I'd suggest you just instantiate a new instance of your view controller for each page, and only resort to further optimization if there are performance issues.
The other pattern would be to not use page view controller, but rather use a collection view (where each entry is a different full page cell). Then you enjoy cell reuse patterns. It might also open up other options (where you have different collection view layouts for daily, weekly, and monthly views, for example).
But you might want to go ahead and start with a nice and simple UIPageViewController
and simply don't worry about separate instances of your single class of "day" view controller, because the overhead is negligible.