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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:42:24+00:00 2026-05-25T15:42:24+00:00

I have a UIView added to my rootViewController, the UIView detects touches and using

  • 0

I have a UIView added to my rootViewController, the UIView detects touches and using their coordinates returns me a specific Integer, however I dont know how to return this integer to my rootViewController. I read somewhere that the MVC says that the UIView should not know about the viewcontroller, is this true? if So how might I accomplish this? 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-05-25T15:42:24+00:00Added an answer on May 25, 2026 at 3:42 pm

    I recomend you to define a protocol for passing the Integer between them. Make your view controller implement the protocol and assign it to the view. Then, from the view, fire the protocol method with the desired value.

    Protocol example:

    @protocol YourProtocol
    
    -(void)handleCaptureInteger:(NSInteger)value;
    
    @end
    

    View controller (.h) example:

    @interface YourViewControler : UIViewController<YourProtocol>
    
    ...
    
    @end
    

    View controller (.m) example:

    @implementation YourViewController
    
    - (void)viewDidLoad
    {
        [yourView setDelegate:self];
    }
    
    @end
    

    View example:

    @interface YourView : UIView
    
    @property (nonatomic, assign) NSObect<YoutProtocol> *delegate;
    
    @end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a touchesBegan: method which works fine. However I recently added a UIView
In my app I have added a UIView as a new subView, however it
I have a UIView that contains a drawing that I've made using CALayers added
I am new to iphone development.I have created a UIview controller class and added
I have a subview that has been added to my UIView. The idea is
I have a UIView in which I added a UITapGestureRecognizer . Inside that view
i have a UIView UIImageview UIButton and UISlider added as subview to UIView example:
I have a UIScrollView and added a UIView inside it, when I zoom it,
I have a custom UIView , to which I have added a UITapGestureRecognizer to
I subclass UIView and have an NSString member named imgName; All views added to

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.