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
Post a Comment