GoogleMD-Icons
在您的应用程序中使用 Google Material Design 图标的简单方法。
要求
- iOS 9.0+
- Xcode 8
安装
CocoaPods
确保您已经安装了最新版本的 CocoaPods,运行以下命令
$ gem install cocoapods
通过运行以下命令更新您本地的 specs 仓库
$ pod repo update
将以下行添加到您的 Podfile
target 'YourProject' do
use_frameworks!
pod 'GoogleMD-Icons'
end
然后运行以下命令
$ pod install
您可以通过在任何地方导入它来开始使用这个库
import GoogleMD_Icons
用法
UIImage
import GoogleMD_Icons
// Set icon
imageView.image = UIImage.googleMDIcon(icon: .accountBalance, size: CGSize(width: 150.0, height: 150.0))
// Set icon with color
imageView.image = UIImage.googleMDIcon(icon: .accountBalance, size: CGSize(width: 150.0, height: 150.0), color: .orange)
// Set icon with color and icon code
imageView.image = UIImage.googleMDIcon(icon: GoogleMDIconType(name: "accountBalance")!, size: CGSize(width: 150.0, height: 150.0), color: .orange)
UIImageView
import GoogleMD_Icons
// Set icon
imageView = UIImageView.googleMDIcon(icon: .accountBalance, size: CGSize(width: 150.0, height: 150.0))
// Set icon with color
imageView = UIImageView.googleMDIcon(icon: .accountBalance, size: CGSize(width: 150.0, height: 150.0), color: .orange)
// Set icon with color and icon code
imageView = UIImageView.googleMDIcon(icon: GoogleMDIconType(name: "accountBalance")!, size: CGSize(width: 150.0, height: 150.0), color: .orange)
作者
Adam Golczak ([email protected])
许可证
GoogleMD-Icons 采用 MIT 许可证。更多信息请参阅 LICENSE 文件。