Peter Kazazes Peter Kazazes - 11 days ago 6
iOS Question

if (device == iPad), if (device == iPhone)

So I have a universal app and I'm setting up the content size of a

UIScrollView
. Obviously the content size is going to be different on iPhones and iPads. How can I set a certain size for iPads and another size for iPhones and iPod touches?

Answer
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
{
     // The device is an iPad running iOS 3.2 or later.
}
else
{
     // The device is an iPhone or iPod touch.
}