I find UISegmentedControl
change font and size like this :
UISegmentedControl.appearance().setTitleTextAttributes(myFontAttribute as [NSObject : AnyObject] , forState: .Normal)
but UILabel have no this method
I want to do like
UILabel.appearance().setAttributed(myFontAttribute)
I don't want to change UILabel font in StoryBoard
I want to using program to do this (because my app is done, but only font should change to bigger and other font)
What should I do ?
UIAppearance
only allows you to set properties that are flagged withUI_APPEARANCE_SELECTOR
in the Objective-C header file. SinceUILabel
has no such properties, it cannot be styled withUIAppearance
See also this question, which is essentially the exactly the same question, but using Objective-C – Dried