Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<<<<<<< HEAD
if let titleView: UIView = titleViewFromNavBarImagePath(navBarImagePath: navBarImagePath) {
titleView.contentMode = .scaleAspectFit
let container = UIView(frame: CGRect(x: 0, y: 0, width: 32, height: 32))
titleView.frame = CGRect(x: 0, y: 0, width: 32, height: 32)
container.addSubview(titleView)
self.navigationItem.titleView = container
}
else {
self.navigationItem.titleView = nil
}
=======
let titleView: UIView? = titleViewFromNavBarImagePath(navBarImagePath: navBarImagePath)
titleView?.frame = CGRect(x: 0, y: 0, width: 32, height: 32)
if let titleView = titleView {
NSLayoutConstraint.activate([
titleView.widthAnchor.constraint(equalToConstant: 32.0),
titleView.heightAnchor.constraint(equalToConstant: 32.0)
])
}
titleView?.contentMode = .scaleAspectFit
titleView?.autoresizingMask = navigationItem.titleView?.autoresizingMask ?? [.flexibleWidth, .flexibleHeight]
self.navigationItem.titleView = titleView
>>>>>>> develop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.