A better choice for iOS Developer to use FontAwesome Icon with UI.😍

Overview

FontAwesomeKit.Swift

😀 😘 A better choice for iOS Developer to use FontAwesome Icon with UI. 😍
GitHub license

FontAwesome.otf 4.7.0

Support

Swift 4.2 & iOS 8.0+
FontAwesome 4.7.0
Storyboard supported.

Installation

CocoaPods

  1. add pod 'FontAwesomeKit.Swift' to your Podfile.
  2. Run pod install OR pod update.
  3. import FontAwesomeKit_Swift

Manually

  1. Download the full file.
  2. Drag the FontAwesomeKit folder to your project.

Example

Use FontAwesomeKit.Swift in Storyboard.

  1. Set Custom class to FontAwesomeButton or FontAwesomeLabel
  2. Set unicode string in Attributes inspector for FontAwesomeLabel or set normal, highlighted, selected, disabled unicode string for FontAwesomeButton, such as f107 or 0xf107
    // All awesome unicode --> http://fontawesome.io/cheatsheet/

FontAwesomeKit.Swift For Storyboard

Use FontAwesomeKit.Swift with String.

let str1 = String.fontAwesome(undefined: 0xf107)
let str2 = String.fontAwesome(awesomeType: .github)
let attrs = [NSFontAttributeName: UIFont(fontSize: 32)]
let attrStr1 = NSAttributedString(string: str1)
let attrStr2 = NSAttributedString(string: str2)

The attrStr1 will get icon. The attrStr2 will get icon.

Use FontAwesomeKit.Swift with UILabel.

let label = UILabel()
label.text = .apple
label.font = UIFont(fontSize: 100)
/// text : FontAwesomeType.

Use FontAwesomeKit.Swift with UIButton.

let button = UIButton(type: .custom)
button.setTitle(.gift, for: .normal)
/// type : The fontAwesome type, and you don’t need to ‘setImage’ or ‘setBackgroundImage’
/// state : The state that uses the specified title. The possible values are described in UIControlState.
button.titleLabel?.font = UIFont(fontSize: 50)

Use FontAwesomeKit.Swift with UIImage.

let image1 = UIImage(awesomeType: .github)
/// fontSize : The fontSize you can give, default is 80.
/// tintColor : The UIImage filled color you get, default is UIColor.lightGray.
let image2 = UIImage(awesomeType: .github, size: 30.0, color: UIColor.black)

Use FontAwesomeKit.Swift with UINavigationBarItem.

let rightItem = UIBarButtonItem(awesomeType: .github, style: .plain, target: nil, action: nil)
let leftItem = UIBarButtonItem(awesomeType: .github, size: 24, style: .plain, target: nil, action: nil)
/// fontSize : The font size, default is ‘24.0’
/// awesomeType : FontAwsomeType

LICENCE

Under MIT License

Thanks

  1. The FontAwesome Unicode list. From fontawesome.io
  2. The Lastest(version4.7.0) FontAwesome.otf bundle
