开发者

How to know if we are on an iPad or on an iPhone [duplicate]

This question already has answers here: 开发者_开发技巧 Closed 12 years ago.

Possible Duplicate:

API to determine whether running on iPhone or iPad

Hi,

I'd like to test the device in my application, to know wether I'm on a iPad device or on an Iphone.

is there a easy way to do that ?

thank's au lot

David


All you need is this:

UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad


http://github.com/erica/uidevice-extension/blob/master/UIDevice-Hardware.m

Note too that any number of search engines will work for this also (SO and google come to mind). And they will be PHENOMENALLY faster that posting and waiting. Just saying.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