ios11 detect ipad pro

hi in the new ios11 and xcode9 my old function for check ipad pro doesn't work


UIWebView* webView = [[UIWebView alloc] initWithFrame:CGRectZero];

NSString* userAgent = [webView stringByEvaluatingJavaScriptFromString:@"navigator.userAgent"];

return [userAgent containsString:@"iPhone"] && ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad);


any suggestion for solve?

Replies

SOLVED



UIScreen *mainScreen = [UIScreen mainScreen];

if ((mainScreen.nativeBounds.size.height >= 1366 || mainScreen.nativeBounds.size.width >= 1366))

{

return true;

}

else

{

return false;

}