Search code examples
iosobjective-cuiviewmpmovieplayercontroller

Loading view from MPMoviePlayerController in a main view controller using storyboard


I'm fairly new to iOS programming, and I would like to consult with you about the best way to go about something.

I'm building an app that shows a movie in the background, while having a layer of buttons upon the movie, that goes away (the layer of buttons) and replaced by other layer.

The way I do it is by having a main view controller that loads views. The background movie is made using a class that I wrote that extends MPMoviePlayerController (there's some logic to which movie is played, etc..). So the main view controller loads the MPMoviePlayerController, asks for the view, and places the view as sub view of the main view controller. Then, it will load the controls view, and will place it as another sub view.

However, while all of this could work programtically, I would love to use the story board, to allow easy customisation to smaller screens (4S and below).

So I figured I should place a UIView on the main view controller that I would later define that view as the view of the MPMoviePlayerController, but I couldn't find a way to do it, which implied to me that maybe my plan is not that standard, and I wouldn't want that. So I thought I would ask for your advice.

So, in a nutshell, my question is how can I use MPMoviePlayerController (using a class that extends it) using a main view controller, and using the story board.

Thanks a bunch, Dan


Solution

  • It seems that UIViewControllers Containers is what I'm looking for, as depict in here: http://developer.apple.com/library/ios/#featuredarticles/ViewControllerPGforiPhoneOS/CreatingCustomContainerViewControllers/CreatingCustomContainerViewControllers.html