UISplitView equivalent on the iPhone. - ios

I have an iPad app which I am attempting to make universal and port over to my iPhone following this tutorial. http://www.appcoda.com/ios-univeral-app-tutorial/ (feel free to post a link if you believe it will help me).
So far, I have added a new storyboard file, named it Main_iPhone.storyboard and configured my target etc. However my iPad app is a UISplitView controller, with options on the side (in the master view) which control my detailview.
What I want to know is the iPhone equivalent of this object as i was made aware it cannot be used on the iPhone. Guidance needed on this one.
Thanks.

This is a very generalized answer since I have no idea what your app does.
The rootviewController of the app should be a navigation controller. The the root controller of the navigation controller should be the view controller that is on the left side of the split view controller. I'm going to assume that is a tableviewController.
When the user selects a row in the tableview controller, push the view controller that was on the right side of the split controller.
Now you have a master-child relationship.

Another thing to consider is that with the upcoming iOS 8 release, you'll be able to easily implement iPad like master-detail views on iPhone. (the concept is size constraint classes). As a developer, you can download the new xcode beta (and osx yosemite beta) to test this out.

Related

Why there are showing Two Storyboards in my every new xcode project?

Whenever I am trying to open a new project xcode always giving two story board and two View controller one DataViewController instead of showing one view controller and one story board .
I am using xcode 7.3.1
my versity hood was an old project of min which has only one view controller but
when i create new project everytime now i get two view controller like alamofire project. Point to be noted that it has started to happen after cocoapods installation and alamofire installation
please If any one knows how to fix it please help.
Are you talking about LaunchScreen.storyboard? If so, that is a special one (that can't be associated with code) that is used to draw something on the screen while your app is loading.
A common thing to do is to draw a version of your start screen with no controls (or all controls disabled) and no data yet (so it looks like it's loading).
Another common thing to do is some kind of splash screen.
You've chosen a wrong template. You need to choose Single View Application while creating your project. That gives you two storyboards and one view controller in Main.storyboard to start with. You have only 2 storyboards like normal. You just two ViewControllers and two ViewController classes. Nothing to worry. Just create a new project and select Single View Application in the beginning when it asks you to choose a template. It'll be fine.

App starting as Single view and proceed to tabbar application

I am about to create an xcode iphone app which will lauch initially as a single view ( something like login and settings screens ) and then proceed to a tabbed bar application with multiple tabs .
how to do this -
should i create two differnet projects one single view and one tabbed application ?
and is it possible to roll two projects into one single app ?
or is there just another easier way. I have xcode 4.3 and planning to use storyboard insteaod of XIBs
rgds,
sumit
Do not start with two projects, as you'll have an incredibly difficult time integrating them into one app. This is pretty simple, but you do need to learn the basics of view controllers.
Use Storyboards, and start with a single view app, maybe inside a navigation controller. Then do a transition to a tabbed view controller.
Upgrade to Xcode 4.6.3 or 5. Look at Apple's template apps for a tabbed application and a single view app to see how the storyboards look. Then copy the storyboards in one to the other, and link them up. This is definitely possible and straightforward, but you do need to understand how each view controller works with the others.
I also faced same situation once. I made a project as single view based app. without storyboard (since I was required to build compatible apps with iOS 4.3).
Made login screen as main view controller.
On login, I presented tab viewcontroller modally.
On sign out, I dismiss tab controller and return back to login screen.
If you have any queries, just ask it :)

UISplitViewController like mail app

I want to make my application similar to mail.app in vertical orientation. It should show a master view controller by button, but not in pop over and in horizontal orientation it should look like a simple UiSplitViewController.
Have you any ideas? Is there any usable open source projects which could be re-used?
Mail.app is using a standard UISplitViewController. The behaviour was changed in iOS 5 so that it no longer uses a popover, but instead slides in the master view controller from the left. Although technically I guess you can still call that a "popover".
This may be confusing because the documentation and delegate methods still refer to a popover controller, but if you create a blank split view project from Xcode and run it on an iOS 5 device or simulator, you will get the new behaviour.
Try MGSplitViewController - very useful alternative to the UISplitViewController, has some nice configuration options.

Why doesn’t iOS 5.0 like plain window applications? Why does it request that view controllers be used?

I have an iOS app that I created with Xcode 4.0’s “Window-based Application” template. It worked fine back then and it was using the iOS 4.3 SDK. This is an app that simply puts the buttons, labels, etc. directly onto a window. No view controllers—no nothing.
But now that I’ve upgraded to Xcode 4.2 (and its iOS 5.0 SDK), and I run the app, this message gets logged to the console when the app launches in the simulator:
“Applications are expected to have a root view controller at the end of application launch”
To be sure, the app continues to work, but this rather bothersome log gets printed out on every launch.
Why is this happening? Why does iOS 5.0 prefer/request view controllers?
I don't know specifically why the message is logged, but integration between UIWindow and UIViewController has been increasing over the last several iterations of iOS. iOS 4 added a rootViewController property to UIWindow. The two classes work together to manage view rotation. Given the new capabilities that iOS 5 introduced to UIViewController (specifically, the ability to create your own container view controllers), it's clear that the relationship between the two classes will continue to evolve. As you've said, your app continues to function in iOS 5, so having a root view controller isn't a hard and fast requirement yet. Perhaps there are features planned for future iOS versions that will depend on having a view controller available.
I don’t have anything against them, and I will use them if iOS wants
me to. I was just curious about the above behavior.
I'd interpret the logged message as a gentle but persistent nudge from Apple toward providing a root view controller. Most apps already use view controllers anyway, so this isn't a big change, but there are probably a number of apps out there that don't properly set the window's rootViewController property to their top-level view controller.
You have just Connected your "view" with "File Owner".....just remove that connection and run your app.click your view and see the connections inspector area and remove that connection which I told..I dont know exactly what reason..but i had this issue and i cleared.
May be you have used some tableview or some other views in it.So the app. needs a view controller to launch.If you remove that connection then it will run what you wrote in a code only...
Let me tell you the reason.
In former edition, Window-based Application is used to build multi-view applications.But in Xcode 4.2,the Window-based Application does not exist any more. Empty Application is designed to establish a multi-view program.
The difference between Window-based Application and Empty Application is that the former has a main window, the MainWindow.xib.
When the program starts, iPhone build the main window firstly. The content in the MainWindow will be loaded and built.But if you want more functions, e.g. multi-view, you still have to new a root view controller. Root view controller can help manage the views in your program. In the new edition,Xcode 4.2, a root view controller is expected.
In the new edition, there is not a MainWindow.xib in Empty Application.The AppDelegate create a window instead. And it wants a root view controller. So the best way is to create a UIViewController Subclass with XIB for interface for MainWindow. But in the old edition, XIB is not needed.
So get it? Without a root view controller, you are not going to receive an error, but you can hardly do any thing without one. That's why the warning always come out.

Multiple SplitViewControllers in iPad Application

We are creating an iPad application that uses multiple SplitViewController. From the Apple documentation I understand that the SplitViewController needs to be the rootViewController of the window.
Does anyone have any experience or suggestions on how to create a navigation scheme that switches between multiple SplitViewControllers?
Its seems that this is not a supported design. We have since decided to use one SplitViewController at the root, and swap out it's views when the screen changes. This seems to work pretty well.

Resources