Skip to content

Instantly share code, notes, and snippets.

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