title: How do I detect which iOS device my user is using?
body: <p>I'm searching for a way to detect the device my app is running on. I am not interested in software version. I searched many questions but none of them (surprisingly) satisfy my needs for following reasons:</p>
  
  <p><strong>Solution 1:</strong></p>
  
  <pre><code>NSString *deviceType = [UIDevice currentDevice].model;
  </code></pre>
  
  <p>This does not work because it gives me just "iPad". I want to know whether it is iPad, iPad 2, new iPad, iPhone 3GS, iPhone4 etc. </p>
  
  <p><strong>Solution 2:</strong> Not testing for device type, checking for individual capabilities</p>
  
  <p>This does not apply because I want this data to collect user statistics, not to perform any device specific operation.</p>
  
  <p><strong>Solution 3:</strong> Using UIDeviceHardware found <a href="https://gist.github.com/1323251">here</a></p>
  
  <p>This code looks pretty outdated and seems to access private data on the device. There is even debate whether an app using this will get approved or not. More importantly, I have no idea how it works :) An alternative is also found <a href="https://github.com/erica/uidevice-extension">here</a></p>
  
  <p>Are any of the last two I mentioned safe to use? Are they future compliant? Do they comply with Apple approval rules?</p>
  
  <p>Or is there any other method to get around this? </p>
  
  <p>Thanks in advance.</p>