PDA

View Full Version : Multiple View/View Controllers




BRyken
Feb 27, 2012, 12:14 PM
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.



dejo
Feb 27, 2012, 01:30 PM
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?
I would try to tackle it from the one view per viewController approach.

Depending on that answer, where is a good resource to learn about managing different views/view controllers?

I'd say the View Controller Programming Guide for iOS (https://developer.apple.com/library/ios/#featuredarticles/ViewControllerPGforiPhoneOS/Introduction/Introduction.html) would be a pretty good resource.

BRyken
Feb 28, 2012, 06:12 AM
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?

robvas
Feb 28, 2012, 07:37 AM
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?

You could almost simulate a cube with CoreAnimation transitions.

PhoneyDeveloper
Feb 28, 2012, 06:22 PM
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.

xStep
Feb 29, 2012, 01:43 AM
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.