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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:53:54+00:00 2026-05-22T16:53:54+00:00

I have a custom class of a UIView I’ve made inside my viewcontroller. I

  • 0

I have a custom class of a UIView I’ve made inside my viewcontroller. I want to make this class re-usable and so don’t want to build it to work just with this 1 viewcontroller. Because of this, I think the best way of telling my viewcontroller that the user has interacted with the class is to somehow make my own UIControlEvent. Maybe something like:

[customClass addTarget:self action:@selector(whatIWantToHappen) forControlEvents:UIControlEventWhatever];

I don’t know much about doing this though, any suggestions on this?

  • 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-22T16:53:55+00:00Added an answer on May 22, 2026 at 4:53 pm

    You could do this by subclassing UIControl, which inherits from UIView, but provides some additional methods for handling targets and actions. Have a look at the constants, perhaps one of the predefined control events already fits your bill. Otherwise, you could define your own events in the range provided by UIControlEventApplicationReserved, you should however never prefix your own things with UI..., that ‘namespace’ is reserved for UIKit.

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

Sidebar

Related Questions

I have a custom UIView class. Inside that view, there is an image view.
I have a custom UIView subclass without a corresponding UIViewController. I use this class
I have a class that subclasses UIView called DrawView. This class contains custom drawing
I have a UIView custom class and the object created by this class has
I have a custom class that implements that IComparable. This class is stored in
I have a custom class that implements ICollection , and this class is readonly,
I have a custom class that uses boost mutexes and locks like this (only
I have a custom UIView. So myView class extend UIView. In initWithFrame:(CGRect)frame method I
I have a custom UIWindow class that has an IBOutlet @interface MyWindow IBOutlet UIView
I have a class that implements UIView and inside - (void)drawRect:(CGRect)rect method I add

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.