I am setting up an application where I want to make a number of changes to the view layout based on the type of iPhone in use. Specifically I want to know if the vertical screen resolution is 1136 (iPhone5) or 960 (iPhone4). One of the things I want to do is adjust the height of my UITableViewCells in a UITableView so that no partial cells are displayed when the app is run on either phone.
My question is: what is the best way to detect the phone hardware type in use so that I can make the appropriate changes to my view layout?
You should really use the autolayout features to make your views adapt to whatever format the screen is.
However, if you only want to know if the device is an iPhone 5 (ie has 1136px in height) you could use:
Could ofcourse be turned into a macro.