title: How to get the device type in Swift TodayExtension
body: <p>Is there a way to determine the device type of the device the iOS TodayExtension is running on. I am not able to do it in Swift.</p>
  
  <p>I need to have something like this:</p>
  
  <pre><code>-(BOOL)isiPad {
      if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
          return YES;
      } else {
          return NO;
      }
  }
  </code></pre>
  
  <p>but in Swift and for a TodayExtension.</p>
  
  <p>Edit:</p>
  
  <pre><code>let IS_IPAD = (UI_USER_INTERFACE_IDIOM()==UIUserInterfaceIdiomPad);
  </code></pre>
  
  <p>is not working in iOS TodayExtensions.</p>
  
  <p><img src="https://i.stack.imgur.com/7NvsV.png" alt="enter image description here"></p>