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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:02:10+00:00 2026-06-13T06:02:10+00:00

Suppose an application for iOS displays an element that, when clicked, invokes a menu

  • 0

Suppose an application for iOS displays an element that, when clicked, invokes a menu of actions for that element (say an UIActionSheet for example). The catch is, many clickable element such as this one may be present in every view in the application, so the action menu and its delegates must also be handled in any situation.

For example, the clickable element may be a photo of some product (UIButton with image background), that may appear in many different screens, and when clicked the user is presented with options such as “Buy”, “See details”, and so on.

How would you go about designing/implementing this kind of component with the associated behaviors, in a modular and reusable way?

It’s important to keep the feature in a self-contained set of classes that can easily be tested separately and turned on/off when needed, and also not needing to insert code to every controller where the feature may be used.

Thanks!

  • 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-13T06:02:11+00:00Added an answer on June 13, 2026 at 6:02 am

    How about creating a singleton class that represents the feature you want? You can then just call the singleton object every time.

    @interface MyClickableButtonWithImage : NSObject {
        UIButton *aButton;
    }
    +(MyClickableButtonWithImage)getInstance;
    -(IBAction)buttonClicked:(id)sender;
    @property (nonatomic, strong) IBOutlet UIButton *aButton;
    
    @end
    
    // In your .m files, this will get the singleton object
    MyClickableButtonWithImage *myCBWI = [MyClickableButtonWithImage getInstance];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating an iOS application that is suppose to get the list of
Suppose I develop an application with the logic as a CLI program that can
Suppose I have a GUI-only application that runs on Windows and I'd like to
I have an application that supports iOS 2.x. I am about to revamp this
Suppose an application with some forms and only one data module are created at
Suppose the following application landscape: +-----------------+ | App server | +-----------------+ | | +-------+
Suppose I have a web application, which uses jQuery for Ajax and UI. Now
Suppose you're writing a simple database web application using Ruby and MySQL. Access to
Suppose we were to implement a network application, such as a chat with a
Suppose my solution have two project: myApp: silverlight application project: the default application App

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.