The effect

Yes, it’s a simple drop-down to load more

implementation

Here’s the answer

Simple point is, the use of rotating CGAffineTransformMakeRotation

  • Under the rotationUICollectionView,UICollectionViewCellAnd scroll bars
// The same goes for UITableView
collectionView.transform = CGAffineTransformMakeRotation(-M_PI);
collectionView.scrollIndicatorInsets = UIEdgeInsetsMake(0.0.0.0.0.0, collectionView.bounds.size.width - 8.0);// 8 is the width of the scroll bar
Copy the code
  • A little bit different from the original answer, useIGListKitMust be created beforeCellWhen rotated, otherwise the latest piece of data is always not rotated, but usedUITableViewThere is no such problem
// create from Xib or Storyboard
- (void)awakeFromNib{
    [super awakeFromNib];
    self.contentView.transform = CGAffineTransformMakeRotation(-M_PI);
}

// Create it manually
- (instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        self.contentView.transform = CGAffineTransformMakeRotation(-M_PI);
    }
    return self;
}
Copy the code
  • After rotation, drop down refresh is usedMJRefreshAutoNormalFooter(Because it was rotated 180 degrees)
  • And finally, refresh, useIGListKitLocal refresh can be done if usedreloadDataIt jumps because it refreshes the whole list.

Well, the only thing I’m not familiar with is probably IGListKit, but as smart as you are, this IGListKit tutorial is not going to happen in a minute.

detour

At Baidu, you can only search for the same scrollRectToVisible, scrollToItemAtIndexPath. I’m not very smart, I’ve tried it all, I can jump, and it’s complicated.

I didn’t know how to search iOS TableView Reverse when I found it

practice

This is the demo THAT I wrote