ios - is iPhone 5 always Returns False -
i using following code (in appdelegate) detect if device iphone 5
bool isiphone5 = cgsizeequaltosize([[uiscreen mainscreen] preferredmode].size,cgsizemake(640, 1136));
it returns false always. not first time used code. eventhe nslog returns {320, 480}
nslog(@"%@",nsstringfromcgsize([[uiscreen mainscreen] bounds].size));
note: app ipad , made universal. have 2 storyboards why need detection code.
thanks
this should work mate,
bool isiphone5 = ([[uiscreen mainscreen] bounds].size.height == 568);
and make sure use 4-inch simulator
Comments
Post a Comment