Latest 1.0.2
Homepage https://github.com/zhangxuchuan827/XCNoDataPlaceholder
License Apache License 2.0
Platforms ios 7.0
Frameworks UIKit
Authors

[License]()
[CocoaPods]()
Support

一个超级简单易用的UITableView和UICollectionView的空数据占位图,可区分实现网络错误状态和空数据状态

A super easy-to-use empty data prompt for the UITableView and UICollectionView.
Can distinguish between network error state and empty data state

img

USE

pod 'XCNoDataPlaceholder'

1.import it

2.Implementing the Delegate method

Protocol

/**
 * Empty Data Placeholder Image
 */
- (UIImage *)PlaceholderNoDataImage;

/**
 * Net Error Placeholder Image 
 * if you don't implement it , will used  - PlaceholderNoDataImage
 */
- (UIImage *)PlaceholderNetErrorImage;

/**
 * default size : 200*200
 */
- (CGSize)PlaceholderImageSize;

/**
 * image offset
 */
- (UIOffset)PlaceholderOffset;

/**
 * Refresh Button
 * you can return any UIView instance if you need
 */
- (UIButton *)PlaceholderRefreshButton;

Demo Code

<XCNoDataPlaceholderDelegate>

//-----

_tableView.placeholderImageDelegate = self;
_collectionView.placeholderImageDelegate = self;

//------

- (UIImage *) PlaceholderNoDataImage{
    return [UIImage imageNamed:@"noData"];
}

- (UIImage *)PlaceholderNetErrorImage{
    return [UIImage imageNamed:@"netErr"];
}

- (UIButton *)PlaceholderRefreshButton{
    UIButton * refreshButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 200, 40)];
    return refreshButton;
}

Net Error identifier

e.p.
[[AFNetworkReachabilityManager sharedManager]setReachabilityStatusChangeBlock:^(AFNetworkReachabilityStatus status) {
    if (status == AFNetworkReachabilityStatusNotReachable) {
        zxcPlaceholderNetState = NO;
    }else{
        zxcPlaceholderNetState = YES;
    }
}];

Attentions

由于组件是添加在BackgroundView上,所以不能随列表滑动

it cannot slide with the list, Because the it’s added to the BackgroundView

Apache License 2.0

Latest podspec

{
    "name": "XCNoDataPlaceholder",
    "version": "1.0.2",
    "summary": "u8fd9u662fu4e00u4e2au7b80u5355u6613u7528u7684u7a7au5217u8868u5360u4f4du56feu63d2u4ef6uff0cu9002u7528u4e8eUITableViewu548cUICollectionView",
    "description": "u8fd9u662fu4e00u4e2au7b80u5355u6613u7528u7684u7a7au89c6u56feu5360u4f4du56feu63d2u4ef6uff0cu9002u7528u4e8eUITableViewu548cUICollectionViewuff0cu4f7fu7528u65b9u6cd5u8d85u7ea7u7b80u5355u76f4u63a5u5f15u7528u5e76u4e14u5b9eu73b0u4ee3u7406u65b9u6cd5u5373u53ef",
    "homepage": "https://github.com/zhangxuchuan827/XCNoDataPlaceholder",
    "license": "Apache License 2.0",
    "authors": {
        "zhangxuchuan": "[email protected]"
    },
    "platforms": {
        "ios": "7.0"
    },
    "source": {
        "git": "https://github.com/zhangxuchuan827/XCNoDataPlaceholder.git",
        "tag": "1.0.2"
    },
    "source_files": [
        "XCNoDataPlaceholder",
        "XCNoDataPlaceholder/*.{h,m}"
    ],
    "public_header_files": "XCNoDataPlaceholder/*.h",
    "frameworks": "UIKit"
}

Pin It on Pinterest

Share This