The goal of my application deployment is iOS 7.0. I want to use the method systemFontOfSize(fontSize: weight:)on devices with iOS 8+. iOS 7 does not support this method (with a parameter weight:), and my application crashes. Especially for iOS 7, I want to install the Helvetica Light font instead of SystemFont Light.
What is the best way to test this? Do I need to check the iOS version, or can I check the method? as?
I use fast and proven
if let font = UIFont.systemFontOfSize(12, weight: UIFontWeightLight)
or
respondsToSelector. This did not work for me.
source
share