0

The app I developed (with Swift 3 and xcode 8) is ready for iOS 10, but my boss wants it to work with iOS 8 because he has an iPhone with 8.2: when I plugged his iPhone to my Mac and started to build the project, it failed because some features are available only on iOS 9.0 or higher.

I did some research and came across some options, but since I'm a beginner I don't know what would be better. Let me share them with you:

  1. rewrite the whole app with Objective-C: I think the less convenient, since I never studied this language and my boss wants the app to be uploaded to the store as soon as possible;
  2. call Obj-C code from Swift for iOS 8 needs;
  3. upload the app anyway: I managed to modify the app and make it compatible with iOS 9, do you know any recommendation or proposal from Apple to not develop app for too much old iOS versions so that I can convince my boss to not obsess over this matter? 87% of devices are using iOS 10 so we would not cut off too many people;
  4. upload the app AND add iOS 8.0 compatibility in a future update: can I change iOS target in next updates?
  5. use Appcelerator or React Native.
jscs
  • 63,694
  • 13
  • 151
  • 195
elmazzun
  • 1,066
  • 2
  • 18
  • 44
  • there are some changes from iOS 8 to iOS 10 like APNS. You have to check where are you facing the problem. Just check API compatibility. It will be easy for you.Look at this link's answers https://stackoverflow.com/questions/32730271/how-to-support-ios-9-features-while-keeping-ios-8-support – Gagan_iOS Aug 23 '17 at 12:37
  • 6
    Your boss is making a business decision to support an EOL OS version because of his personal device?? Now that's leadership. – jscs Aug 23 '17 at 12:38
  • 2
    See https://stackoverflow.com/a/32841791/1187415 for how to check availability at runtime. – Martin R Aug 23 '17 at 12:39

3 Answers3

1

The best solution would be to check the iOS version programatically and only call the problematic methods if the user's phone actually supports them. Otherwise keep that functionality hidden from the user.

This is how you can check iOS version from code:

if #available(iOS 9, *) {
    // iOS 9 Swift code
} else {
   //Hide the methods from the users on older OS versions
}
  1. That wouldn't work, since most system APIs are not language dependent. If a certain API/feature was only added in a certain iOS version, that requirement stays the same regardless of whether you use Objective-C or Swift.

  2. Same as 1.

  3. This is a feasible option of course.

  4. AFAIK, you can change the target iOS version in a later update.

  5. If you want to achieve a functionality that uses an API which was only introduced in iOS9, even hybrid frameworks need that iOS version if they use built-in iOS APIs.

Dávid Pásztor
  • 51,403
  • 9
  • 85
  • 116
0

To add iOS 8 compatibility you must change the deployment target version to 8.0 and resolve every warning/issue that Xcode give you when you try to build/run.

You will need to use if #available(iOS 9, *) {} code if you use APIs that changed between the versions 8 and 10.

Damien
  • 3,322
  • 3
  • 19
  • 29
0

You don’t need to rewrite anything in objective c. For the features that are getting called out, research the iOS 8 compatible way to implement them (if even possible) and add checks in your code for iOS version so that certain blocks only execute for certain os’s. (See technical answers already provided)

But, first show your boss how to update his phone.

Then show your boss that 97% of users are using 9 or 10. https://developer.apple.com/support/app-store/

Next remind him that the 3% of out of date users are also the 3% least likely to be downloading apps and only part of that 3% are on iOS 8. Many are even more out of date.

Then calculate the number of hours required to support iOS 8. Multiply that by your hourly rate. Then ask your boss if it’s worth $X to expand your app’s user base by, at best,1%.

If he says yes, then go for it.

Dancreek
  • 9,524
  • 1
  • 31
  • 34