I am getting issue with iPhoneX back button image. It is not in right position as you can see in the screenshot
I am using below code for setting back image
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
UINavigationBar.appearance().backIndicatorImage = #imageLiteral(resourceName: "btn-back")
UINavigationBar.appearance().backIndicatorTransitionMaskImage = #imageLiteral(resourceName: "btn-back")
UIBarButtonItem.appearance().setBackButtonTitlePositionAdjustment(UIOffsetMake(0, -80.0), for: .default)
return true
}
}
Can anyone please explain why it's not at correct position and how to fix this ?