Created
May 28, 2017 18:06
-
-
Save FezHacker/6b12f22919d72e9c17f27abd07745f05 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
override func viewDidLoad() { | |
// assign bar button, to left bar item | |
let profileLeft = UIBarButtonItem(image: #imageLiteral(resourceName: "user-icon"), style: .plain, target: nil, action: #selector(HomeViewController.toProfile(_:))) | |
self.navigationItem.leftBarButtonItem = profileLeft | |
} | |
func toProfile(_ sender: UIButton) { | |
// set root to UserProfileViewController | |
let controller = UserProfileViewController() | |
let userProfileViewController = UINavigationController(rootViewController: controller) | |
self.window.rootViewController = userProfileViewController | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment