Latest 1.0.2
Homepage https://github.com/xorshine/KafkaRefresh
License MIT
Platforms ios 7.0, requires ARC
Authors


Status

GitHub license
CocoaPods Compatible
platform
language
Email


Screenshots

KafkaRefreshStyle Top Screenshots Bottom Screenshots
Native
ReplicatorWoody
ReplicatorAllen
ReplicatorCircle
ReplicatorDot
ReplicatorArc
ReplicatorTriangle
AnimatableRing
AnimatableArrow

Features

  • Built-in rich animation style, support self-customization

  • Non-refresh state hidden automatically

    To avoid developers manually adjust contentInset refresh the appearance of the control after the impact of the visual experience;

    the most common situation, the absence of data, the bottom of the refresh control is not hidden, the use of KafkaRefresh to avoid the problem.

  • Anti-dithering at the end of the refresh

    When the refresh control finishes refreshing, if UIScrollView is in a scrolling state, KafkaRefresh will adjust the contntOffset that controls the UIScrollView at this time according to the refresh control.

  • Support setting the offset threshold to trigger refresh

    Setting the value of stretchOffsetYAxisThreshold can control the refresh pull distance.This property is a ratio relative to the height of the control and must be set greater than 1.0.

  • Support global setting

    KafkaRefreshDefaults is a singleton for global settings

  • Support progress callback

    Real-time callback Drag the offset ratio, for the expansion of the interface, according to the progress of adjustment animation.

  • Adaptive contentInset system adjustment and manual adjustment

    Adaptive UINavigationController for UIScrollView’s contentInset property adjustment, even if the contentInset automatically set value, then KafkaRefresh can still adapt this adjustment.

  • Solve the section view floating problem when refreshing

  • Support horizontal and vertical screen switching adaptive

    No need to consider in the horizontal and vertical screen refresh refresh problem.

  • iOS 7+

    Support iOS 7 above system. Including iPhone X.

  • Document coverage 100%

    You can see the use of all methods and classes in the header file.

Installation

  • CocoaPods

    pod 'KafkaRefresh'
  • Carthage

    If anyone wants to install by carthage , please supply a pull request. I’m not using this package manager myself.

Usage

 #import "KafkaRefresh.h" 
initialization
  • the first way

    [self.tableView bindRefreshStyle:KafkaRefreshStyleAnimatableArrow
                           fillColor:MainColor
                          atPosition:KafkaRefreshPositionHeader refreshHanler:^{
         //.......
    }];
    
    [self.tableView bindRefreshStyle:KafkaRefreshStyleAnimatableArrow
                           fillColor:MinorColor
                          atPosition:KafkaRefreshPositionFooter
                       refreshHanler:^{
         //.....
    }];
  • the second way

    KafkaArrowHeader * arrow = [[KafkaArrowHeader alloc] init];
    arrow.refreshHandler = ^{
     //.....
    };
    self.tableView.headRefreshControl = arrow;
  • the third way(global configuration)

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    [[KafkaRefreshDefaults standardRefreshDefaults] setHeaderDefaultStyle:KafkaRefreshStyleAnimatableRing];
    return YES;
}

[self.tableView bindDefaultRefreshStyleAtPosition:KafkaRefreshPositionHeader refreshHanler:^{
        //.....
}];
triggering refresh manually
 [self.tableView.headRefreshControl beginRefreshing];
 [self.tableView.footRefreshControl beginRefreshing];
end refresh

When you finish refreshing and don’t need to show any hints, or any animation, call the following method.

- (void)endRefreshing; 

When you finish the refresh and need to display the prompt message, call the following method.

- (void)endRefreshingWithAlertText:(NSString *)text completion:(dispatch_block_t)completion; 

When you end the refresh and no longer need to refresh, call the following method.

- (void)endRefreshingAndNoLongerRefreshingWithAlertText:(NSString *)text;

Customize

Take KafkaheadRefreshControl as an example

 #import "KafkaheadRefreshControl.h"
 @interface CustomHeader : KafkafootRefreshControl

 @end
 @implementation CustomHeader 

 - (void)setupProperties{
    [super setupProperties];
    //Initialization properties
}

- (void)kafkaDidScrollWithProgress:(CGFloat)progress max:(const CGFloat)max{
    //progress callback
}

