How to do Custom Fonts at design time in Xcode 6?

2019-02-03 07:06发布

问题:

It was explained in the WWDC 2014 videos that you can have Custom Fonts at designing time directly in Storyboard, but so far I only see the list of iOS fonts. Any help?

回答1:

All you have to do is to drag and drop the font files to your Xcode project, then you can find the font in the Custom font list. You don't even have to have them included in your Application Plist. That makes things simpler.

If you already had fonts added to Xcode 5.1 project, they will not show up in the custom fonts list upon upgrading to Xcode6. You can just remove references to the fonts then drop them in the project again and check the "copy to target". This will show custom fonts in the interface builder custom fonts dropdown on xCode6.



回答2:

First use your custom font in storyboard then you can use it in code.