Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7905943
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T10:41:42+00:00 2026-06-03T10:41:42+00:00

I want to have a method called when the user clicks the back button

  • 0

I want to have a method called when the user clicks the back button in a navigation bar.

I know its possible to create my own back button with an action attached and use that in the navigation bar. But I don’t want to do this – I don’t have the artwork for such a button (and I tried using Apple’s own navigation button that I got after somebody posted online an unpacking of an iPhone’s artwork, but it doesn’t look right, and even if it does then it won’t match if I change the color of the navigation bar).

I also know its possible to look at the list of controllers in the stack in viewWillDisappear: but I’m navigating within a UIWebView where this won’t apply when nested pages are involved (actually what I’m trying to do is call [self.webView.goBack] in this situation instead of the UIWebView be popped off the stack).

So is there anyway for me to get a method to be called when the user clicks the navigation bar default back button?

TIA

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T10:41:43+00:00Added an answer on June 3, 2026 at 10:41 am

    Short answer no. The back button is private section of UINavigationBar.

    It is possible that by subclassing UINavigationBar you may be able to access it but I doubt it.

    Its important to note that even when you replace the leftBarButtonItem it is never a “back” button at that point but rather just another button that could possible send the user to a previous page.

    If you want a “back” button that does your own method you need to go through the effort of making it the way everyone else does using custom graphics. It can be made to match the original back button you just have to put in the work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a method that where I want to redirect the user back to
I have a method where I want to factor out some code into its
I want to close my UISearchDisplayController when the user clicks the Search button since
I have a view that is presented when a user clicks on a button
I have a method used to save an image when the user clicks Save.
I have a method song_link that calls link_to internally. I want the caller to
Say I want to have a method that takes any kind of number, is
I want to have a standard method of formatting Show More links in my
I want to have the following method not show a warning about using raw
What would I do if I want to have a generic method that only

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.