Check Device

-(void)typeOfDevice

{

    if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)

    {

        //its iPhone. Find out which one?

        

        CGSize result = [[UIScreen mainScreen] bounds].size;

        if(result.height == 480)

        {

            // iPhone Classic

            

            NSLog(@”iPhone Classic”);

        }

        else if(result.height == 568)

        {

            // iPhone 5

            NSLog(@”iPhone5″);

            

        }

        else if(result.height == 667)

        {

            // iPhone 6

            NSLog(@”iPhone6″);

            

        }

        else if(result.height == 736)

        {

            // iPhone 6 Plus

            NSLog(@”iPhone 6 Plus”);

            

        }

    }

    else

    {

        //its iPad

        

        NSLog(@”iPad”);

        

    }

    

}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s