Skip to content

adamgolczak/GoogleMD-Icons

Repository files navigation

GoogleMD-Icons

CI Status Version License Platform

An easy way to use Google Material Design Icons in your app.

Requirements

  • iOS 9.0+
  • Xcode 8

Installation

CocoaPods

Make sure you have the latest version of CocoaPods by running:

$ gem install cocoapods

Update your local specs repo by running:

$ pod repo update

Add the following lines to your Podfile:

target 'YourProject' do
use_frameworks!
pod 'GoogleMD-Icons'
end

Then run the following command

$ pod install

You can start using the library by importing it wherever you want

import GoogleMD_Icons

Usage

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: "account_balance")!, 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: "account_balance")!, size: CGSize(width: 150.0, height: 150.0), color: .orange)

Author

Adam Golczak (adam@pxlborn.com)

License

GoogleMD-Icons is available under the MIT license. See the LICENSE file for more info.