Skip to content

Instantly share code, notes, and snippets.

@haroldjones
Last active October 27, 2015 20:56
Show Gist options
  • Save haroldjones/26b32d11cc16bc24d7f9 to your computer and use it in GitHub Desktop.
Save haroldjones/26b32d11cc16bc24d7f9 to your computer and use it in GitHub Desktop.
SWIFT: Print out all the fonts available to your application
import UIKit
class ViewController: UIViewController {
var stockTickerLabel: UILabel!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
for family: String in UIFont.familyNames()
{
print("\(family)")
for names: String in UIFont.fontNamesForFamilyName(family)
{
print("== \(names)")
}
}
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment