Check iOS version at runtime?

前端 未结 11 1221
-上瘾入骨i
-上瘾入骨i 2020-12-01 03:03

This is sort of a follow on from my last question. I am using beginAnimations:context: to setup an animation block to animate some UITextLabels. However I notic

11条回答
  •  自闭症患者
    2020-12-01 03:27

    Simpler solution for anyone who'll need help in the future:

    NSArray *versionCompatibility = [[UIDevice currentDevice].systemVersion componentsSeparatedByString:@"."];
    
    if ( 5 == [[versionCompatibility objectAtIndex:0] intValue] ) { /// iOS5 is installed
    
        // Put iOS-5 code here
    
    } else { /// iOS4 is installed
    
        // Put iOS-4 code here         
    
    }
    

提交回复
热议问题