用于Swift和ObjC项目的Google Material Design图标:GoogleMaterialIconFont

pcbbe 9年前

用于Swift和ObjC项目的Google Material Design图标

灵感源于 FontAwesome.swift
支持Swift 和Objctive-C
See example project or Material icons more detail

Usage

Swift

importGoogleMaterialIconFont

label.text = String.materialIcon(.Favorite)  label.font = UIFont.materialIconOfSize(32)

Objective-C

import#import <GoogleMaterialIconFont/GoogleMaterialIconFont-Swift.h>

label.text = [NSString materialIcon:MaterialIconFontFavoriteBorder];  label.font = [UIFont materialIconOfSize:32];

Requirements

iOS8 or later
Swift 1.2 or later
Xcode 6.3 or later

for iOS7 support
Follow Manual usage instruction

Installation

CocoaPods

GoogleMaterialIconFont is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "GoogleMaterialIconFont"

Then, runpod install

In case you haven't installed CocoaPods yet, run the following command

$ gem install cocoapods

Carthage

GoogleMaterialIconFont is available through Carthage.

To install GoogleMaterialIconFont into your Xcode project using Carthage, specify it in your Cartfile:

github "kitasuke/GoogleMaterialIconFont"Then, run carthage update

You can seeCarthage/Build/iOS/GoogleMaterialIconFont.frameworknow, so drag and drop it toEmbedded BinariesinGeneralmenu tab with your project.

In case you haven't installed Carthage yet, run the following command

$ brew update  $ brew install carthage

Manual

Copy all the files inPoddirectory into your project. Make sure thatGoogleMaterialIconFont.ttfis specified intoFonts provided by applicationin your project'sinfo.plist

项目主页:http://www.open-open.com/lib/view/home/1443350128007