• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to get iOS version at runtime?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to get iOS version at runtime?


  • Subject: Re: How to get iOS version at runtime?
  • From: Roland King <email@hidden>
  • Date: Fri, 18 Jul 2014 21:30:18 +0800

> On 18 Jul 2014, at 3:40 pm, Gerriet M. Denkmann <email@hidden> wrote:
>
> How to get iOS version at runtime?
>
> Like:
>
> BOOL isRunningOnDeviceOrSimulatorInVersion8 = ???
>
> I seem to have asked this question before (about OS X) and was told to use either NSAppKitVersionNumber or NSFoundationVersionNumber.
>
> iOS obviously has no NSAppKitVersionNumber, but I cannot find a UIKitVersionNumber.
>
> The stuff which behaves differently in 7.1.2 versus 8.0 is UIKeyboardWillChangeFrameNotification, which looks more like UIKit.
> Should I use NSFoundationVersionNumber anyway or what?
>
> And: does the Simulator return the NSFoundationVersionNumber of the simulated iOS (8.0) or the machine it is running on (10.9.4)?
>
> ProcessInfo has operatingSystemVersionString which is documented as "not appropriate for parsing".
>
> Gerriet.
>


The easy answer is you’re not supposed to do it because it’s fragile and guaranteed to break.

You’re also not supposed to have to do it.

I wish I could ever remember how compatibility is meant to work. If you build for minimum target 7 but run on 8, isn’t the API your code ‘sees’ supposed to be ‘compatible with 7’ or is it allowed to give you a UIKeyboardWillChangeFrameNotification which looks like iOS8? That could just be a bug.
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: How to get iOS version at runtime?
      • From: "Gerriet M. Denkmann" <email@hidden>
References: 
 >How to get iOS version at runtime? (From: "Gerriet M. Denkmann" <email@hidden>)

  • Prev by Date: RE: How to get iOS version at runtime?
  • Next by Date: Re: How do I temporary retain self, under ARC?
  • Previous by thread: Re: How to get iOS version at runtime?
  • Next by thread: Re: How to get iOS version at runtime?
  • Index(es):
    • Date
    • Thread