Search code examples
iosobjective-cios6

How to check iOS Version is iOS 6?


Possible Duplicate:
Check iPhone iOS Version

I want to check iOS Version in iOS.

Because i have some of codes only for iOS 6.

So how can i?


Solution

  • Check this GitHub Gist https://gist.github.com/998472

    You can add the code or include it in your ...-Prefix.pch file so you can use it wherever you need it.


    EDIT

    I'm leaving an example of how you can use the code from Gist so people can check if it's useful for their case. This can also be found over the Gist.

    /*
     *  Usage
     */ 
    
    if (SYSTEM_VERSION_LESS_THAN(@"4.0")) {
        ...
    }
    
    if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"3.1.1")) {
        ...
    }