Override navigation bar Back button method
Func configbackbtn (), Void {
Back button
Let Backbutton = UIButton (type:. Custom)
Set back arrow picture for button
Backbutton.setimage (UIImage (named: "Navigationbar_goback_icon"), for:. Normal)
Set frame
Backbutton.frame = CGRect (x:200, Y:13, width:18, height:18)
Backbutton.addtarget (Self, Action: #selector (back), for:. Touchupinside)
Customize the navigation bar of the Uibarbuttonitem type button
Let Backview = Uibarbuttonitem (Customview:backbutton)
Important method to adjust the distance from the left of the view distance to the custom return
Let Barbuttonitem = Uibarbuttonitem (barbuttonsystemitem:. Fixedspace, Target:nil, Action:nil)
Barbuttonitem.width =-5
Return button settings succeeded
Navigationitem.leftbarbuttonitems = [Barbuttonitem, Backview]
}
Swift-Override navigation bar Back button