Skip to content
This repository has been archived by the owner on Dec 26, 2018. It is now read-only.

radianttap/UILabel-FontName

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

UILabel+FontName

UILabel, by default, does not have the ability to globally customize font name, meaning no UI_APPEARANCE_SELECTOR for that. This category enables you to do just that.

Usage

  • Copy the files to your project and import them as needed

  • in application:didFinishLaunchingWithOptions: method (or wherever you want) do this:

	[[UILabel appearance] setFontName:@"AvenirNext-Medium"];
	[[UILabel appearance] setBoldFontName:@"AvenirNext-DemiBold"];

The result? All the UILabels in your app, that use systemFont will now use AvenirNext-Medium, while all those that use boldSystemFont will use the DemiBold weight. The best part is that if you have set a specific font in Interface Builder, it will be left alone. If you want to override even that, then you should use:

	[[UILabel appearance] forceFontName:@"AvenirNext-Medium"];

And that's it.

About

UIAppearance for UILabel font name

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published