Skip to content

Instantly share code, notes, and snippets.

@armstrongnate
Last active September 22, 2017 16:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save armstrongnate/f7b34308d243ed09434adb122b5d1575 to your computer and use it in GitHub Desktop.
Save armstrongnate/f7b34308d243ed09434adb122b5d1575 to your computer and use it in GitHub Desktop.
<<<<<<< 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