Set custom images to the UIBarButtonItem but it doesn’t show any image

Thats because UIBarButtonItem image’s default rendering mode always draw the image as a template image, ignoring its color information (UIImageRenderingModeAlwaysTemplate). Just create your image using UIImage’s method imageWithRenderingMode always original.

UIImage(named: "yourImageName")!.withRenderingMode(.alwaysOriginal)

Leave a Comment