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 9147587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T11:01:30+00:00 2026-06-17T11:01:30+00:00

I was trying to set a button so it appears on every view that

  • 0

I was trying to set a button so it appears on every view that has a navigation bar. Setting the appearance for all views is not a problem using the appearance proxy on the AppDelegate

[[UINavigationBar appearance] setTintColor:[UIColors grayColor]];

I was trying to subclass UINavigationController and then set that navigation controller on the storyboard. On the viewDidLoad method I’ve tried this:

self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"right"
                                                                         style:UIBarButtonItemStyleBordered target:self action:nil];

But the button is not showing up.

If I do this:

self.navigationBar.topItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"right"
                                                                         style:UIBarButtonItemStyleBordered target:self action:nil];

The button shows up but disappears once you go to the next screen.

I’m trying to do it so I don’t have to set up the right and left buttons on all viewDidLoad methods of each view controller. Is it possible to use a subclass of UINavigationController to set attributes of the navbar?

  • 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-17T11:01:31+00:00Added an answer on June 17, 2026 at 11:01 am

    Apple tells us not to subclass UINavigationController:

    This class is not intended for subclassing. Instead, you use instances of it as-is in situations where you want your application’s user interface to reflect the hierarchical nature of your content.

    That’s from the XCode version of the docs. The online version loosens up a bit, replacing that advice with:

    This class is generally used as-is but may be subclassed in iOS 6 and later.

    How about creating a custom subclass of UIViewController with a modified viewDidLoad and base all of your custom VC’s on that?

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

Sidebar

Related Questions

I'm essentially trying to set it up so that when I click a button
I'm trying to set window.onbeforeunload to null for every asp Button as they are
I am trying to set up an add-tab button in a Gtk::Notebook (gtkmm). I
I am trying to set textColor property of button in android 2.1. But I
I am trying to set a common listener for an Customized button and Bitmap
I am trying to set the click event of a button on my form
I trying to set separate style for particular widgets, like for one button with
I'm trying to place a button. I have its position set to absolute, so
1st Question: I'm trying to make the create method work, but it appears that
I am training myself with an application that has a navigation controller, and the

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.