FMTopReflesh 1.0.1

FMTopReflesh 1.0.1

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Jan 2018

Maintained by jacoli.



  • By
  • jacoli

Top Reflesh Control

A simple top reflesh control for scrollview/tableview.

Snapshot

Snapshot

Installation

With CocoaPods, add this line to your Podfile.

pod 'FMTopReflesh'

and run pod install, then you're all done!

Or copy FMTopRefleshControl.h FMTopRefleshControl.m to your project.

How to use

Implement FMTopRefleshControlTopView protocol

- (void)pullToReflesh {
    //self.backgroundColor = [UIColor blueColor];
    self.textLabel.text = @"pull to relfesh";
}

- (void)releaseToReflesh {
    //self.backgroundColor = [UIColor yellowColor];
    self.textLabel.text = @"release to relfesh";
}

- (void)startReflesh {
    //self.backgroundColor = [UIColor redColor];
    [self.indicator startAnimating];
    self.textLabel.text = @"relfesh...";
}

- (void)refleshFinished {
    //self.backgroundColor = [UIColor whiteColor];
    [self.indicator stopAnimating];
    self.textLabel.text = nil;
}

Config reflesh control

    self.refleshControl = [[FMTopRefleshControl alloc] initWithScrollView:v withRefleshCallback:^(FMTopRefleshControl *control) {
        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
            [control endReflesh];
        });
    } withTopView:[[CustomTopRefleshView alloc] initWithFrame:[UIScreen mainScreen].bounds]];

Requirements

  • iOS 7.0+
  • ARC