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

  • Home
  • SEARCH
  • 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 6818337
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:09:58+00:00 2026-05-26T21:09:58+00:00

There are many questions about overriding navigation controller’s back button action, but everybody tells

  • 0

There are many questions about overriding navigation controller’s back button action, but everybody tells that there is no direct way to do this. I’ve implemented this by inheriting UINavigationController and overriding UINavigationBarDelegate method. But the problem is that interface of UINavigationController doesn’t implement UINavigationBarDelegate protocol (but it implements this method, because this code works:), and I afraid that app will be rejected by Apple, considering that here is used undocumented API.

So, the question is: how do you think, is it private API usage or not? Here is the code:

@interface CustomNavigationController : UINavigationController <UINavigationBarDelegate>

@end

@implementation CustomNavigationController

- (BOOL)navigationBar:(UINavigationBar *)navigationBar shouldPopItem:(UINavigationItem *)item {
    BOOL shouldPop = [[self topViewController] enableBackButton]; // every view controller overrides this method to disable or enable pop of view controller
    if (shouldPop) {
        //here is the warning about "UINavigationController may not respond to selector"
        return [super navigationBar:navigationBar shouldPopItem:item];
    } else {
        return NO;
    }
}

@end
  • 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-05-26T21:09:58+00:00Added an answer on May 26, 2026 at 9:09 pm

    Apple’s documentation on UINavigationController: This class is not intended for subclassing.

    While this intention is not a ban and may not technically get you rejected (using doesn’t appear to reference any private APIs) it should impact your design decision. You’re likely to inherit unexpected behavior now or potentially in the future (if something changes to the internals of the superclass). Navigation controller’s are handy things, but depending on what you need, you might just be better off rolling your own.

    One alternative might be to employ a standard navigation controller, but set it’s navigationBar property to hidden. You may then design and include your own navigation bar in a XIB with whatever buttons targeted at whatever actions you wish (e.g., a back button simply calling popViewController).

    EDIT: Subclassing of UINavigationController is no longer discouraged.

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

Sidebar

Related Questions

I know there are many questions about jQuery + Back button issues, but it
NOTE: I know there are many questions that talked about that but I'm still
I understand that there are many existing questions about Django template images, but I
I know that there are many different questions about this sort of topic on
There seem to be many questions asked about this subject here on stackoverflow, but
There are many similar questions, but apparently no perfect match, that's why I'm asking.
I know there are many questions about jQuery slideToggle flickering but I haven't seen
there are many related questions/answers about that in SO. I took a look to
There are many questions on here about caching that doesn't work properly, or asking
Im aware there are many questions on SO about notifications, but I havent come

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.