用于Swift和ObjC項目的Google Material Design圖標:GoogleMaterialIconFont

pcbbe 9年前發布 | 11K 次閱讀 iOS開發 移動開發 GoogleMaterialIconFont

用于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.baiduhome.net/lib/view/home/1443350128007

 本文由用戶 pcbbe 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!