I am building a todo list app to get more practice with tableViews and delegates. I have embedded my primary tableViewController in a Navigation Controller and I have created two additional view controllers, one for adding a task and one fore editing a task. When I attempt to add a bar button item to one of the additional view controllers (done, trash, etc), Xcode is placing the item in a tab bar along the bottom of the screen and when I run the app, those items are not visible. I have changed the type of device I am working on, relaunched Xcode entirely, and I cannot figure out why this is happening. I have added a screenshot below and here is a link to the repo. Any ideas why this is happening?
first you need to add Navigation Item in Navigation Bar. then add UIBarButton in Navigation Item.
Programatically you can add as:
let shareBarButtonItem = UIBarButtonItem(barButtonSystemItem: .action, target: self, action: #selector(self.shareClass))
let downloadBarButtonItem = UIBarButtonItem(image: UIImage(string: UIImage(named: "your_image_name")), style: .plain, target: self, action: #selector(self.downloadClass))
self.navigationItem.setRightBarButtonItems([shareBarButtonItem, downloadBarButtonItem], animated: true)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With