Set navigationController left and right button in swift

Set left button in Navigation controller

func setLeftButtonNavigation() {
        self.navigationController?.navigationBar.isHidden = false
        let btnMenu = UIButton(type: .custom)
        let img: UIImage = UIImage(named: "ic_menu")!
        btnMenu.setImage(img, for: .normal)
        btnMenu.frame = CGRect(x: 0, y: 0, width: 30, height: 30)
        btnMenu.showsTouchWhenHighlighted = true
        btnMenu.addTarget(self, action: #selector(self.btnmenu_Click), for: .touchUpInside)
        let leftBarButtonItems = UIView(frame: CGRect(x: 0, y: 0, width: 30, height: 30))
        leftBarButtonItems.addSubview(btnMenu)
        navigationItem.leftBarButtonItem = UIBarButtonItem(customView: leftBarButtonItems)
}

Set right button in Navigation controller

func setRightButtonNavigation() {
        let btnBell = UIButton(type: .custom)
        btnBell.setImage(UIImage(named: "ic_bell"), for: .normal)
        btnBell.frame = CGRect(x: 0, y: 0, width: 25, height: 25)
        btnBell.showsTouchWhenHighlighted = true
        btnBell.addTarget(self, action: #selector(self.btnbell_Click), for: .touchUpInside) 
        let rightBarButtonItems = UIView(frame: CGRect(x: 0, y: 0, width: 30, height: 30))
        rightBarButtonItems.addSubview(btnBell)
        navigationItem.rightBarButtonItem = UIBarButtonItem(customView: rightBarButtonItems)
}