I'm trying to figure out the best way to approach writing a universal app. I'm not sure how to add some new files (for a new view), and how to add both iPhone and iPad view controllers. I'm using Xcode 4.2.
Your question is pretty vague (and general), but does this tutorial give you the information you need? http://blog.corywiles.com/creating-a-universal-ios-app-tutorial
Related
I have a question about universal app. My app will not have storyboards or xib file. There is possibility to write universal iPhone/iPad application without it? I found some tutorial how to create universal app with storyboard, but i don't want (i can't) use this feature in my project.
If it is possible What should i do? If i have to made changes only in ViewControllers? I'm start to do this, i'm not changing old project so i can do anythng - what should i learn/what should i remember?
I'm targeting to iOS 5.
EDIT:
I have a screen information in resource file and my rootViewController or any other ViewController will be created in compile time, so i can't have xib file for that, i can't put button on xib with Interface Builder becouse i don't even know how many buttons i will have there. I don't know how many screens i've got till i hit run in my project.
Not only can you write any type of iOS app without Interface Builder, it is actually much more testable and pliable. Some auto layout tricks are difficult (not possible?) in IB style projects, as well.
There is an incredibly impressive library called Masonry that wraps the NSLayoutContraint syntax. This makes it quite pleasurable to subclass views while not having to use ugly VFL or incredibly verbose NSLayoutContraint syntax (not even going to address frame setting...blech!). IB style apps also promote bad software development practices and anti-patterns (just dumping everything in a view controller presentation-wise. No Separation of Concerns!). Also, it is more difficult to work on larger teams (IMHO even small teams) while utilizing Nibs, Xibs, and Storyboards due to merge issues.
On top of all of that, you gain a much deeper understanding of the classes you are working with (UIView, UIResponder, etc.) when writing code in this manner (once again IMHO). There is an interesting article outlining some of these issues in more detail: http://doing-it-wrong.mikeweller.com/2013/06/ios-app-architecture-and-tdd-1.html This is by no means the only article that discusses this problem. Also, this will help for your app delegate: creating a universal window-based iphone app without generated xib file
This is certainly possible, I have only used storyborads once in the many apps I have published. As for not using XIBs, I am not sure why you would want to do that. You can lay out your views at runtime in the init method, but I feel like that is just making things unduly hard on yourself. You can set a XIB up for the iPad and one for the iPhone so you can tailor the UI specifically to each device.
Perhaps if you go into a bit more detail about why you are imposing this requirement on yourself we can discuss if it si worth the effort to go down that road.
Good Luck.
I am relatively new to Objective-C / iPhone programming, and have only created single view applications thusfar. I am interested in creating an app soon than will have a "wireframe" in a sense that allows me navigate the various views of my app using buttons. So I guess my questions are:
What do I need to do to make an app that has more than one view
How to I link them with UIActions in buttons to navigate the various screens (ex a back button to go to a previous screen)
and I may have more as I go, but this is a start.
Thanks!
Since no one really had a clear helpful answer, I will share my own conclusion. Xcode 4 offers a very intuitive and interactive way to create multiple MVCs and segue between them even providing the interface to travel between views. I found out how to use this feature from Paul Haggarty's iOS course on iTunes U. I highly recommend it.
Joey
You'd can use a combination of, multiple UIViewController and or UINavigationController's. Utilizing methods such as presentModalViewController:animated: and pushViewController:.
is it possible please to build small application with interface builder without coding, just to make sure that my interfaces are well organised ?
For the navigation interface, no. You need to programmatically push views into the navigation stack.
Interface Builder is a layout tool for individual screens. Connecting them in a navigation flow happens in code.
I second #fluchtpunkt's comment that you might want to look at publishing your content as an iBook rather than a native app. Or you could look at one of the html-to-native-app solutions like PhoneGap or Appcellerator. I've never worked with either of them, but theoretically if you have any HTML ability at all, they flatten out the learning curve of simple app building very significantly.
If you just want to test your interface you should probably use a mockup tool. I have good experience with blueprint. Or try something like interface (http://www.lesscode.co.nz/interface). Here you can create a GUI prototype and export it to XCode (maybe you can run the app at the simulator with navigation after this operation…) but i don’t know because i haven’t any experience this tool!
i have iphone project based on tabbar template . want to convert it to ipad,
final output i want is to move tabbar inside a splitviewcontroller .
How to go about?
You have to rewrite it to be in correspondence with the change in templates... There is no other way sorry to be the bearer of bad news. But, you can still potentially re-use a lot of the variables and IBOutlets and IBActions that you had from the previous project. You just have to take that code and fix it so it works with the new template.
I recently found this blog post on the topic. You might find it helpful:
http://www.raywenderlich.com/1111/how-to-port-an-iphone-application-to-the-ipad
Plus there's some discussion of creating a universal app here:
iPhone & iPad versions of same app?
I'm new to xcode and the iphone sdk. I've been working with the view-based application for quite a while, and I was wondering if a utility application and a view based application involved the same type of coding. Can someone point out the difference for me?
Thanks
The both use the same frameworks, the only difference is how they are set up by default. The unity template provides a two view application (by default) and the view based only one.
It seems that Utility application in Cocoa-Touch is just a simple application template for application with 2 views.
This is apparently good for simple apps which have primary screen and configuration screen.
Have a look at Understanding view controllers in Cocoa Touch which has some explanation.
It depends from what point you looking at differences. You still use cocoa-touch for your application. The difference is that simple view based application is a simple template for one screen application, you can extend it as you like. Utility application is simple template for an application with 2 views but you can extend it as you like.