this question has answer here:
i want add action standard back-button, won't work found below link:
add-target-to-stock-back-button-in-navigationbar
so created custom button action.
uibarbuttonitem(title: "❮ back", style: .bordered, target: self, action: "back:")
but how can set standard left wing title?
the character '❮' way smaller standard button. use standard button throughout app, , want keep optic.
if want "add" functionality button can use uinavigationcontrollerdelegate
.
when press button, navigation controller call navigationcontroller(willshowviewcontroller:)
can use whatever want do. example shown below:
using uinavigationcontrollerdelegate:
class viewcontroller: uiviewcontroller, uinavigationcontrollerdelegate { override func viewdidload() { super.viewdidload() navigationcontroller?.delegate = self } func navigationcontroller(navigationcontroller: uinavigationcontroller, willshowviewcontroller viewcontroller: uiviewcontroller, animated: bool) { // add whatever want here } }
Comments
Post a Comment