I can add some padding to my rightbarbuttonitem(eye icon) with the following codes but the result is slightly different on other devices. You can see in the image.
let add = UIBarButtonItem(image: #imageLiteral(resourceName: "open"), style: .plain, target: self, action: #selector(closeChords))
add.tintColor = UIColor.black
add.imageInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: -8)
self.navigationItem.rightBarButtonItem = add