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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T05:11:18+00:00 2026-05-14T05:11:18+00:00

I was reading thourg this example (link) … From the description, this seems paradox

  • 0

I was reading thourg this example (link)…

From the description, this seems paradox to me:

When implementing a table view cell,
there’s a tension between optimal
scrolling performance and optimal
edit/reordering performance. You
should typically use subviews in the
cell’s content view.

When you have an edit or reordering
control, using subviews makes the
implementation easier, and the
animations perform better because
UIKit doesn’t have to redraw during
animations.

Conclusion: Subviews are faster because UIKit must not redraw during animations. So when scrolling, it must not call -drawRect: all the time. Right?

And then, the paradoxon:

If the content is complex, however
(more than about three subviews),
scrolling performance may suffer. If
this becomes a problem, you can
instead draw directly in a subview of
the table view cell’s content view.

Conclusion: Prefer -drawRect: to draw directly on the table view cell. Better scroll performance for complex cells. Better than a lot of subviews.

So, well then. What’s true? Subviews or -drawRect: Which is the better one?

In my case I would have like 12 subviews per cell. Are they actually just trying to say this? “If you have only up to 3 subviews, go with them. But if you have much more, use -drawRect: and draw directly on the cell.”. But then: Why not always prefer -drawRect: then?

  • 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-14T05:11:18+00:00Added an answer on May 14, 2026 at 5:11 am

    You could sum it up as Display only Vs Functional. If your cells are tasked simply with displaying data that doesn’t change much and remains static, draw it. If your cells are tasked with being functional, can change position or are manipulated by the user (or you have custom animation), look at using subviews.

    There isn’t really a hard and fast rule to this. Your use case is good measurement on which approach is best. With 12 subviews i’d instantly lean towards custom drawing for the speed benefits.

    Why not always prefer -drawRect: then?

    You get quite a few things for free by using subviews. Animations are ‘easier’. Using a UIImageView to display an image gives you highlighting for free, for example. It really depends on what your cell is tasked with.

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

Sidebar

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.