Skip to content

Instantly share code, notes, and snippets.

View rrenna's full-sized avatar

Ryan Renna rrenna

  • Toronto, Canada
View GitHub Profile
@rrenna
rrenna / gist:ec2fa0dc5707d6ae4411
Last active August 29, 2015 14:10
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.
// 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: