OcticonsSwift 0.1.2

OcticonsSwift 0.1.2

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Oct 2016
SPMSupports SPM

Maintained by Jason Nam.



OcticonsSwift

Octicons Swift wrapper.

This project is based on OcticonsIOS.

This project uses Octicons version 3.5.0, not the latest. Please refer this issue.

Usage

Font

let octiconsFont = UIFont.octiconsFont(size: 18)
let octiconsFont = UIFont(name: "Octicons", size: 18)

String

let repoString = String.character(for: .repo)

UIImage / NSImage

let repoImage = UIImage(octiconsID: .repo,
                        iconColor : UIColor.black,
                        size      : CGSize(width: 30, height: 30))

Example

UILabel

label.font = UIFont.octiconsFont(size: 18)
label.text = String.character(for: .repo)

UIImageView

imageView.image = UIImage(octiconsID     : .rocket,
                          backgroundColor: UIColor.gray,
                          iconColor      : UIColor.black,
                          iconScale      : 0.8,
                          size           : CGSize(width: 30, height: 30))

Installation

Manual

Just copy the files in Source folder into your project. (Check your platform)

[Important] Setting up custom font

Check this instructions.

If you install OcticonsSwift with Carthage or CocoaPods check the number 4 of the article.

Contact

Any feedback and pull requests are welcome :)

Jason Nam
Website
Email

License

OcticonsSwift is available under the MIT license. See the LICENSE file for more info.