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

The Archive Base Latest Questions

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

UITableView provides the methods indexPathsForVisibleRows and visibleCells , but how can I get the

  • 0

UITableView provides the methods indexPathsForVisibleRows and visibleCells, but how can I get the visible sections?

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

    I have got the solution.

    First step, each section will show a UIView that created by - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section, that will be stored into array.

    When the TableView is scrolled , I want free the invisible section view, so I need know which section is visible or not, follow function code will detect for this purpose, if the view is visible then free it.

    -(BOOL)isVisibleRect:(CGRect)rect containerView:(UIScrollView*)containerView
    {
        CGPoint point = containerView.contentOffset;
        CGFloat zy = point.y ;
    
        CGFloat  py =  rect.origin.y + rect.size.height;
        if (py - zy <0) {
                return FALSE;
        }
        CGRect  screenRect = containerView.frame;
    
        CGFloat by = screenRect.size.height + zy ;
        if (rect.origin.y > by) {
                return FALSE;
        }
        return TRUE;
    }
    

    (rect is the frame of the section UIView; containerView is the UITableView)

    In this way, I can get visible sections of the UITableView, but I hope the SDK can provide API for this purpose directly.

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

Sidebar

Related Questions

I have a grouped UITableView with 3 sections: 2 of the 3 are constants
In UITableView, you can tap and hold on a table cell and cancels the
I have a UITableView with custom UITableViewCells. The table has two sections, the first
How can I change color of a section header in UITableView? EDIT : The
When using UITableView, we can reuse its cells using [[ UITableViewCell alloc] initWithStyle: reuseIdentifier:]
How can I create a custom scrollbar for a UITableView? I want to remove
How can we list video thumbnails on a UItableview.I have the link for the
I know how to work with UITableview delegates and datasource protocol methods. So, I
UITableView only shows data from JSON array when I scroll up and down. When
I have a UITableView populated with a location-based datasource. I'm calling [self updateView]; to

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.