May 26, 2014

[iOS] detectIPhone or iPad

+ (BOOL) detectIPhone
{
    if([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone){
        return YES;
    }else{
        return NO;
    }

}


Use function userInterfaceIdiom of class UIDevice to detect iPhone or iPad.

No comments:

Post a Comment