2015-04-27 57 views

回答

1

你可以只使用一個全局常量爲:

let isRetina = UIScreen.mainScreen().respondsToSelector("displayLinkWithTarget:selector:") && UIScreen.mainScreen().scale == 2 
1

定義該出class支架

let IS_RETINA = UIScreen.mainScreen().respondsToSelector(Selector("displayLinkWithTarget:selector:")) && UIScreen.mainScreen().scale == 2.0