UIView Animations in TableView?

Hello all,


I have several animations I want to acheive in the top cell called "InfoCell".

When the user scrolls down, I want an imageview to rotate so many degrees. (I can figure out the degrees).

I also want to fade a UIButton to alpha:0.0; as the user scrolls down.


Now, I know how to do the fading of the UIButton.


My issue is, how can I detect when the user is scrolling down (without having to use the UIGestureRecongizer) so I can activate these animations?

The other issue is, when the user scrolls down, how can I rotate the image at the speed of the scroll? (if the user stops scrolling, the rotation animation of that UIImage would stop too).


My project is in Objective-C. please provide a Objective-C language answer.


Thank you so so very much!!

Cheers to coding.

- Nate

UITableView inherits from UIScrollView which has UITableViewDelegate with scrollViewDidScroll method. So you have to set for example the view controller as a delegate for the table view.


ViewController.m:

@interface ViewController () <UITableViewDelegate>
@property (weak, nonatomic) IBOutlet UITableView *tableView;
@end

@implementation ViewController
- (void)viewDidLoad {
    [super viewDidLoad];
    / 
    self.tableView.delegate = self;
}
- (void)scrollViewDidScroll:(nonnull UIScrollView *)scrollView {
    NSLog(@"%f", scrollView.contentOffset.y); // Get the cell from the table view and change the properties
}
@end
UIView Animations in TableView?
 
 
Q