- (void)kafkaRefreshStateDidChange:(KafkaRefreshState)state{
    [super kafkaRefreshStateDidChange:state];

    switch (state) {
        case KafkaRefreshStateNone:{
            break;
        }
        case KafkaRefreshStateScrolling:{
            break;
        }
        case KafkaRefreshStateReady:{
            break;
        }
        case KafkaRefreshStateRefreshing:{ 
            break;
        }
        case KafkaRefreshStateWillEndRefresh:{ 
            break;
        }
    }
}
 @end

Precautions

  • Please update the latest version;
  • After iOS 11, if you use estimatedRowHeight and the estimatedRowHeight height is too far from the true height, UITableView repeated refreshes may occur before version 0.8.3, which has been resolved since version 0.8.3 (iOS bug)

Communication

  1. If you need help,please email [email protected].
  2. If you found a bug,and can provide steps to reliably reproduce it, open an issue.
  3. Personal energy is limited, Kafka provides callback interface enough to increase the richer UI effect, we welcome you to join together and submit the pull request.

License

KafkaRefresh is released under the MIT license. See LICENSE for details.

Latest podspec

{
    "name": "KafkaRefresh",
    "version": "1.0.2",
    "summary": "Highly scalable, custom, multi-style refresh framework.",
    "homepage": "https://github.com/xorshine/KafkaRefresh",
    "license": "MIT",
    "authors": {
        "Xiaohui Hsiang": "[email protected]"
    },
    "platforms": {
        "ios": "7.0"
    },
    "requires_arc": true,
    "source": {
        "git": "https://github.com/xorshine/KafkaRefresh.git",
        "tag": "1.0.2"
    },
    "source_files": "KafkaRefresh/KafkaRefresh.h",
    "public_header_files": "KafkaRefresh/KafkaRefresh.h",
    "resources": "KafkaRefresh/Resource/**/*",
    "subspecs": [
        {
            "name": "Category",
            "source_files": "KafkaRefresh/Category/**/*",
            "public_header_files": "KafkaRefresh/Category/*.{h}"
        },
        {
            "name": "Core",
            "source_files": "KafkaRefresh/Core/**/*",
            "public_header_files": "KafkaRefresh/Core/*.{h}",
            "dependencies": {
                "KafkaRefresh/Category": []
            }
        },
        {
            "name": "Configuration",
            "source_files": "KafkaRefresh/Configuration/**/*",
            "public_header_files": "KafkaRefresh/Configuration/**/*.{h}",
            "dependencies": {
                "KafkaRefresh/UIKit/HeadKit": [],
                "KafkaRefresh/UIKit/FootKit": []
            }
        },
        {
            "name": "Default",
            "source_files": "KafkaRefresh/Default/**/*",
            "public_header_files": "KafkaRefresh/Default/**/*.{h}",
            "dependencies": {
                "KafkaRefresh/Style": []
            }
        },
        {
            "name": "Style",
            "source_files": "KafkaRefresh/Style/**/*",
            "public_header_files": "KafkaRefresh/Style/**/*.{h}"
        },
        {
            "name": "UIKit",
            "subspecs": [
                {
                    "name": "HeadKit",
                    "source_files": "KafkaRefresh/UIKit/HeadKit/**/*",
                    "public_header_files": "KafkaRefresh/UIKit/HeadKit/*.{h}",
                    "dependencies": {
                        "KafkaRefresh/UIKit/LayerKit": [],
                        "KafkaRefresh/Category": [],
                        "KafkaRefresh/Core": [],
                        "KafkaRefresh/Default": [],
                        "KafkaRefresh/Style": []
                    }
                },
                {
                    "name": "FootKit",
                    "source_files": "KafkaRefresh/UIKit/FootKit/**/*",
                    "public_header_files": "KafkaRefresh/UIKit/FootKit/*.{h}",
                    "dependencies": {
                        "KafkaRefresh/UIKit/LayerKit": [],
                        "KafkaRefresh/Category": [],
                        "KafkaRefresh/Core": [],
                        "KafkaRefresh/Default": [],
                        "KafkaRefresh/Style": []
                    }
                },
                {
                    "name": "LayerKit",
                    "source_files": "KafkaRefresh/UIKit/LayerKit/**/*",
                    "public_header_files": "KafkaRefresh/UIKit/LayerKit/*.{h}",
                    "dependencies": {
                        "KafkaRefresh/Category": [],
                        "KafkaRefresh/Default": []
                    }
                }
            ]
        }
    ]
}

Pin It on Pinterest

Share This