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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:47:15+00:00 2026-05-26T16:47:15+00:00

Let’s say you are developing an ipad application, and in 1 page you want

  • 0

Let’s say you are developing an ipad application, and in 1 page you want to display different data.
At the bottom of the page you want to display some information that you want to keep separated from the rest of the page?

Questions:

  • Would you use a UIViewController or a subclass of UIView for that portion of the page?
  • Is it a bad practice to have too much logic in a UIView?

I’m asking this question because I ran into a lot of problem while unit testing my code. A UIViewController is easily testable since it does not require the UIView to be loaded, but a UIView is not testable unless it’s completely loaded (in my case loaded from a nib file)

  • 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-26T16:47:15+00:00Added an answer on May 26, 2026 at 4:47 pm

    Here’s my two cents

    1) First, I would try to use one of those fancy iPad-only controllers (in particular, the split view controller). Alternatively, I would use a custom UIViewController with separate views for the two sections you want.

    2) Oh man, this is a huge question: Is it a bad practice to have too much logic in a UIView? You must always use object oriented carefully; split up your design into classes and use inheritance/composition properly to avoid unmanageable code. Don’t forget that apple kindly helps you do this by being MVC friendly.

    First of all, it’s bad practice to have the wrong kind of logic in a UIView. If you end up storing state that should belong on the model, you’ll be planting a few trouble seeds. Just don’t do it. The issue here is not how much logic, but the type of logic… remember that views are meant to be used by the controller and keep that in mind while designing them.

    Second of all, it’s ok for your views to be complex as long as they have a specific purpose. Apple’s UITableView is an example of a very complex view, but using it is relatively straight forward because it was (in my opinion) designed correctly. Note that the tableview does not store any data… it gets it all from the datasource. Furthermore, it’s purpose is to display data in cells. If you emulate these good practices, complex views can still be manageable.

    Finally, if you do decide to make a complex view, use composition to your benefit. I could go on and on, but the short version is that lots of logic is easier to manage if you use oop to your advantage and keep your code organized.

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

Sidebar

Related Questions

Let's say that I have a model that handles recipes, and I want to
Let's say I'm building a data access layer for an application. Typically I have
Let's say i have this block of code, <div id=id1> This is some text
Let's say the Activity I want to start is named OccupyThePieShop I was previously
Let's say on a page I have alot of this repeated: <div class=entry> <h4>Magic:</h4>
Let's say I have an facebook application running using the JS SDK. First user
Let's say there is a graph and some set of functions like: create-node ::
Let's say I have multiple requirements for a password. The first is that the
Let's assume that a user votes for some movies in a scale of 1
Let's say that I have a date in R and it's formatted as follows.

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.