An easy way to use Google Material Design Icons in your app.
- iOS 9.0+
- Xcode 8
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
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)
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)
Adam Golczak (adam@pxlborn.com)
GoogleMD-Icons is available under the MIT license. See the LICENSE file for more info.