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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:35:19+00:00 2026-05-23T01:35:19+00:00

Is it possible to call a method when a tab bar icon is touched,

  • 0

Is it possible to call a method when a tab bar icon is touched, even if its already the selected icon? I want to make it remove a sub view when touched if the subview is showing.

I’m sure there must be a way to do this because I see it in other apps, but I cannot find any documentation on it.

  • 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-23T01:35:20+00:00Added an answer on May 23, 2026 at 1:35 am

    From Apple Documentation for UITabBarDelegate :

    - (void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item

    Sent to the delegate when the user selects a tab bar item. (required)

    • As you noticed I think, and as stated by Apple docs, this message is sent only when a tab is selected

    • An important note, there is already a (not-documented?) default UIKit behavior of tapping a selected tab bar button :

      If the tab contains a UINavigationViewController it will send to it a popToRootViewControllerAnimated: message. You can check this on any iOS application.

    So beware before overriding this default (and user expected) behavior, which is, generally, a bad idea.
    Apple has probably hidden what you want to do in its UIKit API, on purpose.

    But if you want anyway does this, here are some ideas:

    • Small, but not easy hack: Once the tabBar has been displayed, recursively browse its .subviews tree to find (I expect, to be confirmed) UIButtons inherited classes (=private UITabBarButtons or something like) to add your target/selector pairs on TouchUp event (you might have to remove default behavior first, which might be tricky)
    • Worst solution, but might be the only one: Do not use UITabBar, but a custom class. I’m pretty sure there are ready-to-use open source components that mimics UITabBar, but sorry, I never used/searched one.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to call method after n minutes even if application will go
Does Python have extension methods like C#? Is it possible to call a method
How is it possible to call a client side javascript method after a specific
is it possible to call a dynamic method in javascript. ie suppose i have
I'd like to know if it's possible to call a method on a WCF
Is it possible to call a method passing a lambda with variable number of
Is it possible to call a method on the type you pass into your
Is it possible to call a method that is an attribute? I mean, I
Is it possible to call a method on a returned object using the pipeline
is it possible to call a method of a plugin from within TypoScript? I

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.