Latest 1.0.1
Homepage https://github.com/jacoli/FMTopRefleshControl
License MIT
Platforms ios 7.0, requires ARC
Frameworks Foundation, UIKit
Authors

Top Reflesh Control

License
Platform
Build Status

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

Latest podspec

{
    "name": "FMTopReflesh",
    "version": "1.0.1",
    "summary": "A simple top reflesh control for scrollview/tableview.",
    "homepage": "https://github.com/jacoli/FMTopRefleshControl",
    "license": "MIT",
    "authors": {
        "jacoli": "[email protected]"
    },
    "source": {
        "git": "https://github.com/jacoli/FMTopRefleshControl.git",
        "tag": "1.0.1"
    },
    "frameworks": [
        "Foundation",
        "UIKit"
    ],
    "platforms": {
        "ios": "7.0"
    },
    "source_files": "FMTopReflesh/FMTopRefleshControl/*.{h,m}",
    "requires_arc": true
}

Pin It on Pinterest

Share This