UIFont with custom font fails with Nil

后端 未结 7 1975
孤街浪徒
孤街浪徒 2020-12-31 10:59

I\'m trying to add a custom font to my project in Xcode 4.2, but whenever I try to use it, I get a error that the object is nil.

I have done the following:
1) Ad

7条回答
  •  萌比男神i
    2020-12-31 11:21

    My font file is "Futura Heavy.ttf", then I use - replaced the space like below then it works!

        class func futuraHeavy() -> UIFont {
            return UIFont(name: "Futura-Heavy", size: 12)!
        }
    

提交回复
热议问题