Latest 0.1
Homepage https://github.com/kentya6/IconFontStack
License MIT
Platforms ios 8.0, requires ARC
Authors

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

Features

  • [x] Various IconFonts (FontAwesome, ionicons, googleMaterialDesignIcons)
  • [x] Enum-base mapping
  • [x] 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

Latest podspec

{
    "name": "IconFontStack",
    "version": "0.1",
    "summary": "Icon Font library for iOS",
    "homepage": "https://github.com/kentya6/IconFontStack",
    "license": "MIT",
    "authors": {
        "Kengo Yokoyama": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/kentya6/IconFontStack.git",
        "tag": "0.1"
    },
    "source_files": "Source/*.swift",
    "resource_bundles": {
        "IconFontStack": "Source/IconFonts/*.ttf"
    },
    "requires_arc": true,
    "ios": {
        "frameworks": "UIKit"
    }
}

Pin It on Pinterest

Share This