Tuesday, February 7, 2012

determining if iPad

This piece of code tells you if the code is running on an iPad and then runs @2x.


+(BOOL) isIPad {
  BOOL isIPad=NO;
  NSString* model = [UIDevice currentDevice].model;
  if ([model rangeOfString:@"iPad"].location != NSNotFound) {
    return YES;
  }
  return isIPad;
}

No comments:

Post a Comment