swift - Bar button item not working -


i have read other posts here , trying things say, still not working me, need add right bar button item, have tried in code (doesn't work me) , found might me but, don't know in interface of xcode, here image found: image can tell me how make work please?

here storyboard @ left (the color changes) , simulator @ right, , can see in storyboard shows barbuttonitem when run it doesn't shows. myproject

it seems not following correct steps add right bar button. can done through storyboard , doesn't requires modify property of navigation bar. looking on images of storyboard , simulator shared shows inconsistency, more clear if can elaborate on steps followed add right bar button item, how adding navigation bar , how connecting view controller presenting view controller.

the usual steps follow :

  1. there should navigation controller attached root view controller.
  2. if need show uibarbuttonitem on root view controller can simple drag right position.
  3. if need show on other view controller pushed, there 2 scenarios:
    • the presented view controller connected directly presenting view controller through segue inheriting navigation bar presenting view controller. in scenario have follow same procedure in step 2.
    • the presented view controller not connected directly presenting view controller , pushing through code. in case have add navigation item first , have place right bar button on it.

i hope work :)


Comments