Code Monkey home page Code Monkey logo

novefeathericons's Introduction

NoveFeatherIcons

Version License Platform

Swift library for Feather.

For more information about Feather icons pack, please refer to their README.

Installation

NoveFeatherIcons is available through CocoaPod.

To install it, simply add the following line to your Podfile:

pod "NoveFeatherIcons", "~> 1.0"

Usage

Get an UIImage programmatically

You can get an UIImage containing the desired icon using one of the following functions:

import NoveFeatherIcons

let iconFromEnum = Feather.getIcon(.feather) // Using an enum
let iconFromString = Feather.getIcon("feather") // Using the icon’s name

If the icon is not found, those functions will return nil.

You can find the list of available icons on the official Feather website, or by looking at Feather.IconsName enum content in the Pod.

All icons contain vector data, so you can resize it as you wish. Their default size is 24×24 pixels.

Extensions & custom types

Usage of pod’s assets in Interface Builder is not allowed, as the Bundle is different.

That is why NoveFeatherIcons contains subclasses that help you integrate icons on your storyboards and XIBs. It also provides extensions to quickly init common types.

UIImageView

You can quickly init an UIImageView containing an icon using:

let image = UIImage(.feather)

In Interface Builder, you can use the FeatherImageView subclass to add an icon without code. The icon name goes in the iconName field of the Attributes inspector.

Please note that the icon will not show in IB, but will appear when running.

UIButton

In Interface builder, you can use the FeatherButton subclass to add a button containing an icon without code. The icon name goes in the iconName field of the Attributes inspector.

Please note that the icon will not show in IB, but will appear when running.

UIBarButtonItem

You can quickly init an UIBarButtonItem containing an icon using:

init(icon: Feather.IconName, style: UIBarButtonItem.Style, target: Any?, action: Selector?)

Example:

let barButtonItem = UIBarButtonItem(icon: .feather, style: .plain, target: self, action: #selector(featherButtonTapped))

In Interface Builder, you can use the FeatherBarButtonItem subclass to add an icon without code. The icon name goes in the iconName field of the Attributes inspector.

Please note that the icon will not show in IB, but will appear when running.

Requirements

  • iOS 9.0+
  • macOS 10.15+

Credits

Steve Gigou (Website, Twitter)

All Feather icons are made by @colebemis

License

NoveFeatherIcons is available under the MIT license. See the LICENSE file for more informations.

novefeathericons's People

Contributors

sgigou avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.