Using FontAwesome Icon Picker in swift for iOS Apps - SKFontAwesomeIconPickerView


SKFontAwesomeIconPickerView

An icon picker view which will show list of icons from Font Awesome.

Demo GIF

Demo

With the help of Icon Picker View, Icon picker funcationality can be achieved easily.

Features

  • Customizable Icon Color
  • Customizable Icon Border Color
  • Customizable Icon Border Size
  • Customizable Icon Border corner radius
  • Customizable Icon Background color
  • Customizable Selected Icon Color
  • Customizable Selected Icon Border Color
  • Customizable Selected Icon Border Size
  • Customizable Selected Icon Border corner radius
  • Customizable Selected Icon Background color

Requirements

  • iOS 9.0+
  • Xcode 9

Installation

CocoaPods

You can use CocoaPods to install SKFontAwesomeIconPickerView by adding it to your Podfile:

platform :ios, '9.0'
use_frameworks!
pod 'SKFontAwesomeIconPickerView', :git => 'https://github.com/sag333ar/SKFontAwesomeIconPickerView.git', :branch => 'master'

To get the full benefits import SKRadioButton wherever you import UIKit

import UIKit
import SKFontAwesomeIconPickerView

Usage example

Step 1: Download FontAwesome from here or here

Step 2: Drag & drop font into your Xcode project.

Step 3: Open Info.plist and add an entry as indicated below.

AddFont.png

Step 4: Open your project’s Storyboard. Drag & drop a view. Select it & change Class name to SKFontAwesomePickerView as indicated below from Identity Inspector.

CustomClass.png

Step 5: Change your view controller’s code as indicated below. Also apply necessary connections to Storyboard.

import UIKit
import SKFontAwesomeIconPickerView

class ViewController: UIViewController {

  @IBOutlet var iconPicker: SKFontAwesomePickerView!
  @IBOutlet var label: UILabel!
  
  override func viewDidLoad() {
    super.viewDidLoad()
    iconPicker.didSelectClosure = { icon in
      DispatchQueue.main.async {
        self.label.text = icon
      }
    }
  }

}

Hope that helps.

If it does not, download sample project from here for more reference.