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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:45:34+00:00 2026-06-03T05:45:34+00:00

I have a UIViewController with a lot of methods therefore I will like to

  • 0

I have a UIViewController with a lot of methods therefore I will like to split it apart into separate classes to have my code more organized. I was wondering if it would be possible to place the

 -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
 {
    // code
 }

method on a separate class.

  • 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-03T05:45:36+00:00Added an answer on June 3, 2026 at 5:45 am

    The touch control functions apply to the UIView or UIViewController that you place them in. You can thus – to the best of my knowledge – not place them in a different class as is.

    That said, if your goal is to clean up your code, you can subclass UIView and place an instance of that new UIView in your project instead of having the touches handled by your UIViewController. Make the UIView the size you want and set the alpha to 0 so users won’t be aware of its existence.

    If you only want touch recognition on a certain area of the screen this approach will make your life a lot easier as well.

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

Sidebar

Related Questions

Currently I have this code in my UIViewController: //Cocos2D methods -(id) init { if((self=[super
I have subclassed UIViewController into a new class, PageViewController (I'm writing a simple book
I have a UIViewController that allow me to display some text into a view.
I have searched a lot about this topic and I can't get this code
I have a UIViewController-> UINavigationBar + UITableView Just a bit more explanation I made
I have an UIViewController into an navigationController.All I want is when I rotate from
I have a problem with data in UITableView. I have UIViewController, that contains UITableView
Here is the situation, I have UIViewController class with a UITableView outlet. I would
I have differents UIViewController that contains components that appear and disappear from the view
I have a UIViewController with a UIImageView in it and a array of UIImage

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.