In the initializer of your View you can set the appearance of your navigation bar. There you have to set the .shadowColor
property to .clear
.
init() {
let appearance = UINavigationBarAppearance()
appearance.shadowColor = .clear
UINavigationBar.appearance().standardAppearance = appearance
UINavigationBar.appearance().scrollEdgeAppearance = appearance
}