I am trying to use
As @EricAya pointed I was following the wrong steps. I saw that there were steps to use
Material icons for iOS but as it says in the documentation:
Material icons also work well within iOS apps. In both the material icons library and git repository, these icons are packaged up in Xcode imagesets which will work easily with Xcode Asset Catalogs (xcassets).
I guessed that it could also be installed with git repository but I could not get it. Finally I used the following steps:
Go to the official webpage of
Material icons and click on the icon that you would like to use.
You will see on the right corner of the webpage two options to download the icon (SVG or PNG). I have chosen PNG.
Unzip the .zip package.
ios folder and drag the
.imageset folder to your
.xcassets file in your project of Xcode.
You can create both an
button to set it and use the following code to create the image:
To set it to your UIImageView you can use
yourImage.image and for your button
Do not forget to change the
tint property of your
button. I spent some hours thinking that it was not working and the problem was that the tint property was white (sometimes simpler things make waste your time easily).