Reputation: 852
I am theaming the navigation bar back button with the navigation bar tint color it works when I use native colors and it fails when I use custom color from an image.
working code :
self.navigationController?.navigationBar.tintColor = UIColor.orange
Not working code:
let color = UIColor.init(patternImage: someImage)
self.navigationController?.navigationBar.tintColor = color
Can someone show some light?
Upvotes: 0
Views: 269
Reputation: 21
You cannot use pattern color for tint color.
Refer the following link: https://developer.apple.com/documentation/uikit/uiview/1622467-tintcolor
Important
If you attempt to use a pattern color as a tint color, the system raises an exception.
Upvotes: 2
Reputation: 268
If you have a image then please set image in navigationbar as a background image. Like :
self.navigationController?.navigationBar.setBackgroundImage(#imageLiteral(resourceName: "NavigationBackground"), for: .default)
Hope this is helpful.
Upvotes: 0