Search code examples
ios6social-framework

Detect iOS version in runtime


I'm currently writing an app that uses Facebook integration built into iOS 6. Now in order to do that, I need to

#import <Social/Social.h>

How do I ensure that the device can actually run the code and won't crash (check if it's iOS 6 or iOS 5.1 and then performing the right code, because I support iOS 5.1<= )?


Solution

  • You could use:

    [[UIDevice currentDevice] systemVersion]