How to integrate and use Font Awesome with Objective-C or Swift in an Xcode project?

后端 未结 17 1412
不思量自难忘°
不思量自难忘° 2020-12-12 18:07

So I am trying to use this font http://fortawesome.github.com/Font-Awesome/. I\'ve added the font as a resource and put it in the plist file. Here\'s how I am using it:

17条回答
  •  旧巷少年郎
    2020-12-12 18:43

    In Swift:

    Font Awesome Cheatsheet.

    Tutorial on how to integrate the font called "Font Awesome" in your Xcode project.

    Common Mistakes With Adding Custom Fonts to Your iOS App

    let label = UILabel(frame: CGRectMake(0, 0, 100, 100))
    label.font = UIFont(name: "FontAwesome", size: 40)
    let myChar: UniChar = 0xF180
    label.text = String(format: "%C", myChar)
    self.view.addSubview(label)
    

提交回复
热议问题