Latest 0.1.2
Homepage https://github.com/jasonnam/OcticonsSwift
License MIT
Platforms ios 8.0, osx 10.10, watchos 2.0, tvos 9.0, requires ARC
Authors

Platform
Swift 3.0
Carthage compatible
Version

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

Carthage

github "jasonnam/OcticonsSwift"

CocoaPods

use_frameworks!
pod 'OcticonsSwift'
import OcticonsSwift

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.

Latest podspec

{
    "name": "OcticonsSwift",
    "version": "0.1.2",
    "summary": "Octicons Swift wrapper",
    "description": "Octicons Swift wrapper.nUse octicons for String, UIImage/NSImage.",
    "homepage": "https://github.com/jasonnam/OcticonsSwift",
    "authors": {
        "Jason Nam": "[email protected]"
    },
    "social_media_url": "http://jasonnam.com",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "platforms": {
        "ios": "8.0",
        "osx": "10.10",
        "watchos": "2.0",
        "tvos": "9.0"
    },
    "source": {
        "git": "https://github.com/jasonnam/OcticonsSwift.git",
        "commit": "7394055abca403b071db40013477889d74ef90ab",
        "tag": "0.1.2"
    },
    "ios": {
        "source_files": [
            "Source/UIImage+Octicons.swift",
            "Source/String+Octicons.swift",
            "Source/UIFont+Octicons.swift"
        ]
    },
    "osx": {
        "source_files": [
            "Source/NSImage+Octicons.swift",
            "Source/String+Octicons.swift",
            "Source/NSFont+Octicons.swift"
        ]
    },
    "watchos": {
        "source_files": [
            "Source/UIImage+Octicons.swift",
            "Source/String+Octicons.swift",
            "Source/UIFont+Octicons.swift"
        ]
    },
    "tvos": {
        "source_files": [
            "Source/UIImage+Octicons.swift",
            "Source/String+Octicons.swift",
            "Source/UIFont+Octicons.swift"
        ]
    },
    "resources": "octicons.ttf",
    "requires_arc": true
}

Pin It on Pinterest

Share This