I have attached a UIImageView
to my Navigation bar title view, however the image exceeds the frame no matter which values I input.
Here is the code:
override func viewDidLayoutSubviews() {
// style the navbar
let iconView = UIImageView(frame: CGRect(x: 0, y: 0, width: 100, height: 30))
let image = UIImage(named: "fresh-appbar")!
iconView.contentMode = .scaleAspectFit
iconView.image = image
navigationItem.titleView = iconView
}
I have also attached an image: