I\'m using an image view to display an image in my nav bar. The problem is that I can\'t set it to the center correctly because of the back button. I checked the related que
Qun Li's worked perfectly for me. Here's the swift 2.3 code:
override var frame: CGRect { set(newValue) { super.frame = newValue if let superview = self.superview { self.center = CGPoint(x: superview.center.x, y: self.center.y) } } get { return super.frame } }