Skip to content

ztongcc/XTEmptyDataSet

Repository files navigation

XTEmptyDataSet

CI Status Version License Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

XTEmptyDataSet is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'XTEmptyDataSet'

Use

Configure global Settings:

[UIView xt_setupGlobalEmptySetData:^(XTEmptyDataSetType type, XTDataSetConfig * _Nonnull config) {
    if (type == XTEmptyDataSetTypeLoading) {
        config.emptyStyle = XTDataSetStyleIndicator;
    }else if (type == XTEmptyDataSetTypeError) {
        config.emptyStyle = XTDataSetStyleTextAction;
        config.lableText = @"网络出错";
        config.buttonCornerRadius = 4;
        config.buttonBorderColor = [UIColor blueColor];
        config.buttonBorderWidth = 1;
        
        config.buttonNormalTitleColor = [UIColor blueColor];
        config.buttonTouchHandler = ^{
            NSLog(@"重试");
        };

    }else if (type == XTEmptyDataSetTypeNoData) {
        config.emptyStyle = XTDataSetStyleTextAction;
        config.lableText = @"暂无数据";
    }
}];

Use on view:

   [self xt_display:XTEmptyDataSetTypeLoading];

Use on tableView or colllectionView:

  [self.tableView xt_reloadDataIfEmptyDisplay:XTEmptyDataSetTypeNoData];

Author

zt.cheng, [email protected]

License

XTEmptyDataSet is available under the MIT license. See the LICENSE file for more info.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published