I have set the UINavigation bar appearance which looks like follwing,
Code:
fileprivate class func barButtonAppearance() {
var attributes = [String : AnyObject]()
attributes[NSFontAttributeName] = UIFont(name: .Regular, size: 14)
attributes[NSForegroundColorAttributeName] = UIColor.descriptionColor()
UIBarButtonItem.appearance().setTitleTextAttributes(attributes, for: UIControlState())
let backImage = UIImage.image(assetID: .NavigationBarBack, caps: UIEdgeInsetsMake(0, 23, 0, 0)).withRenderingMode(.alwaysTemplate)
UIBarButtonItem.appearance().setBackButtonBackgroundImage(backImage, for: .normal, barMetrics: .default)
UINavigationBar.appearance().backIndicatorTransitionMaskImage = backImage
}
It was working fine until we tested our application in iOS 11.
If I comment the below code
let backImage = UIImage.image(assetID: .NavigationBarBack, caps: UIEdgeInsetsMake(0, 23, 0, 0)).withRenderingMode(.alwaysTemplate)
UIBarButtonItem.appearance().setBackButtonBackgroundImage(backImage, for: .normal, barMetrics: .default)
It works fine but with the default apple given back button.
Here is the screen shot of the navigation bar appearing,
I was not able to get what was happening. Could someone please suggest me the workaround? Thanks.