Tag Archives: design

UIFont not responding or nil

My font does not respond and it says nil when I print it? What’s happening here? Actually, if your UIFont happens to be nil, it’s maybe because you’re not calling it properly! Haha, very funny, I know, but let’s have a look at happened to me recently. Here is what I did: I imported “MyFont-Regular.ttf” and “MyFont-bold.ttf” in Xcode. I set the constants with the font name. let fontRegular = “MyFont-Regular” let fontBold = “MyFont-Bold” And I set the font to that label in the view: label.font = UIFont(name: fontRegular, size: 12.0) and … nothing happened, well, the label was displayed … Continue reading UIFont not responding or nil