4

I surfed Internet for few hours, before posting this Question. Here I Go:

I am Working on an app. I used X-Code 5. set the deployment target iOS 7.

I have almost completed the UI for the app (for iOS 7). Yesterday, my Team Leader told, that Client wants the app backward Compatible, that is It should work on iOS 6.1 too.

SO I started surfing the Internet(as my Team Leader too don't know how exactly to accomplish it). I found some Links, but was confused what exactly to do. Yes, I read post on stackoverflow and google too.

How can I make my app iOS 6 compatible too? DO I need to take different XIB files? (It will be too much work).

One thing I did, I set the deployment Target iOS 6.1 or Later. The app ran on the Device. Interestingly the app ran on iOS 7 too. But on iOS 7, the view was Distorted a little.

And I heard If the Deployment is at 6.1 you cannot upload it to the App Store. Moreover I set The deployment at 7.0, but then I could not run it over iOS6 Device.

How should I develop the app, so that It works for iOS 6,7 and gets upload on AppStore too.

PLease help. I have been working on Developing Apps from last 4 months. I have been trying Mu best. I know, this question might seems stupid for some people.

And am not using Storyboards. Am using XIB's only

Jasmeet
  • 1,522
  • 2
  • 22
  • 41
  • 2
    **And I heard If the Deployment is at 6.1 you cannot upload it to the App Store** - No this is **not true**. Also have same XIB and learn to set delta to get it working in iOS6 and iOS7 both. – βhargavḯ Mar 13 '14 at 12:34
  • @βhargavḯ Yes I heard something Related to delta, before too. Do I have to make any change. Like in XIB in IB there are option LIKE "interface Builder Documment", Do i need to set it ios 6.1 or Later OR 7.0 – Jasmeet Mar 13 '14 at 12:43
  • 1
    @Jeev I have written the steps to set the delta, just follow them and let me know if something is not clear to you. – PunjabiCoder Mar 13 '14 at 12:49
  • @PunjabiCoder Thanks for reply. 1. am not using Story board. I followed point 3 and 4 from your answer. cannot see ios6 and ios7 side by side, Please GUIDE – Jasmeet Mar 13 '14 at 12:50
  • @Jeev do you use Xib? Or you make GUI programmatically? – Avt Mar 13 '14 at 14:51

2 Answers2

5

No need to create separate xib files for iOS6. You need to set the UI for iOS7 as well as iOS6.

  1. Just open your storyboard and then click on assistant editor.
  2. Now open storyboard preview in assistant editor.
  3. There is a button in assistant editor at right hand bottom corner which says iOS7 or later, click on it and select iOS6 or earlier.
  4. Now you can see the UI for both iOS7 and iOS6 side by side on the screen.
  5. Now select a particular view controller and then select size inspector.
  6. In size inspector you just need to set the iOS6/7 Deltas for iOS6 screens. That's it.

Main UI difference in iOS 6 and iOS 7 is that status bar is included inside the viewcontroller in iOS 7. it means your view controller is 20 px greater than iOS6. you have to adjust your items. Design your items according to iOS 7 and set Δy to -20

enter image description here

check this url too : https://developer.apple.com/library/IOs/documentation/UserExperience/Conceptual/TransitionGuide/SupportingEarlieriOS.html

If you have any problem then let me know.

PunjabiCoder
  • 525
  • 2
  • 8
  • Thanks for reply. 1. am not using Story board. I followed point 3 and 4 from your answer. cannot see ios6 and ios7 side by side, Please GUIDE – Jasmeet Mar 13 '14 at 12:49
  • 1
    The procedure is same for xib too. Just click on the xib. Open assistant editor. Now search for automatic at the top of assistant editor. Click on it and select preview in it. There you can see the option to select ios6 or later. – PunjabiCoder Mar 13 '14 at 12:54
  • OK, am looking into it. Will Connect you,Soon. AM having some problem. My app is crashing as, I have developed It actually in iphone 7. While running on iphone with ios6. It does show 1,2 views, but as soon it comes on som view(where I have used a table) It crashes. and says 'NSInvalidArgumentException', reason: '-[UITableView setSeparatorInset:]: unrecognized selector It simply means its having some problem with the table. How can I handle such problelm – Jasmeet Mar 13 '14 at 12:55
  • 1
    I have added an image in the answer. click on the button inside red circle, there you will see preview, click on it and select ios6 or later at the bottom right. – PunjabiCoder Mar 13 '14 at 12:58
  • Thanks Manpreet for the Image. Please have a look on my last commnet too. – Jasmeet Mar 13 '14 at 13:00
  • 1
    I can see the two views side by side. Bu the problem is My XIB is for iphone 4, and it shows the Preview Screen for iphone 5 – Jasmeet Mar 13 '14 at 13:04
1

So many questions...:

1.DO I need to take different XIB files?

No

2.One thing I did, I set the deployment Target iOS 6.1 or Later. The app ran on the Device. Interestingly the app ran on iOS 7 too.

It is as it should be

3.But on iOS 7, the view was Distorted a little.

It is because of transfluent status and navigation bars.

4.And I heard If the Deployment is at 6.1 you cannot upload it to the App Store.

You can. You have to support iOS 7. 6.1 - is a minimal required version. So everything is ok.

5.Moreover I set The deployment at 7.0, but then I could not run it over iOS6 Device.

If minimum is 7.0 you can not run it over 6.1. You are right :)

6.How should I develop the app, so that It works for iOS 6,7 and gets upload on AppStore too.

If compiler shows you some compatibility warnings you should fix them. Also when your application runs over 7.0 it should have iOS7.0 style. (no one cares how it will look on iOS 6.1 devices).

UPDATE:

How can I set Delta?

If you create your GUI programmatically define

//Screen height
#define SCREEN_HEIGHT ([[UIScreen mainScreen] bounds].size.height)
#define SCREEN_35 (SCREEN_HEIGHT == 480)
#define SCREEN_40 (SCREEN_HEIGHT == 568)

and then use it following way

UIView *newView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, SCREEN_40 ? 200 : 100)];

If you are using Xib or Storyboard

enter image description here

Avt
  • 16,927
  • 4
  • 52
  • 72