Last active
August 29, 2015 14:10
-
-
Save rrenna/ec2fa0dc5707d6ae4411 to your computer and use it in GitHub Desktop.
Example of odd UIAppearance proxy behaviour in iOS 8.1. When implemented this way, the labels used in controls which should be outside the scope of your app, like the iOS share sheet, are also modified.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Extend UILabel with a method which sets font, to be used by UIAppearance | |
extension UILabel | |
{ | |
func setFontName(fontName:String) | |
{ | |
self.font = UIFont(name: fontName, size: self.font.pointSize) | |
} | |
} | |
// Somewhere in the code, call the extension method on the UIAppearance proxy object of UILabel, example: | |
// | |
// UILabel.appearance().setFontName("HandelGothicBT-Regular") | |
// |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment