I have tried to using custom image to create IconButton.
It seems to produce ugly button.


The red one is what it should be.
The blue on is creating by using IconButton
The image size should not be important. You can update your icon button's image view to adapt to the button's size:
iconBtn.imageView?.contentMode = .ScaleAspectFit

Thanks man
But I think my image is too large so, I need to resize the image for using IconButton
that would be wise.
Resizing image isn't a nice idea because my project has more than a hundred images.
If creating IconButton programmatically ,it seem to be a perfect size.
If creating from Interface builder, The size will be wrong.
![]()
After
contentMode = .ScaleAspectFit

dear @aemgtz, from what I see, your button's insets are meddling with the size of your icons. You can change the content inset and the contentMode (.ScaleAspectFill for example) to see if you can improve the situation.
@aemgtz well essentially all icons passed to IconButton are custom. The button has no idea where the image comes from. As for the sizing, we use 24, 48, 72 for @1x, @2x, and @3x.
I am going to close this issue for now. I posted the sizes we use for buttons, and that should get you in the right direction. If you need any further help, please reopen or visit the Gitter channel. All the best!
Most helpful comment
The image size should not be important. You can update your icon button's image view to adapt to the button's size: