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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T23:35:20+00:00 2026-05-15T23:35:20+00:00

I currently have a simple iPhone app that loads a custom subclass of UIView.

  • 0

I currently have a simple iPhone app that loads a custom subclass of UIView. There’s only one controller at the moment for the whole application, although there are several UIViews for separating the program logically.

My current structure looks something like this:

mainView : UIScrollView
    \__ has one subView : myCustomUIView : UIView
            \__ has many subSubView : myOtherCustomUIView : UIView

I hope this is clear; a colon, of course, represents inheritance.

My issue is this: I need to intercept events at the lowest level, subSubView. I can probably do this in the application controller if I need to, but should I have a subSubViewController instead? Should I have a subViewController too?

If so, can someone point me towards some references for doing this by hand? I can of course create the classes, but connecting them to custom views seems nontrivial. I’m not using interface builder at all aside from the main nib that holds the window object.

My main confusion arises from what will happen when I have a view nested in a view with a different controller. So let’s say I did have a subSubViewController, but mainView still has its mainViewController. Since subSubView is contained within mainView, would this not cause some issue?

And should I be using delegates at all for any of this?

Any nudge in the right direction would be appreciated.

  • 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-15T23:35:21+00:00Added an answer on May 15, 2026 at 11:35 pm

    Views and view controllers exist in pairs. Each view controller control a view and the view’s subviews. This is necessary because view controllers are in the responder chain for events. If multiple view controllers are active within the same view, the responder chain becomes scrambled.

    Standard view controllers don’t have a subController attribute and don’t understand if another controller is active in the same chain. Navigation and tabbar controllers exist precisely to handle hierarchal controllers. However, they do so by swapping one view/view-controller pair for another. You can’t use navigation or tabbar controllers to provide different controllers for subviews.

    So, regardless of how many subviews you may have for anyone view, you end up with just one controller per screen.

    You might want to reconsider your design. If the subviews each need highly customizable behavior, you might want to move them to individual views in a controller hierarchy such as in the master-detail design pattern.

    If you do have to have all the subviews on the same screen, then I would suggest looking at how a UITableView and UITableViewController handle things. (You might be able to just use a a modified tableview.) A tableview is a scrollview that holds multiple subviews for cells, section titles, headers and footers. It manages this by trapping the touches from the tableview and determining which cell view was touched and then taking the appropriate action.

    If you need highly customized behavior for each subview, you could use the delegate pattern and assign each subview a different delegate object. The view could trap its own touches and call its own delegate.

    Scrollviews can be tricky to implement customized touch behavior because the scrollview traps touches at a higher level than other views so that it can determine if it needs to scroll or not.

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

Sidebar

Related Questions

I currently have a very simple app for which the only interaction is shaking
I currently have a simple form that when you click the save button will
There is probably is simple fix for this but I currently have code similar
This had been driving me crazy.... I have an iPhone app that is using
I have a content based, read-only iPhone app. Users can select favorite topics, which
I'm working on a simple iPhone app. I have 1 UINavigationController and 2 subclasses
I have an iPhone app that does image manipulation via blending two UIImage objects
I'm currently working on an iPhone app that is fairly data intensive. It downloads
I have an app that uses OpenGL-ES and an EAGLContext within a UIView -
I'm currently making a whimsical iPhone app that will allow you to change your

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.