[ad_1]
I comply with a video from youtube. And that i bumped into an issue when ı attempt to set Navigation Controller gadgets.
func setupNavigationBarItems() {
let twitterImage = UIImageView(picture: UIImage(named: "twitter_icon"))
twitterImage.body = CGRect(x: 0, y: 0, width: 20, top: 20)
twitterImage.contentMode = .scaleAspectFit
navigationController?.navigationItem.titleView = twitterImage
let profileButton = UIButton(sort: .system)
profileButton.setImage(UIImage(named: "profile_image"), for: .regular)
profileButton.body = CGRect(x: 0, y: 0, width: 20, top: 20)
navigationController?.navigationItem.leftBarButtonItem = UIBarButtonItem(customView: profileButton)
}
That is the consequence. Nothing present up
Edit–
I made similar adjustments
navigationController?.navigationItem.leftBarButtonItem = UIBarButtonItem(customView: profileButton)
—
navigationItem.leftBarButtonItem = UIBarButtonItem(customView: profileButton)
it simply exhibits the profileButton and button stretches throughout to the perimeters
[ad_2]
