what is the code to detect whether ios app running in iPhone, iPhone Retina display, or iPad?

前端 未结 5 1647
走了就别回头了
走了就别回头了 2021-01-02 06:03

what is the code to detect whether ios app running in iPhone, iPhone Retina display, or iPad?

Background:

  • for my iPhone application I have defined i

5条回答
  •  無奈伤痛
    2021-01-02 06:29

    Here is some code to copy and paste...

    bool runningOniPhone;
    if([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone){
        runningOniPhone = TRUE;
    } else {
        runningOniPhone = FALSE;
    }
    

提交回复
热议问题