Seeing a behavior on iOS11 with a navigationItem.titleView where the width of the titleView is not the full width of the screen.
I have a custom view that I set as t
This class will do the trick. Make sure you set your custom view's class to this one:
import UIKit
class TitleView: UIView {
override init(frame: CGRect) {
super.init(frame: frame)
translatesAutoresizingMaskIntoConstraints = false
}
required init?(coder: NSCoder) {
super.init(coder: coder)
translatesAutoresizingMaskIntoConstraints = false
}
override var intrinsicContentSize: CGSize {
CGSize(width: UIView.layoutFittingExpandedSize.width, height: self.bounds.height)
}
}