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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T19:32:03+00:00 2026-05-30T19:32:03+00:00

I have several cells in a UITableview , each with their own UIScrollView .

  • 0

I have several cells in a UITableview, each with their own UIScrollView. When a user scrolls in one of the cells I would like all of the other cells to follow. Is there any way to create this kind of interaction by passing the contentOffset to the other cells?

I’m thinking delegation but so far I can’t get this to work. Any ideas?

  • 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-30T19:32:04+00:00Added an answer on May 30, 2026 at 7:32 pm

    This is actually quite easy. Just implement the UIScrollViewDelegate method scrollViewDidScroll: in your viewController and there you set the contentOffset of all other cells. Make your viewController the delegate of the scrollview in each cell and you are done.

    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
    {
        static NSString *CellIdentifier = @"MyFancyCell";
        MyFancyCell *cell = (MyFancyCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
        cell.scrollView.delegate = self; // actually you would do this in the storyboard or inside (cell == nil) if you don't use storyboard
        // configure cell    
        return cell;
    }
    
    - (void)scrollViewDidScroll:(UIScrollView *)scrollView 
    {
        if (scrollView == self.tableView) {
            // each tableView is a UIScrollView too. 
            // they will call this method which will lead to strange results if you change your cells scrollView.
            // just ignore the scroll events of the tableView
            return;
        }
        CGPoint contentOffset = scrollView.contentOffset;
        for (MyFancyCell *cell in [self.tableView visibleCells]) {
            cell.scrollView.contentOffset = contentOffset;
        }
    }
    

    EDIT:
    you could forward the delegate calls back to the cell, like this:

    for (MyFancyCell *cell in [self.tableView visibleCells]) {
        cell.scrollView.contentOffset = contentOffset;
        [cell scrollViewDidScroll:cell.scrollView];
    }
    

    or an imho better way. Make the viewController a delegate of the cell and in the scrollViewDidScoll method inside the cell you tell the delegate (viewController) that the contentOffset has changed so that the view controller updates the cells.

    // MyFancyCell.h
    @protocol MyFancyCellDelegate 
    - (void)fancyCell:(MyFancyCell *)cell didChangeContentOffset:(CGPoint)offset;
    @end
    @property (weak, nonatomic) id <MyFancyCellDelegate> delegate;
    
    // MyFancyCell.m
    
    - (void)scrollViewDidScroll:(UIScrollView *)scrollView {
         // do your work here
         [self.delegate fancyCell:self didChangeContentOffset:scrollView.contentOffset];
    }
    
    // ViewController.m
    
    - (void)fancyCell:(MyFancyCell *)cell didChangeContentOffset:(CGPoint)offset {
        for (MyFancyCell *cell in [self.tableView visibleCells]) {
            cell.scrollView.contentOffset = offset;
        }
    }
    
    
    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
    {
        static NSString *CellIdentifier = @"MyFancyCell";
        MyFancyCell *cell = (MyFancyCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
        cell.delegate = self;
        // configure
    }
    
    • 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 that contains several cells (just standard UITableViewCell s), all
I have a table view with several cells, each containing a UITextView. The user
I have several old 3.5in floppy disks that I would like to backup. My
I have several foreach loops after each other in a larger foreach loop.. What
I have a UITableView that contains several cells and some of them (the ones
I have a Matlab script consisting of several cells that should all be able
I have a UITableView with several cells. This table is to be scrolled vertically.
Situation: I have several Gridviews on one page, and each Gridview has a dynamically
I have several user controls, let's say A , B , C and D
I have several instances of a UIControl class Foo being instantiated, one instance corresponding

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.