Multiple View/View Controllers

Discussion in 'iOS Programming' started by BRyken, Feb 27, 2012.

  1. BRyken macrumors 6502

    Jul 17, 2008
    Hi Guys,

    I have a degree in Computer Engineering and mostly familiar with C, Java, C# development and a decent understanding of Objective-C. As in, I've written basic iOS apps without anything to fancy. Just a background.

    My question is this. I'd like to create an interface design where the user can swipe up, down, left, right and the entire view would act as a cube. For instance if the user swiped up, the entire view would flip up, revealing the bottom portion of the cube and a different view.

    My question is, should each of the sides of the cube have its own UIViewController to handle it's views, OR should I have 6 different Views, all handled by 1 ViewController? What is the normal in this case?

    Depending on that answer, where is a good resource to learn about managing different views/view controllers? I'm trying to wrap my head around being able to create multiple views and switch between them at will. This idea is simply a test application to get me going on this aspect, so any help you guys can provide would be good, especially some example code somewhere.

    Thanks in advanced.
  2. dejo Moderator


    Staff Member

    Sep 2, 2004
    The Centennial State
    I would try to tackle it from the one view per viewController approach.

    I'd say the View Controller Programming Guide for iOS would be a pretty good resource.
  3. BRyken thread starter macrumors 6502

    Jul 17, 2008
    Thanks for the feedback.

    If using View Controllers, whats the best way to continue switching through them? You will obviously need a common/container that can respond to touch events, whether a button or swipe to remove the ViewController and add a new ViewController?
  4. robvas macrumors 68030

    Mar 29, 2009
    You could almost simulate a cube with CoreAnimation transitions.
  5. PhoneyDeveloper macrumors 68040


    Sep 2, 2008
    What you're describing is not a simple UI and a beginner will not get something like this right without a lot of effort. I recommend that you move on to other parts of the app. Build your individual view controllers and create some standard way of choosing them from the main screen of the app. Either build a tab bar app or a navbar app with buttons on a toolbar to choose or buttons in the screen to choose the view controller. Once you have all that working you can come back and implement this animated main screen.
  6. xStep macrumors 68000

    Jan 28, 2003
    Less lost in L.A.
    In WWDC 2011 video, Session 421, they show a fancy cube made by using CALayers. Maybe that will lead you somewhere. They discuss the 2.5D model which is what they used.

    Perhaps OpenGL is the way to go.

Share This Page