It works with
import UIKit class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup a
There's a much better option available these days:
UINavigationBar.appearance().shadowImage = UIImage()