0

Is there a function to check what device the user is using?

In one of my View Controllers I have a view inside a scrollview. In that view I have some text inputs. Then I change the height position on that view in order to prevent the keyboard from being on top of the view/inputs.

I don't need to move the view as much on an iPhone 6 compared to an iPhone 5.

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Kiwo Tew
  • 1,491
  • 1
  • 22
  • 39
  • possible duplicate of [iOS - How to get device make and model?](http://stackoverflow.com/questions/11197509/ios-how-to-get-device-make-and-model) – brandonscript Jul 21 '15 at 23:05
  • This is a common question. Check out this answer: http://stackoverflow.com/questions/26028918/ios-how-to-determine-iphone-model-in-swift – StateOfB Jul 21 '15 at 23:06
  • why not use auto layout or get window height to work it out? – NSDeveloper Jul 21 '15 at 23:36
  • @NSDeveloper I have some other stuff that I am going to run depending on what device it is :) – Kiwo Tew Jul 22 '15 at 13:15

1 Answers1

-1
print(UIDevice.currentDevice().name)

Will get you want you want.

pxr
  • 40
  • 1
  • 6