Monday, September 7, 2026
HomeiOS Developmentgoal c - Tips on how to scroll to the highest of...

goal c – Tips on how to scroll to the highest of a desk view in iOS 15

[ad_1]

How do you scroll to the very prime of a desk view in iOS 15? This labored for me in earlier variations of iOS, however iOS 15 provides additional padding for part header views. This not scrolls to the precise prime of the view.

NSInteger sections = [self numberOfSectionsInTableView:self.tableView];
if(sections)
{
    for(NSInteger i=0; i<sections; i++)
    {
        NSInteger rows = [self tableView:self.tableView numberOfRowsInSection:i];
        if(rows)
        {
            NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:i];
            [self.tableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionTop animated:NO];    
            break;
        }
    }
}

[ad_2]

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments