I'm developing a iOS app for iOS 7, the UI reflects this iOS version. But, I want to publish to others iOS's, like 6 or 5 too.
So, I'll change my UI and the target iOS version. I have to save other project, with this modifications? How I'll publish the same app for differents iOS versions? Thanks and sorry for the stupid question, I didn't find anything about it.
You should do this within a single app and it will run on whichever versions you've allowed. Start by setting your deployment target to the oldest version you want to support.
By using constraints or basing UI dimensions on known constants, you can accomplish most tasks that are OS version dependent.
A big issue to handle is the differences in how the status bar and transparent bars in iOS 7 are displayed. If you're using Interface Builder, you can use the View inspector on the right-side bar in XCode to set iOS6/7 Deltas that are applied depending on the version being run. You can also preview the differences in IB by selecting the root view of your xib and opening Identity inspector. Under Interface Builder Document, change "View as" to the OS version you want to see.
If all else fails, you can test for the OS version in code to write custom code for a version.
For example:
if (floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_6_1) {
//ios 6 code
} else {
//ios 7 code
}
In your app set the Deployment Target to iOS 5.
When it comes to UI have a read of this Apple Doc on iOS 7 transition guide.
Ones you have read that and understand it then you can move onto actually creating your UI.
When I have created my UI's based on iOS version I have a prepocessor macro set
#define IOS_VERSION() [[UIDevice currentDevice] systemVersion];
This is set in my ***-Prefix.pxh file so I can access it throughout my app.
Then I can check this with a simple if statement like so
if(IOS_VERSION => 7.0) {
// Do our iOS 7 stuff here
} else {
// Do everything else, you could add else if to check 6.0, 5.0 even 4.0
}
remember to wrapper some method calls in if statements as well. Like:
if([object respondsToSelector:#selector(setTitle:forState)]) {
// object being whatever object you are wanting to work on UIButton, UILabel, UIView.
// The reason for this is some methods will be in iOS 7 or even 6 but not in iOS 5
// so if you called them methods you will received unrecognised selector excpetion.
}
You can also do somethings using interface build see the link I have provided for how to on interface builder.
Your design will differ based on iOS version. If you run on iOS 7 it will have the new flat UI look whilst if you build on other iOS it will have the old look. When moving over to the new look there wasn't many differences that we had to fix in our apps but we did have to fix some things. I would recommend building for either iOS 5 and 6 first and then 7 or the other way get it right in one before moving on.
You should have only one app supporting all of these.
In your XCode Project setting there will be a setting called deployment traget. which should be the Min OS version that your app supports. In your case it will be 5.0.
Coming to UI and other feature changes. You should be doing these at run time based the current OS version. Make use of [[UIDevice currentDevice] systemVersion] You can load respective based on this version.
Related
Hi In past I had developed one application which supports IOS6.Now the time came to support the same app for IOS7 also. For supporting the app for IOS6 & IOS7 I increased the Y value of each and every component by 20 pixels.
Here I am getting the OS version by using[[[UIDevice CurrentDevice]SystemVersion] floatvalue]; method.Based on that OS version I am changing the rect values for each and every component.
For handling the StatusbarStyle I am using the following methods in IOS7
1. [self setNeedsStatusBarAppearanceUpdate];
2.-(UIStatusBarStyle)preferredStatusBarStyle;
These methods are working fine in IOS7, But if I install the app in IOS6 the app is crashing due to the above two methods.
So now my requirement is I have to hide or not execute IOS7 related methods or changes in IOS6 Device.With the help of this Implementation I hope I can resolve the issue.
Even I used few methods to resolve this crash issue.The methods which I used are
1. #if __IPHONE_OS_VERSION_MAX_ALLOWED== 70000
2.#if __IPHONE_OS_VERSION_MIN_REQUIRED==70000
Here while creating the ipa file deployment Target Which I had set is 6.0. Because I have to support IOS6 & IOS7.
So please help me to resolve this issue. Thanks in Advance.
use NSFoundationVersionNumber condition for doing this Supporting iOS 6
If you need to load different resources for different app versions—and you currently identify a storyboard or XIB file in your Info.plist file—
you can use the version of the Foundation framework to determine the current system version and load the appropriate resource in application:didFinishLaunchingWithOptions:. The code below shows how to check the Foundation framework version:
if (floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_6_1) {
// Load resources for iOS 6.1 or earlier
} else {
// Load resources for iOS 7 or later
}
Take a look the best answer of the same thing that you want
iOS 7 status bar back to iOS 6 default style in iPhone app?
Try checking for this condition :
if ([self respondsToSelector:#selector(setNeedsStatusBarAppearanceUpdate)]) {
// iOS 7
} else {
// iOS 6
}
I'm a bit confused by how the UI compatibility model is setup in iOS.
It seems you can force iOS6 look & feel while running the app in iOS7 by changing the storyboard/interface builder settings. But when you set it for iOS7 UI, iOS6 devices are unable to install the app.
Is it possible for the app to be rendered with the new flat look in iOS7 and still maintain compatible w/ iOS6 devices rendering the old glossy UI ?
have you tried one of the following?
setting the min version of iOS that will run your app
changing the build for tab under the IB section
For the first one, just go to your project settings, and find
then you can just change the 7.0 to whatever version you're running..
For the second one, just open the right panel in IB, and do
and see if that helps you any.
Hope this helps!
Hi In past I had developed one application which supports IOS6.Now the time came to support the same app for IOS7 also. For supporting the app for IOS6 & IOS7 I increased the Y value of each and every component by 20 pixels.
Here I am getting the OS version by using[[[UIDevice CurrentDevice]SystemVersion] floatvalue]; method.Based on that OS version I am changing the rect values for each and every component.
For handling the StatusbarStyle I am using the following methods in IOS7
1. [self setNeedsStatusBarAppearanceUpdate];
2.-(UIStatusBarStyle)preferredStatusBarStyle;
These methods are working fine in IOS7, But if I install the app in IOS6 the app is crashing due to the above two methods.
So now my requirement is I have to hide or not execute IOS7 related methods or changes in IOS6 Device.With the help of this Implementation I hope I can resolve the issue.
Even I used few methods to resolve this crash issue.The methods which I used are
1. #if __IPHONE_OS_VERSION_MAX_ALLOWED== 70000
2.#if __IPHONE_OS_VERSION_MIN_REQUIRED==70000
Here while creating the ipa file deployment Target Which I had set is 6.0. Because I have to support IOS6 & IOS7.
So please help me to resolve this issue. Thanks in Advance.
use NSFoundationVersionNumber condition for doing this Supporting iOS 6
If you need to load different resources for different app versions—and you currently identify a storyboard or XIB file in your Info.plist file—
you can use the version of the Foundation framework to determine the current system version and load the appropriate resource in application:didFinishLaunchingWithOptions:. The code below shows how to check the Foundation framework version:
if (floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_6_1) {
// Load resources for iOS 6.1 or earlier
} else {
// Load resources for iOS 7 or later
}
Take a look the best answer of the same thing that you want
iOS 7 status bar back to iOS 6 default style in iPhone app?
Try checking for this condition :
if ([self respondsToSelector:#selector(setNeedsStatusBarAppearanceUpdate)]) {
// iOS 7
} else {
// iOS 6
}
I am starting to work on iPad application which was created in 2011 for iOS 3.2. Now I would like to upgrade the application to be able to work properly on iOS 6.1 and also add some new features. What are your advices to do these tasks? Main points that I capture so far as:
Add storyboard
Remove xibs
Fix .m/.h missing file errors
Do you know when I add the storyboard if it is going to be updated with my app screens automatically? Or do I have to introduce the screen all the properties one by one?
You'd have to add your screens into the storyboard one-by-one yourself. But you can carry on using XIBs just fine - there's absolutely no reason you have to have a Storyboard, unless there's some specific reason you need it. I generally don't use them very much, even in iOS 7-only apps.
I placed 3 buttons into my view, set up background image and sometimes I need to disable one of them. I find out that they appear different in iOS 5.1 and 6.1. I like the 6.1 version. What should I do to make the design in 5.1 will be the same as in 6.1?
1) look at the white strip at the bottom of picture
2) third button is disabled and is quite lighter than in 6.1
<-- iOS5.1
<-- iOS6.1
PS: thank you for reputation points :)
The white artifact seems to be a default white rounded rect frame. Did you set button type to UIButtonTypeCustom?
Usually when there's a UI difference between two major versions of an OS, the right thing to do is to go with the flow and use the appearance that comes with each version. Having newer UI elements show up in an older version of the OS looks odd -- like your app doesn't quite fit in. Also, it's a lot of work to try to mimic the new look in the old OS.
Try to design your app so that it looks great with either variety of button, and your app will fit right in with the other apps on the user's device no matter what version they're using.