Search code examples
iosobjective-cuinavigationbarxcode12.3

How to create a navigation bar in a view controller using xib programmatically in objective c?


can somebody please help me to solve this, I didn't post my code because im confused with some codes so I need a set of code to create a navigation bar and navigation items in a view controller without navigation controller...kindly help me


Solution

  • Hope this helps : https://stackoverflow.com/a/21449603/8013132

    To hide navigation bar:

    [[self navigationController] setNavigationBarHidden:YES animated:YES];
    

    To show it:

    [[self navigationController] setNavigationBarHidden:NO animated:YES];