Skip to content

Instantly share code, notes, and snippets.

@christ776
Created April 25, 2016 20:44
Show Gist options
  • Save christ776/a27aa271946215a17bde187d852abd86 to your computer and use it in GitHub Desktop.
Save christ776/a27aa271946215a17bde187d852abd86 to your computer and use it in GitHub Desktop.
protocol NavigationBarTitleViewMixin {
func showAppLogoInTitleView()
}
extension NavigationBarTitleViewMixin where Self:UIViewController {
func showAppLogoInTitleView() {
let logoView = UIImageView(image: UIImage(named:"navbar_brand"))
self.navigationController!.navigationBar.setTitleVerticalPositionAdjustment(-6.0, forBarMetrics: .Default)
self.navigationItem.titleView = logoView
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment