iosobjective-ccydia

Changing navigation bar buttons


Hi I am making an app in Xcode 7 in Objective-C. You know how in Cydia, when a user interacts with a web element in the webView, the navigation bar buttons change accordingly. I have included photos below. How might I be able to do this?

About Button Gives an AlertController

About Button Gives an AlertController

When "Featured" is selected, the About button changes to a back home button

When "Featured" is selected, the About button changes to a back home button



Solution

  • What you are looking for is very basic iOS stuff. Go through this Apple Documentation for detailed information.

    In essence, you need to create a navigation bar based application with two view controllers. From, first view controller, calling below two lines on any user action (tap on cell or button), would present second view controller on screen with Back button shown automatically by iOS.

    MySecondViewController *viewController = [[MySecondViewController alloc] init];
    [self.navigationController pushViewController:viewController animated:YES];
    

    This is just a glimps of how it works. You need to go through documentation to get more knowledge. Using Storyboard is another option. Explore!