tableta samsung resolucion que pro mini mejor cual comprar caracteristicas ios ios6 ios7

ios - resolucion - que tableta es mejor ipad o samsung



¿La mejor manera de verificar iOS 7 o versiones anteriores? (2)

Esta pregunta ya tiene una respuesta aquí:

Necesito reconfigurar alguna UI basada en la versión de iOS contra la que me estoy ejecutando, así que necesito una buena forma de verificar la versión de iOS. Por el momento, estoy haciendo esto:

if ([[[UIDevice currentDevice] systemVersion] isEqualToString: @"7.0"]) { //do stuff }

Preferiría no codificar estas comparaciones de cadenas y tomar decisiones basadas en eso. ¿Hay alguna forma mejor de hacer esto?


Siempre los guardo en mi archivo Constants.h:

#define IS_IPHONE5 (([[UIScreen mainScreen] bounds].size.height-568)?NO:YES) #define IS_OS_5_OR_LATER ([[[UIDevice currentDevice] systemVersion] floatValue] >= 5.0) #define IS_OS_6_OR_LATER ([[[UIDevice currentDevice] systemVersion] floatValue] >= 6.0) #define IS_OS_7_OR_LATER ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) #define IS_OS_8_OR_LATER ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0) #define IS_OS_9_OR_LATER ([[[UIDevice currentDevice] systemVersion] floatValue] >= 9.0)

Aunque siempre preferiré las macros anteriores, para completar la respuesta aceptada, esta es la forma aprobada por Apple:

if (NSFoundationVersionNumber > NSFoundationVersionNumber_iOS_6_1) { // do stuff for iOS 7 and newer } else { // do stuff for older versions than iOS 7 }


if (NSFoundationVersionNumber > NSFoundationVersionNumber_iOS_6_1) { // do stuff for iOS 7 and newer } else { // do stuff for older versions than iOS 7 }