iphone 5 NIBs using ios 5 - iphone

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

Related

Only show UI image on iphone 11 hide it on other iphone versions

Using Storyboards how can I show an UI image only on a specific iphone version and hide it on other iphone versions like iphone 8 for example?
Is this possible in swift?
Using Storyboard you could show/hide the image based on size classes, here's the Apple Documentation for it. The caveat with this approach is that multiple devices are part of the same size class. To see which devices belong to what size classes check this link, and scroll down to the Size Classes section.
If you want to be device specific, you'll need to write it in code. It's a bit more complex to do it, but there's a really good library for it. It's a one file implementation, so if you don't care for Pods or similar tools, you can just copy the file in your project, or maybe even decipher it and come up with your custom implementation.

Making my iPhone 5 app compatible with iPhone 4, iPod Touch, legacy iPhone?

I am new to xcode and mobile app design in general, but was able to pull together some resources and make a nice looking app optimizing for iPhone 5. However, I noticed a few problems with compatibility and am hoping someone can suggest to me a quick fix.
First, I take advantage of the entire iPhone 5 screen size, and when loaded on iPhone 4 or earlier the placement of icons is all awry. Would this be fixed by just making the entire view scrollable somehow? And if so, can someone point me in the right direction to accomplish this?
Second, I've noticed that if I am using my app while in a call (and therefore have the green notification bar at the top) it also causes misalignments for my objects. Is there a way to prevent this?
Thanks for the advice.
If you are targeting iOS 6 you should take advantage of Auto Layout. Here is a good tutorial to get started http://www.raywenderlich.com/20881/beginning-auto-layout-part-1-of-2
Add a Default-568h#2x.png launch image.
and check the all screen.

Convert ios4 app into ios5

I have already created an app compatible with ios<5. Which already exists at Workout DJ FREE for Spotify
Now in next version I want this app compatible with ios5 too. For that what do I need to do?
I have planned to go with either of these two options
Make separate xib for each screen
Create all images with more retina display & name it with #(some)X. Like we do #2x for retina display.
I don't think the 2nd option will work at all, will it?
I'm seeking guidance from the ios5 experts.What should I do? Should I go with either of above two options or there is some other alternative that is standard & best.
You shouldn't need separate views for the iPhone 5 and <= iPhone 4.
Just add a new Default screen for the iPhone 5 to trigger automatic view sizing to work on the iPhone 5 and make sure all of your Autolayout or resizing masks are correct.
Yes, you'll want to make sure you supply retina graphics so everything looks good on the retina displays in the iPhone 4 and iPhone 5.
Just follow the below tutorial. You will have idea of how to set design for iPhone 4 & 5 compatible.
http://mobile.tutsplus.com/tutorials/iphone/working-with-the-iphone-5-display/
Cheers.
There are multiple ways of doing this, try googling it. Maybe try checking out this forum article here: http://forums.macrumors.com/showthread.php?t=1356952

How can I convert an iPhone application to universal application in a easy way?

I have an iPhone application developed with iOS and I need to convert the application to universal so the app can appear in the iPad apps section of AppStore.
It just so simple as changing the Device section in my project to universal or I have to re develop the app, create new views, etc?
It depends strictly on your app, but generally speaking, yes, you will need to create new views.
I mean, even if you want to keep exactly the same UI, chances are that it will be more convenient to provide iPad specific versions of your xib files, or adapt the views you created programmatically. This is due to the fact that the iPad is not simply larger: it has got different ratio (3:4 vs. 2:3) and this changes things completely. You might try to play with autoresizing settings for your views and grouping views to make the same xib work as desired on both screens, but I suspect that this is not so easy except for very simple interfaces.
In any case, this is not the end of the story.
Actually, you will not want a "good" app for iPad to have the same UI as the iPhone version, since the larger screen space really screams for using different layout and organization of the information and controls.
As I said, it depends strongly on your app (with games being the strongest exception to the above rule), but in most cases, your app will greatly improve if you redesign it specifically for the iPad, rather than simply adapting it (so that it is not shown in the 1x/2x mode).
The simple answer is yes, just change the device family to Universal and you are done. But this would be pointless and you might even get rejected by Apple.
Take the time to actually create an app that takes advantage of the bigger screen. Use a split view controller and popovers or whatever is appropriate to your app.
Just making your main view bigger is a bad experience for your users.

Why creating an IOS application using window base template created two device application folder?

I am new in iphone application and wanted to see why there are two separate environment when creating an application. When I selecting the template to build my application there are two devices to choose from. Some templates has iphone, or ipad only and one for universal. Since my project wants to work on both iphone and ipad, I choose the template with universal option. It creates two subcategories: iphone and ipad. Does that mean I have to implement both of them ? What are the differences between them?
Yes, the screen sizes of the two devices are different. So they both have different sized XIB files. You can use the same code for both iPhone and iPad, but generally, since the iPad has a bigger screen, it is designed differently than the iPhone version and has more code to it.
Yes, like Jack said, the main difference is the screen size. Hence, the two nib files. The iPad has a lot more real state (i.e. space) because the screen is significantly bigger. Thus, you need to design your UI specifically for that screen size.
Additionally, you are going to want to use that extra space to make a richer UI and consequently a better UX. For example, lots of iPad apps use a UISplitViewControllers to exploit that extra space.
For the rest of your logic and algorithms, you can use the same code because both devices are running iOS.
I haven't checked it out but I know the topic about creating universal apps is covered in section 7 of the Stanford course Developing Apps for iOS