# How to remove border in navigationBar in swift?

To remove the border from a navigation bar in swift, we just need to add a few lines of code. Let’s see how the navigation bar looks when we run it without changing anything.

Now let’s try to hide the line/ border shown in the above result.

The navigation bar has two things that give it the default view of a grey shadow along with bottom line as shown above. One is the background image, and the other is the shadow image.

First, we’ll hide the shadow image, by setting it to empty image and see how it looks.

self.navigationController?.navigationBar.shadowImage = UIImage()