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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T00:04:27+00:00 2026-05-27T00:04:27+00:00

i often do not split view and controller related things correctly. should i always

  • 0

i often do not split view and controller related things correctly.

  1. should i always subclass a uiview if i want custom uibuttons and backgrounds in my app and add style related stuff in my view or should i handle this in my controller? or probably subclass a uibutton?

  2. what about alignings? when should i subclass a uiview, add buttons to it and align then or handle this in my controller?

thanks for your hints!
please leave some comments if something is unclear.

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

    Should i always subclass a uiview if I want custom uibuttons and
    backgrounds in my app and add style related stuff in my view

    If your need are basic, you coan just insert wanted elements as subviews of your view without having to subclass anything. Buttons and views have enough properties to handle those simple needs. But everything depends on what are those needs.

    Should i handle this in my controller? or probably subclass a
    uibutton?

    Subclassing UIButton for UIButton behaviour is not a bad idea 🙂 But as said before, what do you need as special behaviour ? A special image : there is a property for that. A special reaction on events, manage it into the controller on IBActions. A UIButton with UFO behaviours, ok, let’s subclass it.

    What about alignings? when should i subclass a uiview, add buttons to
    it and align then or handle this in my controller?

    Hmmm… I guess never. This can (should) be done in the controller. The controller controls the whole UIItems. So if you want to align one item regarding another, do it into the controller. If you want to align special graphics or text that is displayed into the button, sublass it and manage that in the drawRect method.

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

Sidebar

Related Questions

(Not related to versioning the database schema) Applications that interfaces with databases often have
One problem I have with open-source is not often the product or documentation, but
I'm often changing files not from subversion, but from finder, or other sources. Recently,
I'm not sure what they call the fake shortcuts you often see in Windows
I have often PATHs for files which do not exist in my codes. I
I often commit files with similar cvs comment but not in a single operation.
It seems to be often said that Task Manager does not provide an accurate
I have a not-so-small class under development (that it changes often) and I need
I'm not sure if I like Python's dynamic-ness. It often results in me forgetting
I often use gVim and Vim to view data tables in which the top

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.