Can I use storyboards for all of my app, and then have one nib that it pushes to, or is the two being used at the same time not possible?
The storyboards and nibs can go together in one app, but if your deployment target is below iOS 5, then it won't work. The storyboards will only work on iOS 5.x.
And of course, you'd need to write code yourself to push a nib.
WWDC 2011 Videos
Session 309 - Introducing Interface Builder Storyboarding
36:00 API
41:00 Adoption (including incremental adoption)
And, as mentioned, it's iOS 5.x and higher only.
Related
My application supports both iOS 6 and 7, is there anyway load images automatically from xib files or code depending on images name, like to differentiate between iPhone and iPad I add ~ipad or ~iphone, and the corresponding file will automatically loaded.
and if there is no such a method like this, what is the easiest way to load different resources for each one.
Thanks
No, see Apple's provided iOS transition guide where they say you must manage it yourself and provide a snippet for determining the iOS version before loading assets. https://developer.apple.com/library/ios/documentation/userexperience/conceptual/TransitionGuide/SupportingEarlieriOS.html#//apple_ref/doc/uid/TP40013174-CH14-SW1
I just started using ios 6 autolayouts and I have to say I like them quite a bit. That said, I'm working on an app which needs to support both ios 5 and the iphone 5. Unfortunately, it seems that I can't use autolayout if I want to support ios 5. As such, I'm wondering what the best way is to support ios 5 while not having your layouts look bad on the iphone 5?
I can see a few possible solutions, but they all seem pretty awful.
I could do some kind of macro where I pass two nib files and it picks one depending on the operating system?
I could do multiple build targets with different nib files loaded in them depending on the operating system.
I could replace autolayout constraints with autoresizing masks all over the whole app.
Does anyone have any experience with this problem they could share?
First idea to load different nibs is better, if you want to leave your autolayouts. However, you should use not macro, but simple check in your code since macro check wouldn't work as it is performed only ONCE when you compile your project.
On the other side, it is recommended to use autoresizing masks if you are supporting old iOS versions
Well,I created a project with storyboard,but I realized storyboards were only compatible on iOS 5,its not support iOS4.3. Is there anyway I could get it working on iOS 4 by automatic or manual converting them to XIB's somehow?
So far I've only dealed with iPhone Apps and the time has come to make them universal. I was watching the lecture about universal Apps by Paul Hegarty on iTunesU and some questions poped into my head.
If I understood the concep allright the main difference between an iPad and an iPhone (when coding) is that the iPad allows the splitview controller and one should take advantadge of it, right?
What Mr. Hegarty did was to adapt the code on one App and add conditionals to differ when the App was running on an iPad or an iPhone.
My question is, is that the usual way it is done? I am a very organized guy and I like stuff to be as much structured as possible. So my first though was to create a complete set of view controllers to manage the iPad storyboard rather that have a single view controller filled with code for both devices.
is it possible to do so as well? what is considered to be a good practice?
Thanks in advance!
I think a good practice for a universal app would be reuse as much code as possible. Otherwise, why not create two different apps?
There are not that many differences between iphone and ipad controls except on iPad we can use popover and split view. So I would share the code in view controller as much as I can.
I just published a git for "converting" iPhone app into Universal app. Take a look - https://github.com/BTLibrary/BTSplitViewController
I love the idea of using storyboards, but unfortunately when I try to test this using IOS 4,
I change the deployment target to IOS 4 and I can't compile this anymore.
it said that Storyboards is not supported for IOS 4.3 or later.
So is it useful to use storyboards?
How can I write iPhone apps using storyboards so that they can be compatible with IOS 4?
I don't think that there's a reasonable way of doing it.
You could instantiate your Storyboards programatically (I think) but then you'd need something to fall back on on pre-iOS5 devices. And what would that be? Probably XIBs... which also continue to work on iOS5. You'd end up implementing everything twice. So, as I say, it may be possible but it's probably not practical.