Comments
  • Getting Deprecation Warning

    Getting Deprecation Warning

    let str1 = String.fontAwesome(undefined: 0xf107)

    for the above line i am getting the below deprecation warning, 'fontAwesome(undefined:)' is deprecated: Deprecated now, use fa.fontAwesome(undefined:) instead.

    if i change to fa.fontAwesome, i am getting "Instance member 'fa' cannot be used on type 'String' "

    bug 
    opened by MohanRamanathan 2
  • How do i set this on story board?

    How do i set this on story board?

    Lets say I have a UILabel on the story board. How do I set the font of this without using code?

    It might be good to just include a sample project on your github. (i could not find one when I downloaded your project)

    opened by patchthecode 2
  • error in UIImage

    error in UIImage

    when i used this line of code let image = UIImage(awesomeType: .github, size: 30.0, color: UIColor.black) this error appear Argument labels '(awesomeType:, size:, color:)' do not match any available overloads

    opened by BurierAbdalwahhabElia 1
  • Swift 4 issue.

    Swift 4 issue.

    Xcode: 9.0 GM. Swift : 4.0

    Following is the issue in 'FontAwesomeKit.swift' Line # 206.

    
    // Previous Code
    
    if !CTFontManagerRegisterGraphicsFont(font, &error) {
    
    // New Codeto fix.
    
    if !CTFontManagerRegisterGraphicsFont(font!, &error) {
    

    There are two warnings in 'FontAwesomeAble.swift' Line # 76 and 80.

    'substring(from:)' is deprecated: Please use String slicing subscript with a 'partial range from' opera Please fix these and update your repo.

    opened by saqibomer 1
  • 删除设置图标时修改图标大小的逻辑

    删除设置图标时修改图标大小的逻辑

    在使用过程中遇到UIButton设置字体大小被覆盖问题:

    abtn.titleLabel?.font = UIFont.fa?.fontSize(12)
    abtn.fa.setTitle(.eye , for: .normal)
    abtn.fa.setTitle(.eyeSlash , for: .selected)
    
    opened by UbunGit 0
  • Package problem

    Package problem

    Hello,

    After installing the package via CocoaPods and once the module has been imported, no errors are shown but I get a question mark, instead of the icon itself, every time I add a new icon.

    Does anyone know what is happening?

    Thank you!

    opened by pausanchezv 0
Releases(0.4.0)
Owner
Qiun Cheng
自知自明,自律自强
Qiun Cheng
Use FontAwesome in your Swift projects

FontAwesome.swift Use Font Awesome in your Swift projects To see the complete set of 3,978 icons in Font Awesome 5, please check the FontAwesome.com s

Thi Doãn 1.6k Dec 30, 2022
Icons fonts for iOS (Font Awesome 5, Iconic, Ionicon, Octicon, Themify, MapIcon, MaterialIcon, Foundation 3, Elegant Icon, Captain Icon)

Installation SPM Not yet supported. Please use Cocoapods or Carthage Carthage github "0x73/SwiftIconFont" Cocoapods CocoaPods is a dependency manager

sedat çiftçi 1.1k Dec 14, 2022
NSString+FontAwesome

FontAwesome+iOS Font awesome is an iconic font. Read more about it on http://fortawesome.github.com/Font-Awesome/ This category brings this great icon

Alex Usbergo 1.8k Nov 24, 2022
Generator of settings icon by SF Symbols. Customisable background color and ready-use in table cell.

SPSettingsIcons Generate settings icons by Apple's SF Symbols. For safe using SFSymbols see SPSafeSymbols library. Installation Swift Package Manager

Sparrow Code 110 Dec 28, 2022
Icon font library for iOS. Currently supports Font-Awesome, Foundation icons, Zocial, and ionicons.

FontAwesomeKit Icon font library for iOS. Currently supports Font-Awesome, Foundation icons, Zocial, and ionicons. Version 2.2 Notable Changes Not Jus

Pride Chung 2.8k Jan 6, 2023
Auto-generated icon font library for iOS, watchOS and tvOS

Iconic helps making icon fonts integration effortless on iOS, tvOS and watchOS. Its main component is in charge of auto-generating strongly typed Swif

Home Assistant 1.6k Nov 12, 2022
round icon drag control (made in swift) dock style

ASBubbleDrag Bubble drag control integrate in storyboard : Installation CocoaPods You can use CocoaPods to install ASBubbleDrag by adding it to your P

Alberto Scampini 46 Oct 12, 2022
An inkwell to use custom fonts on the fly.

Inkwell Introduction In brief, Inkwell is a font library to use custom fonts on the fly. Inkwell takes responsibilities for: Downloading fonts from Go

Vinh Nguyen 151 Oct 10, 2022
Use Ionicons in your Swift projects.

IoniconsKit IoniconsKit internally use ionicons.ttf v2.0.1 Example To run the example project, clone the repo, and run pod install from the Example di

Keita Oouchi 313 Dec 8, 2022
Use Octicons in your Swift projects.

OcticonsKit OcticonsKit internally use octicons.ttf v4.3.0 Example To run the example project, clone the repo, and run pod install from the Example di

Keita Oouchi 52 Jan 31, 2022
OpenSansSwift - Easily use the OpenSans font in Swift.

OpenSansSwift Easily use the OpenSans font in Swift. Why use OpenSansSwift frameworks ? The usual process of embedding any custom fonts in your IOS ap

Hemant Sapkota 42 Jan 29, 2022
Programmatically load custom fonts into your iOS and tvOS app.

FontBlaster Programmatically load custom fonts into your iOS and tvOS app. About Say goodbye to importing custom fonts via property lists as FontBlast

Arthur Ariel Sabintsev 1.1k Jan 3, 2023
Font management (System & Custom) for iOS and tvOS

UIFontComplete Font management (System & Custom) for iOS and tvOS Usage No more wasted time searching for names of UIFont fonts and no more surprises

Nicholas Maccharoli 1.3k Nov 14, 2022
Google Material Design Icons Font for iOS

GoogleMaterialDesignIcons #Google Material Design Icons Font for iOS It is based on https://github.com/google/material-design-icons. it converts the m

Yuji Hato 365 Oct 19, 2022
Font Awesome swift library for iOS.

Font Awesome Swift Follow me: @vaberer I like ★. Do not forget to ★ this super convenient library. Added UISegmentedControl & UITabbarItem & UISlider

Patrick Vaberer 746 Dec 17, 2022
This projects shows how we can server-side add/update "ANY" custom font in a live iOS App without needing to update the app.

Server-side-Dynamic-Fonts This projects shows how we can server-side add/update "ANY" custom font in a live iOS App without needing to update the app.

null 2 Mar 26, 2022
Pretendard Fonts for iOS (Swift Package Manager)

PretendardKit Pretendard 1.3.3 을 기반으로 합니다. Install (Swift Package Manager) dependencies: [ .package(url: "https://github.com/wookeon/PretendardKit

Darth Vader 1 Jun 2, 2022
Use 1600+ icons (and more!) from FontAwesome and Google Material Icons in your swift/iOS project in an easy and space-efficient way!

Swicon Use 1600+ icons from FontAwesome and Google Material Icons in your iOS project in an easy and space-efficient way! The built-in icons are from

Zhibo 39 Nov 3, 2022
Use FontAwesome in your Swift projects

FontAwesome.swift Use Font Awesome in your Swift projects To see the complete set of 3,978 icons in Font Awesome 5, please check the FontAwesome.com s

Thi Doãn 1.6k Dec 30, 2022
Icons fonts for iOS (Font Awesome 5, Iconic, Ionicon, Octicon, Themify, MapIcon, MaterialIcon, Foundation 3, Elegant Icon, Captain Icon)

Installation SPM Not yet supported. Please use Cocoapods or Carthage Carthage github "0x73/SwiftIconFont" Cocoapods CocoaPods is a dependency manager

sedat çiftçi 1.1k Dec 14, 2022