Created
April 25, 2016 20:44
-
-
Save christ776/a27aa271946215a17bde187d852abd86 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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