Muhammad Umar
Muhammad Umar

Reputation: 11782

making a custom back button in iphone

I am new to iphone so I have a very simple question. I am using a storyboard in xcode 4.2. I have multiple screens with about buttion in each viewController.

Now I have created segues ofc. Each about button i have linked with about viewController. However I am not using a navigation controller.

I have custom made a back button. How can i go back to the screen which brought me on the about section.

Best Regards

Upvotes: 0

Views: 181

Answers (2)

Ashwin Kumar
Ashwin Kumar

Reputation: 622

As you are not using navigation controller, u need to manually do the pushing and popping viewcontroller. When u change the viewcontroller, store previous viewcontroller reference in the new viewcontroller and when back button is pressed goto the previously stored viewcontroller.

Upvotes: 1

Mick MacCallum
Mick MacCallum

Reputation: 130193

If you are modally presenting the new view controllers they can be dismissed using the following.

-(IBAction)myCloseAction:(id)sender{
    [self dismissViewControllerAnimated:YES completion:nil];
}

Upvotes: 1

Related Questions