To Check iPhone or iPad view by Code, we can check by following code
Now to Check iPhone5 or iPhone4, we can do a check in iPhone vide code
and We can use this as like below
else
{
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
// Code for iPhone View
} else {
// Code for iPad View
}
-(Boolean)checkIphone5{
UIScreen *screen = [UIScreen mainScreen];
CGRect fullScreenRect = screen.bounds;
if (fullScreenRect.size.height==568) {
return TRUE;
}
else{
return FALSE;
}
}
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone)
{
if ([self checkIphone5]) {
// Code for iPhone5 View
}else
{
// Code for iPhone 4 View
}
} else {
// Code for iPad View
}
No comments:
Post a Comment