/IconFontStack

Icon Font library for iOS

Primary LanguageSwiftMIT LicenseMIT

IconFontStack

CocoaPods Compatible Carthage Compatible License Platform Language Percentage of issues still open Average time to resolve an issue

Features

  • Various IconFonts (FontAwesome, ionicons, googleMaterialDesignIcons)
  • Enum-base mapping
  • Support IBDesignable

Usage

UILabel

label.setIcon(icon: .googleMaterialDesign(.settings), size: 30)

UIButton

button.setIcon(icon: .fontAwesome(.heart), forState: .normal)

UITextField

textField.setRightViewIcon(icon: .fontAwesome(.addressBook))
textField.setLeftViewIcon(icon: .fontAwesome(.star))

UIStepper

stepper.setIncrementIcon(icon: .ionicons(.alert), forState: .normal)
stepper.setDecrementIcon(icon: .ionicons(.leaf), forState: .normal)

UISlider

slider.setMinimumValueIcon(icon: .fontAwesome(.home))
slider.setMaximumValueIcon(icon: .fontAwesome(.key))

UIImageView

imageView.setIcon(icon: .fontAwesome(.star), color: .orange, size: CGSize(width: 44, height: 44))

UISegmentedControl

segmentedControl.setIcon(icon: .googleMaterialDesign(.shop), forSegmentAtIndex: 0)
segmentedControl.setIcon(icon: .googleMaterialDesign(.openInNew), forSegmentAtIndex: 1)

Support @IBDesignable

  1. Add UI Element into Storyboard.
  2. Rename it to IconFontXXX. (supported classes are listed below)
  3. Open inspecter and fill iconfont id (ex: fa-check, ion-ios-email) to icon Id placeholder.
- IconFontLabel (UILabel)
- IconFontStepper (UIStepper)
- IconFontSlider (UISlider)
- IconFontImageView (UIImageView)
- IconFontTextField (UITextField)
- IconFontSegmentedControl (UISegmentedControl)
- IconFontButton (UIButton)

Requirement

  • Swift4

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects.

To integrate IconFontStack into your Xcode project using CocoaPods, specify it in your podfile:

target 'YourProject' do
    use_frameworks!
    pod 'IconFontStack', '~> 0.1'
end

Then, run the following command:

$ pod install

Carthage (iOS 8+)

Carthage is a decentralized dependency manager that automates the process of adding frameworks to your Cocoa application.

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

To integrate IconFontStack into your Xcode project using Carthage, specify it in your Cartfile:

github "kentya6/IconFontStack" >= 0.1

Manually

  1. Add Source folder into your Xcode project. Folder Link
  2. Add .swift file included Source folder to Compile Sources.

Licence

The MIT License (MIT)

Copyright (c) 2017 Kengo YOKOYAMA

Author

kentya6

Contributing

  1. Fork it (http://github.com/kentya6/IconFontStack/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request