title: Detect if the device is iPhone X
body: <p>My iOS app uses a custom height for the <code>UINavigationBar</code> which leads to some problems on the new iPhone X. </p>
  
  <p>Does someone already know how to <strong>reliable</strong> detect programmatically (in Objective-C) if an app is running on iPhone X?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Of course checking the size of the screen is possible, however, I wonder if there is some "build in" method like <code>TARGET_OS_IPHONE</code> to detect iOS...</p>
  
  <pre><code>if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
      CGSize screenSize = [[UIScreen mainScreen] bounds].size;
      if (screenSize.height == 812)
          NSLog(@"iPhone X");
  }
  </code></pre>
  
  <p><strong>EDIT 2:</strong></p>
  
  <p>I do not think, that my question is a duplicate of the linked question. Of course, there are methods to "measure" different properties of the current device and to use the results to decide which device is used. However, this was not the actual point of my question as I tried to emphasize in my first edit. </p>
  
  <p>The actual question is: <strong>"Is it possible to directly detect if the current device is an iPhone X (e.g. by some SDK feature) or do I have to use indirect measurements"</strong>?</p>
  
  <p>By the answers given so far, I assume that the answer is "No, there is no direct methods. Measurements are the way to go". </p>