3

Is there a way to achieve the iTunes style modal view controller chain (see screenshot)? I've looked around quite a bit but couldn't find any real questions about this. I'm not looking for a replacement or workaround, just want to know if it is possible to do with the current SDK (or iOS 5.0, although we are not supposed to talk about it a simple Yes/No would suffice).

For those who can not make it out from the image; iTunes on the iPad has this great feature where you can view a movie in a formsheet style modalviewcontroller, and if you click on another movie in that same modalviewcontroller it will create a new modalviewcontroller with the movie info you clicked on and will slide the 'old' one out (to the left). It will slide back in when the center modalviewcontroller is dismissed.

enter image description here

UPDATE: I'm sure it has been done before, but I wrote my own implementation. It turned out not to be very difficult, although it misses some context-animations (like the flip from position), it is pretty usable. Since I wrote it for iOS 5, I will make the code public this fall when the NDA is lifted.

Jake
  • 3,973
  • 24
  • 36

1 Answers1

0

I suspect that it's a single modal view controller with a scrollview. The scroll view has a semitransparent background and displays several "pages". If you take that approach, I can't imagine it being too difficult to implement.

Moshe
  • 57,511
  • 78
  • 272
  • 425
  • I actually do see the difficulty in that approach. Although you are probably right (good chance Apple never made this public), doing it right might require quite some clever coding. The views even release/reload when you run out of memory.. Someone spend a few hours coding that ;-) – Jake Jun 14 '11 at 15:38
  • The memory management part isn't the complicated bit. Programming scroll views in general requires that you manage that memory carefully. See my answer [here](http://stackoverflow.com/questions/4550524/how-to-create-ipad-document-preview-interface-like-those-found-in-iworks-for-ipad/4581422#4581422). I'll also add that you actually can't present this view controller modally, because a full screen modal view will remove the background view from the view. – Moshe Jun 14 '11 at 15:49
  • I understand the complications. Did bring me to a pretty good idea of writing such component myself and publishing it. – Jake Jun 14 '11 at 17:55
  • I ended up doing it myself, updated my previous post. Turned out it was pretty much as easy as you said. Didn't write any code to handle memory warnings or whatever; the UIViewControllers will have to implement that themselves.. – Jake Jun 15 '11 at 15:20