Skip to content

Instantly share code, notes, and snippets.

View rajeshs73's full-sized avatar

Rajesh rajeshs73

  • Bangalore, India
View GitHub Profile
@rajeshs73
rajeshs73 / FontsList.swift
Last active December 20, 2017 09:42
List out all the available fonts - Swift
let familyNames: [String] = UIFont.familyNames
for familyName in familyNames {
print("Family Name: \(familyName)")
let fontNames: [String] = UIFont.fontNames(forFamilyName: familyName)
print(fontNames)
}
@rajeshs73
rajeshs73 / Font.swift
Last active December 20, 2017 09:39
UIFont Extension - Accessing Fonts with Enum ways - Swift
// Font Enum
public enum Font: String {
/// Font Family: Poppins
case poppinsBold = "Poppins"
case poppinsLight = "Poppins-Light"
case poppinsMedium = "Poppins-Medium"
case poppinsRegular = "Poppins-Regular"
case poppinsSemiBold = "Poppins-SemiBold"
/// Font Family: Roboto