0

Using UIDevice seems to be incomplete. Whenever I try to use UIDevice().model, the output is just iPhone not iPhone 7 or whatever device the user is on.

let deviceName = UIDevice().model
let localizedName = UIDevice().localizedModel

Is there a way to tell what specific device the user is on in Swift?

paralaxbison
  • 189
  • 1
  • 2
  • 13
  • Have a look at this http://stackoverflow.com/a/14411113/1269509 – Thanh Pham Oct 04 '16 at 17:33
  • See http://stackoverflow.com/questions/26028918/ios-how-to-determine-iphone-model-in-swift/26962452#26962452 – HAS Oct 04 '16 at 17:40
  • The other comments should help you out, but if you want a little less practical way of determining a phone size you can go by screen size. `if self.view.frame.height == blah && self.view.frame.width == bloop { let phoneSize = 3,4,5,6,etc }` – Andrew Cook Oct 04 '16 at 18:48

0 Answers0