Font-Awesome-Swift 0,0,1,0 CocoaPods

Font Awesome swift library for iOS.

Font Awesome Swift

Font Awesome Swift

Follow me: @vaberer

I like ★. Do not forget to ★ this super convenient library.

There is also a very popular Google Design Material Icons library which you will love!

Added UISegmentedControl & UITabbarItem & UISlider support!

Updated to Font Awesome 4.6.3 - Added 30 new icons!

Font Awesome swift library for iOS. No image icons any more. Using Font Awesome Swift library is very easy to use. Look at the demo app which shows all icons and their names or just visit FontAwesome.

Requirements

  • iOS 8.0+
  • Xcode 8

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects.

CocoaPods 0.36 adds supports for Swift and embedded frameworks. You can install it with the following command:

$ gem install cocoapods

To integrate Font Awesome Swift into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!

pod 'Font-Awesome-Swift', '~> 1.5.2'

Then, run the following command:

$ pod install

Do not forget to import to your swift files where you want to use this library:

import Font_Awesome_Swift

Check branches swift-2.2 and swift-2.3

Manually

  1. Copy FAIcon.swift and FontAwesome.ttf files into your project
  2. Check to import FontAwesome.ttf in project, "Project" > "Target" > "Copy Bundle Resources"

Usage

Super easy way how to add an icon.

UIImage

    imageView.setFAIconWithName(FAType.FATwitter, textColor: UIColor.blueColor(), backgroundColor: UIColor.grayColor())

    imageView.setFAIconWithName(FAType.FATwitter, textColor: UIColor.blueColor())

UILabel

    labelName.FAIcon = FAType.FAGithub

    labelName.setFAIcon(FAType.FAGithub, iconSize: 35)

    labelName.setFAText(prefixText: "follow me on ", icon: FAType.FATwitter, postfixText: ". Thanks!", size: 25)

    // bigger icon:
    labelName.setFAText(prefixText: "follow me on  ", icon: FAType.FATwitter, postfixText: ". Thanks!", size: 25, iconSize: 30)

    labelName.setFAColor(UIColor.redColor())

UIButton

    buttonName.setFAIcon(FAType.FAGithub, forState: .Normal)

    // set an icon size
    buttonName.setFAIcon(FAType.FAGithub, iconSize: 35, forState: .Normal)

    buttonName.setFAText(prefixText: "follow me on ", icon: FAType.FATwitter, postfixText: ". Thanks!", size: 25, forState: .Normal)

    // bigger icon
    buttonName.setFAText(prefixText: "follow me on ", icon: FAType.FATwitter, postfixText: ". Thanks!", size: 25, forState: .Normal, iconSize: 30)

    // change a color:
    buttonName.setFATitleColor(UIColor.redColor(), forState: .Normal))

UIBarButtonItem

    // Standard font size
    barName.FAIcon = FAType.FAGithub

    // Custom font size
    barName.setFAIcon(FAType.FAGithub, iconSize: 35)

    barName.setFAText(prefixText: "follow me on ", icon: FAType.FATwitter, postfixText: ". Thanks!", size: 25)

    barName.tintColor = UIColor.redColor()

UISegmentedControl


  segmentedControl.setFAIcon(FAType.FATwitter, forSegmentAtIndex: 0)

UITabbarItem

  tabBarController?.tabBar.items?.first?.setFAIcon(FAType.FATwitter)

UISlider

  // change minimum or maximum value image
  slider.setFAMinimumValueImage(.FABellSlashO)
  slider.setFAMaximumValueImage(.FABellO)

  // change minimum or maximum value image with a specific size
  slider.setFAMinimumValueImage(.FABellSlashO, customSize:  CGSizeMake(35, 35))
  slider.setFAMaximumValueImage(.FABellO, customSize:  CGSizeMake(35, 35))

UIViewController

  // change navigation title
  FATitle = FAType.FATwitter

Author

Patrik Vaberer, [email protected]

Licence

Font Awesome Swift is available under the MIT license. See the LICENSE file for more info.

Related Repositories

awesome-swift

awesome-swift

A collaborative list of awesome swift resources. Feel free to contribute! ...

awesome-swift

awesome-swift

A collaborative list of awesome swift resources. Feel free to contribute! ...

awesome-swift

awesome-swift

A collaborative list of awesome swift resources. Feel free to contribute! ...

awesome-swift

awesome-swift

A collaborative list of awesome swift resources. Feel free to contribute! ...

awesome-swift

awesome-swift

A collaborative list of awesome swift resources. Feel free to contribute! ...


Top Contributors

Vaberer othyn SNagra tchukuchuk marekmatula michaelsabo

Releases

-   1.4.9 zip tar
-   1.4.8 zip tar
-   1.4.7 zip tar
-   1.4.6 zip tar
-   1.4.5 zip tar
-   1.4.4 zip tar
-   1.4.3 zip tar
-   1.4.2 zip tar
-   1.4.1 zip tar
-   1.4.0 zip tar
-   1.3.0 zip tar
-   1.2.0 zip tar
-   1.1.0 zip tar
-   1.0.0 zip tar