Add Button items to the Navigation Bar iOS swift. || Bar button item iOS swift
Solution:
In navigationBar you can add buttons at right side and also in left side.
The below are the code for adding the bar button items.
In navigationBar you can add buttons at right side and also in left side.
The below are the code for adding the bar button items.
var addBtn:UIBarButtonItem!
In didload add the below code
addBtn = UIBarButtonItem(image:ic_mode_edit_white, style: .plain, target: self, action: #selector(ViewController.didTapOnSave(_:)))
self.navigationItem.rightBarButtonItems = [addBtn]
Run the app and enjoy with cheers...
Comments
Post a Comment