ios判断用户设备

 

ios判断用户设备:

   if (UI_USER_INTERFACE_IDIOM()==UIUserInterfaceIdiomPhone) {

        NSLog(@"Your dervice is phone!!");

    }elseif (UI_USER_INTERFACE_IDIOM()==UIUserInterfaceIdiomPad)

    {

        NSLog(@"Your dervice is ipad!!");

    }else{  NSLog(@"未识别您的设备......");  }

 

设备类型 iphone 和 ipad --- 下边的枚举 

UIUserInterfaceIdiom

The type of interface that should be used on the current device

typedef enum {

   UIUserInterfaceIdiomPhone,

   UIUserInterfaceIdiomPad,

} UIUserInterfaceIdiom;

原文地址:https://www.cnblogs.com/zander/p/2638525.html