I have an iOS app in which I customize the appearance of the navigation header.
It worked fine until iOS 10, but in iOS 11 the appearance of the navigation header is inappropriate.
Here is a screenshot for iOS 10 -

Here is a screenshot for iOS 11 -

As you can see in the screenshots, when you run the code on iOS 10, the header looks normal. But the same code on iOS 11 shifts the header view by some pixels and is cropped.
This is how I set the title view -
navigationItem.titleView = MY_CUSTOM_TITLE_VIEW
I tried many things and looked for many solutions, but nothing works.
source share