I am applying a custom background to my navigation controller nav bars
[[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"navbar"] forBarPosition:UIBarPositionTop barMetrics:UIBarMetricsDefault];
iOS10
In iOS10 the background is applied correctly and the navbar appears beneath the status bar:
iOS11
In iOS11 however, it looks like the background image is always applied behind the status bar. I have tried different values for 'forBarPosition' but this does't change the behaviour.
I have isolated the issue in a standalone app with a single uinavigationcontroller and a single line of code as above. I am testing this using the iPhone 8 simulator. I am using the standard navigation controller and navigation bar class in my app.
What am I doing wrong?

