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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T00:16:46+00:00 2026-05-12T00:16:46+00:00

As I wire up my first fairly complicated Cocoa-Touch view I feel like I’m

  • 0

As I wire up my first fairly complicated Cocoa-Touch view I feel like I’m inadvertently slipping back into old procedural patterns and finding it difficult to shake them off…Though fully aware of many of the Cocoa (OO) design patterns I’m afraid I may be subverting them.

As such this view in question is quickly becoming unmanageable and I’m wondering if I might be approaching it the wrong way?!? The view is managed by a subclass of UIViewController. The view itself contains ±10 subviews. Some of these subviews “slide” in and out and contain their own subviews (controls, imageviews, etc) that slide along with them.

Without getting into too much detail I’ve found that I’m executing most (if not all, including animation) of my management code w/in the touchesBegan/Moved/Ended methods of my root View Controller. And it’s become a mess of managing, setting & checking boolean properties. if (editingMode & panelAVisible)…. if (editingMode & panelBVisible)… or *if (viewFlipped) { for (MyCustomView view in someArrayOfSubviews)} etc, etc… granted the UI of this app requires most of these views (or their contents) to be touched and moved by the user to different parts of the screen.

The main problems I’m trying to solve seems to be along the lines of: if viewA is present then you 3 views go hide (animated)…or, If viewB is touched then all objects contained in viewC are negative… etc.

Any clever (or rudimentary) OO approach to handling this? Perhaps make the subviews that contain views act as their own mini view controllers? I haven’t been able to find too many (any?) examples of that though…

  • 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-12T00:16:46+00:00Added an answer on May 12, 2026 at 12:16 am

    I think you should go along your last suggestion, make the subviews that contain views act as their own mini view controllers. Each (sub)view that presents a ‘screen full of content’ could/should be managed by its own view controller.

    Animating between those views can be done with the build in navigation controller (you can actually hide the top bar of a navigation controller) such that you have the default slide animation. Otherwise you could indeed create your own animation while still using that navigation controller.

    ‘The view itself contains ±10 subviews’. Some of these subviews “slide” in and out [..]’. These subviews you’re talking about are perfect candidates for extraction from your one monolithic UIView.

    The basic OO principle to use is how the navigation controller does it, by pushing and popping views on and off a stack. Each view pushed and popped is handled by its own view controller.

    HTH

    Edit: I now see you’re not specifically talking about iPhone development. Still, have a look how its done there (especially the UINavigationController). You can still get the basic design idea

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

Sidebar

Related Questions

I wanted to wire the Google App Engine user service in Spring by first
I have a USB to one-wire adapter on my desk, I would like to
Is it possible to wire up the View and ViewModel using both a Declarative
I'm moving on from iOS to Cocoa and trying to muddle through my first
I'm trying to wire up a CheckBox to handle an event when check/unchecked. If
I'm attempting to wire a queue to the front of a MessageChannel , and
I'm trying to wire up Windsor 3.0 to inject connection strings from my web.config
I am using AddHandler to wire a function to a control's event that I
I am using WCF to send some Linq objects across the wire. I want
I am rx this error on Deserialization: Invalid wire-type; this usually means you have

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.