• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Vaberer/Google-Material-Design-Icons-Swift: Google Material Design Icons Library ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

Vaberer/Google-Material-Design-Icons-Swift

开源软件地址(OpenSource Url):

https://github.com/Vaberer/Google-Material-Design-Icons-Swift

开源编程语言(OpenSource Language):

Swift 98.2%

开源软件介绍(OpenSource Introduction):

Google Material Design Icons Swift

Font Awesome Swift

Follow me: @vaberer

I like ★. Do not forget to ★ this super convenient library.

#There is also a very popular Font Awesome library which you will love!

Google Material Design Icons Swift library for iOS. No image icons any more. Using Google Material Design Icons Swift library is very easy to use. Look at the demo app which shows all icons and their names or just visit Google Design Material Icons.

Requirements

  • iOS 8.0+
  • Xcode 7

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects.

CocoaPods 0.36 adds supports for Swift and embedded frameworks. You can install it with the following command:

$ gem install cocoapods

To integrate Google Material Design Icons Swifr into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!

pod 'Google-Material-Design-Icons-Swift', '~> 1.0.1'

Then, run the following command:

$ pod install

Do not forget to import to your swift files where you want to use this library:

import Google_Material_Design_Icons_Swift

To use Font Awesome in Swift 1.2:

pod 'Google-Material-Design-Icons-Swift', :git => 'https://github.com/Vaberer/Google-Material-Design-Icons-Swift.git', :branch => 'swift1.2'

Manually

  1. Copy GMDIcon.swift and GMDIcons.ttf files into your project
  2. Check to import GMDIcons.ttf in project, "Project" > "Target" > "Copy Bundle Resources"

Usage

Super easy way how to add an icon.

UILabel

    labelName.GMDIcon = GMDType.GMDPublic
    
    //or if you want to set an icon size, use:
    labelName.setGMDIcon(GMDType.GMDPublic, iconSize: 30)
    
    labelName.textColor = UIColor.redColor()

UIButton

    buttonName.setGMDIcon(GMDType.GMDPublic, forState: .Normal)
    
    //or if you want to set an icon size, use:
    buttonName.setGMDIcon(GMDType.GMDPublic, iconSize: 35, forState: .Normal)
    
    buttonName.setTitleColor(UIColor.redColor(), forState: .Normal)

UIBarButtonItem

    //Standard font size
    barName.GMDIcon = GMDType.GMDPublic
  
    //Custom font size
    barName.setGMDIcon(GMDType.GMDPublic, iconSize: 35)
    
    barName.tintColor = UIColor.redColor()

Author

Patrik Vaberer, [email protected]

Licence

Google Material Design Icons Swift is available under the MIT license. See the LICENSE file for more info.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap