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

  • Home
  • SEARCH
  • 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 6645407
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:17:01+00:00 2026-05-26T00:17:01+00:00

I am building an ipad app that has two basic regions on the screen:

  • 0

I am building an ipad app that has two basic regions on the screen:

  • A dock on the left hand side contains “things” that you can drag onto the right side
  • A free-form canvas on the right hand side

Under the presumption that the dock and the canvas views are both added as subviews to the viewcontroller’s view, my question is around the mechanics of dragging the “thing” with my finger from the dock onto the canvas… who should own the view that represents the “thing”? Should it be the uiview that represents the dock (and then when it moves from the dock to the canvas I remove it from the dock and add it to the canvas)? Or should it belong the root view of the viewcontroller? Or some other pattern?

I’d be interested in peoples thoughts on the design patterns involved here.

Thanks a lot.
BTW, I’ve considered using something like cocos2d for this, but for the moment, I’d like to stay with the standard UIKit.

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

    In Objective-C, you use UIViewControllers to control views. The logic of the program resides in these controllers. The idea is to separate view and model (data) and have a controller managed the interaction. This is called the MVC (“Model-View-Controller”) design pattern.

    In your case, the controller controls the main view and its subviews. So it is exactly there where you would implement the logic of dragging one object (also a UIView) from one subview to another. In your words, the dragged object “belongs” to this controller.

    Maybe you have another class that keeps track of the things on the canvas, your “data model”. The controller would need that to read and write the changes to it. Maybe there is some custom drawing necessary for the views. The views would implement this behavior themselves. In this way, you also follow the principle of encapsulation that helps writing re-usable code.

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

Sidebar

Related Questions

I am building an iPad app that will use multitouch gestures (Left and Right).
I'm building an iPad app that will have multiple paper pages and I'd like
I am building an iPad app which basically has a UITabController which controls and
Building an iPad app. I have a button on my main view that I
I am building a universal app that uses a UISplitViewController for the iPad, and
I'm building an app for the ipad that uses the youtube api to get
So, I am building a web app that has a div with text that
We're building an iPad app and don't plan to use any APIs that are
Building an app using a calendar on a Google Apps domain that has SSL
Im building an ipad app, it haves some text fields that when tapped, move

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.