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

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.

Related

UISplitView equivalent on the iPhone.

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.

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 :)

On an iPad, how to create a left side menu to let the contents displayed at the centre according to the item tapped on the menu

I am very new to iOS development. Currently, I am trying to develop an iPad app, which is used for taking orders in a restaurant. When I am trying to create the UI on an iPad, I want to create a left side menu to let the contents displayed at the centre according to the item tapped on the menu. Which is similar to this: http://www.dhtmlx.com/blog/wp-content/uploads/2011/02/ipad_menu_final.jpg
As I am very new to the iOS development, can anybody tell me where I can learn iOS development step by step. And are they any samples of this kind of app that I can refer to?
Thanks very much!
there are many tutorials for creating split view application as links provided by #PratyushaTerli and otherwise you can use direect way as recommended by #antonio MG and there is another two good links for creating them which are : https://github.com/mikefrederick/MFSideMenu (good demos in it using story board or using xib's ) and you can look on project on github named - mmdrawercontroller.
annother good project is this
As Antonio MG said, the easiest way to do this is with Master/Detail project in Xcode. It uses the UISplitViewController logic of one 'Master' controller which controls the appearance of detail content in the 'Slave' or 'Detail' controller aside.
The sample Xcode project should be enough to make you understand how UISplitViewController and its UISplitViewControllerDelegate work together. Or also checkout this tutorial: http://www.raywenderlich.com/1040/ipad-for-iphone-developers-101-uisplitview-tutorial
Just create a Master/Detail project and you will have the basic structure of that kind of behaviour. The rest is just customising the table and the cells.

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.

Converting from a Window based application to a view based application in Ipad

I would like to know if it is possible for me to convert from a window based application to a view based appln... The reason is because I had already developed a part of my app but am getting some orientation issues which I was told would be solved only by using a view based application.
I was unable to find online any documentation regarding this..
It would be be great if anyone could help me out in this...
"Window based application" and "view based application" are just two of the templates you can use to start a project, anything you can actually do with one you can do with the other.
In the version of XCode I have handy here, the only difference between the two is that "view based" gives you an empty view controller and hooks it up to be displayed on app startup.
add a view controller subclass to your project, and then create an instance and add its view as the subview of your UIWindow in application:didFinishLaunchingWithOptions:, you've basically done it- anomie
it's the best and easiest thing you can do as of now

Resources