ios - Get screen size of Storyboard preview programatically -


in order device screen size in swift, use code:

uiscreen.mainscreen().bounds.size

it works great, except when i'm using storyboard previews. in @ibdesignable uilabel subclass, use smaller font if user on iphone4 , bigger font otherwise. works fine using simulator, doesn't work storyboard previews.

all previews—from iphone4 ipad pro—load smaller font, meaning returning 320x480 code above. here's question: code return device screen size of storyboard previews (e.g., plug prepareforinterfacebuilder)?


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

dataset - MPAndroidchart returning no chart Data available -

post - imageshack API cURL -