I am working on an app to try and learn a bit more about the cocoa touch framework and am starting to use the UISplitViewController
. From what I have learned so far, this has a property called viewControllers
that is an array containing the master and detail view controllers for the app.
What I am trying to set up is a folder navigation system in the masterVC
, then when a specific file is selected, it is opened in the detailVC
. I have got the folder navigation working and can pass the details of the files between the two view controllers.
My problem is that there are several types of files that require different views to display them correctly.
For example a jpeg image will have an image viewer, whereas an html document will have a web view and a txt document will require a text editor view.
What is the best way to change the view controller of the detail pane?
Am I better to have a single View controller and swap different views in and out depending on the file type? Or is there a way to completely remove the viewcontroller and add the appropriate one in its place?
Thanks