In my app, I have a custom icon for going back to previous ViewController
.
It was working perfectly, but with iOS 13, the icon is misplaced.
The fun fact is that I still have to click on the left (where the back icon used to be, and in other words, on the blank space) to go back to previous ViewController
.
Do you have any idea why?
Here is the code I use to customize the back button.
var back = UIImage(named: "backButton")
back = back?.withAlignmentRectInsets(UIEdgeInsetsMake(0, -50, 0, 50))
self.navigationController?.navigationBar.backIndicatorImage = back?.withAlignmentRectInsets(UIEdgeInsetsMake(0, -50, 0, 50))
self.navigationController?.navigationBar.backIndicatorTransitionMaskImage = back?.withAlignmentRectInsets(UIEdgeInsetsMake(0, -50, 0, 50))
self.navigationController?.navigationBar.backItem?.backBarButtonItem = UIBarButtonItem(title: " ", style: UIBarButtonItemStyle.plain, target: nil, action: nil)
self.navigationController?.navigationBar.tintColor = .black
And this is a screenshot of the back icon, not on the left anymore: