Code Monkey home page Code Monkey logo

ioniconsswift's Introduction

IoniconsSwift

Ionicons integration for Swift and iOS.

Built for Swift 4.0 - for older versions of swift please use the swift\1.2, swift\2.0, and swift\3.0 branches.

Features

  • Includes all 732 icons.
  • Tiny API, just one enum type and two methods.
  • All icons are always balanced and squared.
  • Generate icons as UIImage or UILabel

Installation

Carthage: Add github tidwall/IoniconsSwift to your Cartfile.
CocoaPods: Add pod 'IoniconsSwift', :git => 'http://github.com/tidwall/IoniconsSwift.git', :branch => 'master' to your Podfile.

Example

import IoniconsSwift

// Square UIImage of an icon.
let image = Ionicons.alert.image(35)                                 
let image = Ionicons.iosClock.image(35, color: UIColor.greenColor()) 

// Square UILabel
let label = Ionicons.alert.label(35)                                 
let label = Ionicons.iosClock.label(35, color: UIColor.greenColor()) 

Contact

Josh Baker @tidwall

License

The IoniconsSwift source code is available under the MIT License.

ioniconsswift's People

Contributors

readmecritic avatar tidwall avatar vinnyt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ioniconsswift's Issues

Unexpectedly found nil while unwrapping an Optional value (inData)

In ionicons.swift, my project crashes when it attempts to execute this line:

Line 20: let inData = try? Data(contentsOf: URL(fileURLWithPath: Bundle(identifier: "com.oncast.IoniconsSwift")!.path(forResource: "ionicons", ofType: "ttf")!))

Crash:
fatal error: unexpectedly found nil while unwrapping an Optional value

EXEC_BAD_INSTRUCTION Error with Carthage

Hi,

first: thanks for the project. I've been looking for a good IonIcons Swift Library for a while now. This one seems to support everything what I want, but unfortunately I can't get it to work with Carthage and I really don't want to use Cocoapods anymore.

The problem:
Everytime I try to generate an image with the library, I get a EXC_BAD_INSTRUCTION in line 20 of ionicons.swift:

let inData = NSData(contentsOfFile: NSBundle(identifier: "org.cocoapods.IoniconsSwift")!.pathForResource("ionicons", ofType: "ttf")!)

Seems like the font file can't be accessed?

Thanks in advance. ๐Ÿ‘

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.