I found a code in another article.
if([[UIDevice currentDevice]userInterfaceIdiom]==UIUserInterfaceIdiomPhone)
{
if ([[UIScreen mainScreen] bounds].size.height == 568)
{
}
else
{
//iphone 3.5 inch screen
}
}
else
{
//[ipad]
}
This article is the article code of 5 years ago. I think that it is too old. Because it is not compatible with iPhone 10.
Please tell me the latest code that allows for flexibility.