I am new to rapid iOS development and am facing a problem. I want to set a transparent navigation bar and make an image of the underlying transparent navigation bar and status bar, as shown below,

But after I executed the following code,
self.navigationController!.navigationBar.setBackgroundImage(UIImage(), forBarMetrics: .Default) self.navigationController!.navigationBar.shadowImage = UIImage() self.navigationController!.navigationBar.translucent = true
As a result, the image is still below the navigation bar and the status bar, even if I set the navigation bar to transparent.

source share