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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:33:56+00:00 2026-05-28T07:33:56+00:00

Old question title: How to capture events in parent UIViews, such as HUD layers?

  • 0

Old question title: How to capture events in parent UIViews, such as HUD layers?

I am attempting to write a game using the UI framework rather than cocos2d.

I would like to make View partials with all their events handled properly. It does not seem possible.

By partial views, I refer to the way Ruby on Rails (and other languages) allows you to have small chunks of a presentation layer (view code) that appear in a larger piece of a presentation layer (view code).

The game has a HUD layer with score at the top (and other meta data) and I use

[self.view addSubview:y] or
[self.navigationController push...]

Visually, it would be like this (not to scale):

+----------------------------+
|A                           |
|+--------+   +------------+ |
||B       |   |C           | |
||        |   |            | |
|+--------+   |            | |
|             |            | |
|             +------------+ |
+----------------------------+
  • Section A has buttons relating to main menu (primary navigation)
  • Section B has buttons for score, etc
  • Section C is the main game area

Both Section A and Section B are HUD layers, they are meant to have clickable events where required.

I do not want to keep repeating the same code over and over again, so I feel a HUD system where I include the views I want in the window should be the best way to accomplish this.

The problem I am having is that if I include my HUD.h/HUD.m file in any other View controller, I can no longer accept the clicks for Sections A or B in Section C, and I cannot make it perform event actions as it always complains that the method doesn’t exist within Section C.

If I am on the Section C view I should accept clicks from A and B and handle them appropriately.

Thus, what is the best way to capture events via a HUD layering system, and handle the events appropriately?

The closest I’ve seen is possibly using touchesBegan but what I am not clear on is how to link touchesBegan events to events that are in Section A/B’s controller.

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-28T07:33:57+00:00Added an answer on May 28, 2026 at 7:33 am

    I’ve decided having tested several different ideas to go with cocos2d as it would be a good thing to add to my skillset.

    Closed.

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

Sidebar

Related Questions

I'm discarding the old question for a better formulated question. I'm using the twitter
EDIT: Original Title: Question about the benefit of using an ORM. I want to
as the title says my question would be how to debug old asp code
The question is in the title. Using GCC version 3.4.5 on Windows Vista and
[ Old question title used to be ARC is set to YES, but xcode
Old question My understanding is that C# has in some sense HashSet and set
Age old question! When you have finished developing and testing your ASP.Net web application,
I have this old question but no answer works for me from online, the
NOTE: This is an old question and the answers here no longer works (since
I know this is an old question, but I have spend any hours on

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.