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

enter image description here


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -