I wrote the following code and set a custom back button icon:
let navigationBar = UINavigationBar.appearance()
navigationBar.backIndicatorImage = image
navigationBar.backIndicatorTransitionMaskImage = image
It works, which is good.
But now in another controller, I want to reuse the system’s back button icon.
I have tried the following in the new controller:
backIndicatorImage
and backIndicatorTransitionMaskImage
to nil.navigationItem.backBarButtonItem = nil
But this doesn't work.
My application needs to support iOS 10, so I cannot use SF Symbol.
What should I do?
I found the answer to this problem, and still set backIndicatorImage
and backIndicatorTransitionMaskImage
to nil
.
But I used to set up on the current controller, the correct way should be set up on the upper controller.