TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Feb 2017 |
Maintained by programersunny.
To run the example project, clone the repo, and run pod install
from the Example directory first.
EmptyDataKit is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "EmptyDataKit"
this kit is also added to the other repository named SBAnimation
and the demo in SBAnimation
is cleaner more clearly. so sorry that I don't want to replace this demo with SBAnimation
. so I show you the screenshot in that demo here too. you can go there to read my codes if you need to.
Add the codes when you need to use EmptyDataKit, Such as ViewDidLoad
__weak typeof(self) weakSelf = self;
EmptyDataKit *kit = [[EmptyDataKit alloc] initWithEdk_Image:[UIImage imageNamed:@"common_pic_loadFail"] edk_Message:@"aaa" edk_reloadHandler:^{
[weakSelf getData];
}];
kit.edk_error_image = [UIImage imageNamed: @""];
kit.edk_error_message = @"网络错误";
self.tableView.emptyKit = kit;
and we also provide you a enum like this
typedef NS_ENUM(NSUInteger ,EmptyDataType) {
EDK_Loading, // if there is a LoadingView, use this ,and also this is a default status.
EDK_None, // if there is some data, use this.
EDK_Empty, // if there is no data, use this.
EDK_Error // if there is some error such as network, use this.
};
so that if you want to show different image or description words you can use this. before you use reloadData
method of this tebleView or collectionView.
ProgramerSunny, [email protected]
EmptyDataKit is available under the MIT license. See the LICENSE file for more info.