├── Example
├── Assets.xcassets
│ ├── Contents.json
│ ├── AppIcon.appiconset
│ │ ├── Icon.png
│ │ ├── Icon-40.png
│ │ ├── Icon-72.png
│ │ ├── Icon-76.png
│ │ ├── Icon@2x.png
│ │ ├── Icon-40@2x.png
│ │ ├── Icon-40@3x.png
│ │ ├── Icon-60@2x.png
│ │ ├── Icon-60@3x.png
│ │ ├── Icon-72@2x.png
│ │ ├── Icon-76@2x.png
│ │ ├── Icon-83.5@2x.png
│ │ ├── Icon-Small.png
│ │ ├── Icon-Small-50.png
│ │ ├── Icon-Small@2x.png
│ │ ├── Icon-Small@3x.png
│ │ ├── Icon-Small-50@2x.png
│ │ └── Contents.json
│ ├── no-wifi.imageset
│ │ ├── no-wifi.png
│ │ ├── no-wifi@2x.png
│ │ ├── no-wifi@3x.png
│ │ └── Contents.json
│ ├── LaunchImage.launchimage
│ │ ├── Default.png
│ │ ├── Default@2x.png
│ │ ├── Default~ipad.png
│ │ ├── Default-568h@2x.png
│ │ ├── Default~ipad@2x.png
│ │ ├── iPhone6-portrait@2x.png
│ │ ├── iPhonex-portrait@3x.png
│ │ ├── Default~ipad~landscape.png
│ │ ├── iPhonex-landscape@3x.png
│ │ ├── Default~ipad~nostatusbar.png
│ │ ├── iPhone6-Plus-portrait@3x.png
│ │ ├── Default~ipad~landscape@2x.png
│ │ ├── Default~ipad~nostatusbar@2x.png
│ │ ├── iPhone6-Plus-landscape@3x.png
│ │ ├── Default~ipad~landscape~nostatusbar.png
│ │ ├── Default~ipad~landscape~nostatusbar@2x.png
│ │ └── Contents.json
│ └── WebView_LoadFail_Refresh_Icon.imageset
│ │ ├── WebView_LoadFail_Refresh_Icon@2x.png
│ │ └── Contents.json
├── ViewController.h
├── AppDelegate.h
├── main.m
├── PlaceHolderView
│ ├── XTNetReloader
│ │ ├── XTNetReloader.h
│ │ └── XTNetReloader.m
│ └── WeChatStyle
│ │ ├── WeChatStylePlaceHolder.h
│ │ └── WeChatStylePlaceHolder.m
├── Info.plist
├── Base.lproj
│ └── LaunchScreen.storyboard
├── AppDelegate.m
└── ViewController.m
├── Podfile
├── CYLTableViewPlaceHolder.xcodeproj
├── project.xcworkspace
│ └── xcuserdata
│ │ ├── nidom.xcuserdatad
│ │ └── UserInterfaceState.xcuserstate
│ │ └── chenyilong.xcuserdatad
│ │ └── UserInterfaceState.xcuserstate
├── xcuserdata
│ ├── nidom.xcuserdatad
│ │ └── xcschemes
│ │ │ ├── xcschememanagement.plist
│ │ │ └── CYLTableViewPlaceHolder.xcscheme
│ └── chenyilong.xcuserdatad
│ │ └── xcschemes
│ │ ├── xcschememanagement.plist
│ │ └── CYLTableViewPlaceHolder.xcscheme
└── project.pbxproj
├── CYLTableViewPlaceHolder.xcworkspace
└── contents.xcworkspacedata
├── Podfile.lock
├── CYLTableViewPlaceHolder
├── CYLTableViewPlaceHolder.h
├── UITableView+CYLTableViewPlaceHolder.h
├── CYLTableViewPlaceHolderDelegate.h
└── UITableView+CYLTableViewPlaceHolder.m
├── .gitignore
├── CYLTableViewPlaceHolder.podspec
├── LICENSE
└── README.md
/Example/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/Example/Assets.xcassets/AppIcon.appiconset/Icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChenYilong/CYLTableViewPlaceHolder/HEAD/Example/Assets.xcassets/AppIcon.appiconset/Icon.png
--------------------------------------------------------------------------------
/Example/Assets.xcassets/AppIcon.appiconset/Icon-40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChenYilong/CYLTableViewPlaceHolder/HEAD/Example/Assets.xcassets/AppIcon.appiconset/Icon-40.png
--------------------------------------------------------------------------------
/Example/Assets.xcassets/AppIcon.appiconset/Icon-72.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChenYilong/CYLTableViewPlaceHolder/HEAD/Example/Assets.xcassets/AppIcon.appiconset/Icon-72.png
--------------------------------------------------------------------------------
/Example/Assets.xcassets/AppIcon.appiconset/Icon-76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChenYilong/CYLTableViewPlaceHolder/HEAD/Example/Assets.xcassets/AppIcon.appiconset/Icon-76.png
--------------------------------------------------------------------------------
/Example/Assets.xcassets/AppIcon.appiconset/Icon@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChenYilong/CYLTableViewPlaceHolder/HEAD/Example/Assets.xcassets/AppIcon.appiconset/Icon@2x.png
--------------------------------------------------------------------------------
/Example/Assets.xcassets/no-wifi.imageset/no-wifi.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChenYilong/CYLTableViewPlaceHolder/HEAD/Example/Assets.xcassets/no-wifi.imageset/no-wifi.png
--------------------------------------------------------------------------------
/Example/Assets.xcassets/no-wifi.imageset/no-wifi@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChenYilong/CYLTableViewPlaceHolder/HEAD/Example/Assets.xcassets/no-wifi.imageset/no-wifi@2x.png
--------------------------------------------------------------------------------
/Example/Assets.xcassets/no-wifi.imageset/no-wifi@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChenYilong/CYLTableViewPlaceHolder/HEAD/Example/Assets.xcassets/no-wifi.imageset/no-wifi@3x.png
--------------------------------------------------------------------------------
/Example/Assets.xcassets/AppIcon.appiconset/Icon-40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChenYilong/CYLTableViewPlaceHolder/HEAD/Example/Assets.xcassets/AppIcon.appiconset/Icon-40@2x.png
--------------------------------------------------------------------------------
/Example/Assets.xcassets/AppIcon.appiconset/Icon-40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChenYilong/CYLTableViewPlaceHolder/HEAD/Example/Assets.xcassets/AppIcon.appiconset/Icon-40@3x.png
--------------------------------------------------------------------------------
/Example/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChenYilong/CYLTableViewPlaceHolder/HEAD/Example/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png
--------------------------------------------------------------------------------
/Example/Assets.xcassets/AppIcon.appiconset/Icon-60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChenYilong/CYLTableViewPlaceHolder/HEAD/Example/Assets.xcassets/AppIcon.appiconset/Icon-60@3x.png
--------------------------------------------------------------------------------
/Example/Assets.xcassets/AppIcon.appiconset/Icon-72@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChenYilong/CYLTableViewPlaceHolder/HEAD/Example/Assets.xcassets/AppIcon.appiconset/Icon-72@2x.png
--------------------------------------------------------------------------------
/Example/Assets.xcassets/AppIcon.appiconset/Icon-76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChenYilong/CYLTableViewPlaceHolder/HEAD/Example/Assets.xcassets/AppIcon.appiconset/Icon-76@2x.png
--------------------------------------------------------------------------------
/Example/Assets.xcassets/AppIcon.appiconset/Icon-83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChenYilong/CYLTableViewPlaceHolder/HEAD/Example/Assets.xcassets/AppIcon.appiconset/Icon-83.5@2x.png
--------------------------------------------------------------------------------
/Example/Assets.xcassets/AppIcon.appiconset/Icon-Small.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChenYilong/CYLTableViewPlaceHolder/HEAD/Example/Assets.xcassets/AppIcon.appiconset/Icon-Small.png
--------------------------------------------------------------------------------
/Example/Assets.xcassets/LaunchImage.launchimage/Default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChenYilong/CYLTableViewPlaceHolder/HEAD/Example/Assets.xcassets/LaunchImage.launchimage/Default.png
--------------------------------------------------------------------------------
/Example/Assets.xcassets/AppIcon.appiconset/Icon-Small-50.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChenYilong/CYLTableViewPlaceHolder/HEAD/Example/Assets.xcassets/AppIcon.appiconset/Icon-Small-50.png
--------------------------------------------------------------------------------
/Example/Assets.xcassets/AppIcon.appiconset/Icon-Small@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChenYilong/CYLTableViewPlaceHolder/HEAD/Example/Assets.xcassets/AppIcon.appiconset/Icon-Small@2x.png
--------------------------------------------------------------------------------
/Example/Assets.xcassets/AppIcon.appiconset/Icon-Small@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChenYilong/CYLTableViewPlaceHolder/HEAD/Example/Assets.xcassets/AppIcon.appiconset/Icon-Small@3x.png
--------------------------------------------------------------------------------
/Example/Assets.xcassets/AppIcon.appiconset/Icon-Small-50@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChenYilong/CYLTableViewPlaceHolder/HEAD/Example/Assets.xcassets/AppIcon.appiconset/Icon-Small-50@2x.png
--------------------------------------------------------------------------------
/Example/Assets.xcassets/LaunchImage.launchimage/Default@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChenYilong/CYLTableViewPlaceHolder/HEAD/Example/Assets.xcassets/LaunchImage.launchimage/Default@2x.png
--------------------------------------------------------------------------------
/Example/Assets.xcassets/LaunchImage.launchimage/Default~ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChenYilong/CYLTableViewPlaceHolder/HEAD/Example/Assets.xcassets/LaunchImage.launchimage/Default~ipad.png
--------------------------------------------------------------------------------
/Podfile:
--------------------------------------------------------------------------------
1 | source 'git@github.com:CocoaPods/Specs.git'
2 |
3 | target 'CYLTableViewPlaceHolder' do
4 | platform :ios , '8.0'
5 | inhibit_all_warnings!
6 | pod 'MJRefresh', '~> 3.1.15.1'
7 | end
8 |
--------------------------------------------------------------------------------
/Example/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChenYilong/CYLTableViewPlaceHolder/HEAD/Example/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x.png
--------------------------------------------------------------------------------
/Example/Assets.xcassets/LaunchImage.launchimage/Default~ipad@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChenYilong/CYLTableViewPlaceHolder/HEAD/Example/Assets.xcassets/LaunchImage.launchimage/Default~ipad@2x.png
--------------------------------------------------------------------------------
/Example/Assets.xcassets/LaunchImage.launchimage/iPhone6-portrait@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChenYilong/CYLTableViewPlaceHolder/HEAD/Example/Assets.xcassets/LaunchImage.launchimage/iPhone6-portrait@2x.png
--------------------------------------------------------------------------------
/Example/Assets.xcassets/LaunchImage.launchimage/iPhonex-portrait@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChenYilong/CYLTableViewPlaceHolder/HEAD/Example/Assets.xcassets/LaunchImage.launchimage/iPhonex-portrait@3x.png
--------------------------------------------------------------------------------
/Example/Assets.xcassets/LaunchImage.launchimage/Default~ipad~landscape.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChenYilong/CYLTableViewPlaceHolder/HEAD/Example/Assets.xcassets/LaunchImage.launchimage/Default~ipad~landscape.png
--------------------------------------------------------------------------------
/Example/Assets.xcassets/LaunchImage.launchimage/iPhonex-landscape@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChenYilong/CYLTableViewPlaceHolder/HEAD/Example/Assets.xcassets/LaunchImage.launchimage/iPhonex-landscape@3x.png
--------------------------------------------------------------------------------
/Example/Assets.xcassets/LaunchImage.launchimage/Default~ipad~nostatusbar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChenYilong/CYLTableViewPlaceHolder/HEAD/Example/Assets.xcassets/LaunchImage.launchimage/Default~ipad~nostatusbar.png
--------------------------------------------------------------------------------
/Example/Assets.xcassets/LaunchImage.launchimage/iPhone6-Plus-portrait@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChenYilong/CYLTableViewPlaceHolder/HEAD/Example/Assets.xcassets/LaunchImage.launchimage/iPhone6-Plus-portrait@3x.png
--------------------------------------------------------------------------------
/Example/Assets.xcassets/LaunchImage.launchimage/Default~ipad~landscape@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChenYilong/CYLTableViewPlaceHolder/HEAD/Example/Assets.xcassets/LaunchImage.launchimage/Default~ipad~landscape@2x.png
--------------------------------------------------------------------------------
/Example/Assets.xcassets/LaunchImage.launchimage/Default~ipad~nostatusbar@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChenYilong/CYLTableViewPlaceHolder/HEAD/Example/Assets.xcassets/LaunchImage.launchimage/Default~ipad~nostatusbar@2x.png
--------------------------------------------------------------------------------
/Example/Assets.xcassets/LaunchImage.launchimage/iPhone6-Plus-landscape@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChenYilong/CYLTableViewPlaceHolder/HEAD/Example/Assets.xcassets/LaunchImage.launchimage/iPhone6-Plus-landscape@3x.png
--------------------------------------------------------------------------------
/Example/Assets.xcassets/LaunchImage.launchimage/Default~ipad~landscape~nostatusbar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChenYilong/CYLTableViewPlaceHolder/HEAD/Example/Assets.xcassets/LaunchImage.launchimage/Default~ipad~landscape~nostatusbar.png
--------------------------------------------------------------------------------
/Example/Assets.xcassets/LaunchImage.launchimage/Default~ipad~landscape~nostatusbar@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChenYilong/CYLTableViewPlaceHolder/HEAD/Example/Assets.xcassets/LaunchImage.launchimage/Default~ipad~landscape~nostatusbar@2x.png
--------------------------------------------------------------------------------
/Example/Assets.xcassets/WebView_LoadFail_Refresh_Icon.imageset/WebView_LoadFail_Refresh_Icon@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChenYilong/CYLTableViewPlaceHolder/HEAD/Example/Assets.xcassets/WebView_LoadFail_Refresh_Icon.imageset/WebView_LoadFail_Refresh_Icon@2x.png
--------------------------------------------------------------------------------
/CYLTableViewPlaceHolder.xcodeproj/project.xcworkspace/xcuserdata/nidom.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChenYilong/CYLTableViewPlaceHolder/HEAD/CYLTableViewPlaceHolder.xcodeproj/project.xcworkspace/xcuserdata/nidom.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/CYLTableViewPlaceHolder.xcodeproj/project.xcworkspace/xcuserdata/chenyilong.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChenYilong/CYLTableViewPlaceHolder/HEAD/CYLTableViewPlaceHolder.xcodeproj/project.xcworkspace/xcuserdata/chenyilong.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/CYLTableViewPlaceHolder.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - MJRefresh (3.1.15.3)
3 |
4 | DEPENDENCIES:
5 | - MJRefresh (~> 3.1.15.1)
6 |
7 | SPEC REPOS:
8 | https://github.com/CocoaPods/Specs.git:
9 | - MJRefresh
10 |
11 | SPEC CHECKSUMS:
12 | MJRefresh: b48380ae2b927b46c4ef000de9adb8dc748e1df7
13 |
14 | PODFILE CHECKSUM: af817b67023c527c9526c9c910484475511595ce
15 |
16 | COCOAPODS: 1.5.0
17 |
--------------------------------------------------------------------------------
/CYLTableViewPlaceHolder/CYLTableViewPlaceHolder.h:
--------------------------------------------------------------------------------
1 | //
2 | // CYLTableViewPlaceHolder.h
3 | // CYLNoResultTableViewController
4 | //
5 | // Created by 微博@iOS程序犭袁 ( http://weibo.com/luohanchenyilong/ ) on 15/12/23.
6 | // Copyright © 2015年 https://github.com/ChenYilong . All rights reserved.
7 | //
8 |
9 | #import "UITableView+CYLTableViewPlaceHolder.h"
10 | #import "CYLTableViewPlaceHolderDelegate.h"
11 |
--------------------------------------------------------------------------------
/Example/ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.h
3 | // CYLNoResultTableViewController
4 | //
5 | // Created by 微博@iOS程序犭袁 ( http://weibo.com/luohanchenyilong/ ) on 15/12/22.
6 | // Copyright © 2015年 https://github.com/ChenYilong . All rights reserved.
7 | //
8 |
9 | #import
10 | #import "CYLTableViewPlaceHolder.h"
11 |
12 | @interface ViewController : UITableViewController
13 |
14 | @end
15 |
16 |
--------------------------------------------------------------------------------
/Example/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // CYLNoResultTableViewController
4 | //
5 | // Created by 微博@iOS程序犭袁 ( http://weibo.com/luohanchenyilong/ ) on 15/12/22.
6 | // Copyright © 2015年 https://github.com/ChenYilong . All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface AppDelegate : UIResponder
12 |
13 | @property (strong, nonatomic) UIWindow *window;
14 |
15 | @end
16 |
17 |
--------------------------------------------------------------------------------
/Example/Assets.xcassets/WebView_LoadFail_Refresh_Icon.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "WebView_LoadFail_Refresh_Icon@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/Example/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // CYLNoResultTableViewController
4 | //
5 | // Created by 微博@iOS程序犭袁 ( http://weibo.com/luohanchenyilong/ ) on 15/12/22.
6 | // Copyright © 2015年 https://github.com/ChenYilong . All rights reserved.
7 | //
8 |
9 | #import
10 | #import "AppDelegate.h"
11 |
12 | int main(int argc, char * argv[]) {
13 | @autoreleasepool {
14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Xcode
2 |
3 | ## Build generated
4 | build/
5 | DerivedData/
6 |
7 | ## Various settings
8 | *.pbxuser
9 | !default.pbxuser
10 | *.mode1v3
11 | !default.mode1v3
12 | *.mode2v3
13 | !default.mode2v3
14 | *.perspectivev3
15 | !default.perspectivev3
16 | xcuserdata/
17 |
18 | ## Other
19 | *.moved-aside
20 | *.xccheckout
21 | *.xcscmblueprint
22 |
23 | ## Obj-C/Swift specific
24 | *.hmap
25 | *.ipa
26 | *.dSYM.zip
27 | *.dSYM
28 |
29 | # CocoaPods
30 |
31 | Pods/
32 |
33 | *.DS_Store
34 |
--------------------------------------------------------------------------------
/Example/Assets.xcassets/no-wifi.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "no-wifi.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "no-wifi@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "no-wifi@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
--------------------------------------------------------------------------------
/Example/PlaceHolderView/XTNetReloader/XTNetReloader.h:
--------------------------------------------------------------------------------
1 | //
2 | // XTNetReloader.h
3 | // Demo_MjRefresh
4 | //
5 | // Created by TuTu on 15/12/8.
6 | // Copyright © 2015年 teason. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 |
12 | typedef void(^ReloadButtonClickBlock)() ;
13 |
14 | @interface XTNetReloader : UIView
15 |
16 | - (instancetype)initWithFrame:(CGRect)frame
17 | reloadBlock:(ReloadButtonClickBlock)reloadBlock ;
18 |
19 | - (void)showInView:(UIView *)viewWillShow ;
20 | - (void)dismiss ;
21 |
22 | @end
23 |
24 |
--------------------------------------------------------------------------------
/Example/PlaceHolderView/WeChatStyle/WeChatStylePlaceHolder.h:
--------------------------------------------------------------------------------
1 | //
2 | // WeChatStylePlaceHolder.h
3 | // CYLTableViewPlaceHolder
4 | //
5 | // Created by 陈宜龙 on 15/12/23.
6 | // Copyright © 2015年 http://weibo.com/luohanchenyilong/ ÂæÆÂçö@iOSÁ®ãÂ∫èÁä≠Ë¢Å. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @protocol WeChatStylePlaceHolderDelegate
12 |
13 | @required
14 | - (void)emptyOverlayClicked:(id)sender;
15 |
16 | @end
17 |
18 | @interface WeChatStylePlaceHolder : UIView
19 |
20 | @property (nonatomic, weak) id delegate;
21 |
22 | @end
23 |
--------------------------------------------------------------------------------
/CYLTableViewPlaceHolder.xcodeproj/xcuserdata/nidom.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | CYLTableViewPlaceHolder.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | 9ADE6FD41C29A0C500214C69
16 |
17 | primary
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/CYLTableViewPlaceHolder/UITableView+CYLTableViewPlaceHolder.h:
--------------------------------------------------------------------------------
1 | //
2 | // UITableViewController+CYLTableViewPlaceHolder.h
3 | // CYLNoResultTableViewController
4 | //
5 | // Created by 微博@iOS程序犭袁 ( http://weibo.com/luohanchenyilong/ ) on 15/12/23.
6 | // Copyright © 2015年 https://github.com/ChenYilong . All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface UITableView (CYLTableViewPlaceHolder)
12 |
13 | /*!
14 | @brief just use this method to replace `reloadData` ,and it can help you to add or remove place holder view automatically
15 | @attention this method has already reload the tableView,so do not reload tableView any more.
16 | */
17 | - (void)cyl_reloadData;
18 |
19 | @end
20 |
--------------------------------------------------------------------------------
/CYLTableViewPlaceHolder.xcodeproj/xcuserdata/chenyilong.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | CYLNoResultTableViewController.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 | CYLTableViewPlaceHolder.xcscheme
13 |
14 | orderHint
15 | 0
16 |
17 |
18 | SuppressBuildableAutocreation
19 |
20 | 9ADE6FD41C29A0C500214C69
21 |
22 | primary
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/CYLTableViewPlaceHolder/CYLTableViewPlaceHolderDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // CYLTableViewPlaceHolderDelegate.h
3 | // CYLNoResultTableViewController
4 | //
5 | // Created by 微博@iOS程序犭袁 ( http://weibo.com/luohanchenyilong/ ) on 15/12/23.
6 | // Copyright © 2015年 https://github.com/ChenYilong . All rights reserved.
7 | //
8 |
9 | @protocol CYLTableViewPlaceHolderDelegate
10 |
11 | @required
12 | /*!
13 | @brief make an empty overlay view when the tableView is empty
14 | @return an empty overlay view
15 | */
16 | - (UIView *)makePlaceHolderView;
17 |
18 | @optional
19 | /*!
20 | @brief enable tableView scroll when place holder view is showing, it is disabled by default.
21 | @attention There is no need to return NO, it will be NO by default
22 | @return enable tableView scroll, you can only return YES
23 | */
24 | - (BOOL)enableScrollWhenPlaceHolderViewShowing;
25 |
26 | @end
--------------------------------------------------------------------------------
/CYLTableViewPlaceHolder.podspec:
--------------------------------------------------------------------------------
1 | Pod::Spec.new do |s|
2 | s.name = "CYLTableViewPlaceHolder"
3 | s.version = "1.0.9"
4 | s.summary = "When UITableView(iOS) is empty,then it can automaticely make an empty overlay view "
5 | s.description = "It can observe UITableView(iOS) being empty,then automaticely make an empty overlay view as a place holder. CYLTableViewPlaceHolder is iPad and iPhone compatible."
6 | s.homepage = "https://github.com/ChenYilong/CYLTableViewPlaceHolder"
7 | s.license = { :type => 'MIT', :file => 'LICENSE' }
8 | s.author = { "ChenYilong" => "luohanchenyilong@163.com" }
9 | s.platform = :ios, '6.0'
10 | s.source = { :git => "https://github.com/ChenYilong/CYLTableViewPlaceHolder.git", :tag => s.version.to_s }
11 | s.source_files = 'CYLTableViewPlaceHolder', 'CYLTableViewPlaceHolder/**/*.{h,m}'
12 | s.requires_arc = true
13 | end
14 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2015 CYLTabBarController(https://github.com/ChenYilong/CYLTableViewPlaceHolder), L.L.C. All rights reserved.
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE
20 |
--------------------------------------------------------------------------------
/Example/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 | LSRequiresIPhoneOS
24 |
25 | UIRequiredDeviceCapabilities
26 |
27 | armv7
28 |
29 | UIRequiresFullScreen
30 |
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 | UIInterfaceOrientationLandscapeLeft
35 | UIInterfaceOrientationLandscapeRight
36 |
37 | UISupportedInterfaceOrientations~ipad
38 |
39 | UIInterfaceOrientationPortrait
40 | UIInterfaceOrientationPortraitUpsideDown
41 | UIInterfaceOrientationLandscapeLeft
42 | UIInterfaceOrientationLandscapeRight
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/Example/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/Example/AppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.m
3 | // CYLNoResultTableViewController
4 | //
5 | // Created by 微博@iOS程序犭袁 ( http://weibo.com/luohanchenyilong/ ) on 15/12/22.
6 | // Copyright © 2015年 https://github.com/ChenYilong . All rights reserved.
7 | //
8 |
9 | #import "AppDelegate.h"
10 | #import "ViewController.h"
11 |
12 | @interface AppDelegate ()
13 |
14 | @property (nonatomic, strong) UINavigationController *navigationController;
15 |
16 | @end
17 |
18 | @implementation AppDelegate
19 |
20 |
21 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
22 | if ([UINavigationBar conformsToProtocol:@protocol(UIAppearanceContainer)]) {
23 | [UINavigationBar appearance].tintColor = [UIColor whiteColor];
24 | [[UINavigationBar appearance] setTitleTextAttributes:@{NSFontAttributeName : [UIFont boldSystemFontOfSize:18], NSForegroundColorAttributeName : [UIColor whiteColor]}];
25 | [[UINavigationBar appearance] setBarTintColor:[UIColor colorWithRed:(51) / 255.f green:(171) / 255.f blue:(160) / 255.f alpha:1.f]];
26 | [[UINavigationBar appearance] setTranslucent:NO];
27 | }
28 |
29 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
30 | ViewController *vc = [[ViewController alloc] init];
31 | self.navigationController = [[UINavigationController alloc] initWithRootViewController:vc];
32 | [self.window addSubview:vc.view];
33 | self.window.rootViewController = self.navigationController;
34 | self.window.backgroundColor = [UIColor whiteColor];
35 | [self.window makeKeyAndVisible];
36 | return YES;
37 | }
38 |
39 | - (void)applicationWillResignActive:(UIApplication *)application {
40 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
41 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
42 | }
43 |
44 | - (void)applicationDidEnterBackground:(UIApplication *)application {
45 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
46 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
47 | }
48 |
49 | - (void)applicationWillEnterForeground:(UIApplication *)application {
50 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
51 | }
52 |
53 | - (void)applicationDidBecomeActive:(UIApplication *)application {
54 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
55 | }
56 |
57 | - (void)applicationWillTerminate:(UIApplication *)application {
58 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
59 | }
60 |
61 | @end
62 |
--------------------------------------------------------------------------------
/Example/PlaceHolderView/WeChatStyle/WeChatStylePlaceHolder.m:
--------------------------------------------------------------------------------
1 | //
2 | // WeChatStylePlaceHolder.m
3 | // CYLTableViewPlaceHolder
4 | //
5 | // Created by 陈宜龙 on 15/12/23.
6 | // Copyright © 2015年 http://weibo.com/luohanchenyilong/ ÂæÆÂçö@iOSÁ®ãÂ∫èÁä≠Ë¢Å. All rights reserved.
7 | //
8 |
9 | static float const kUIemptyOverlayLabelX = 0;
10 | static float const kUIemptyOverlayLabelY = 0;
11 | static float const kUIemptyOverlayLabelHeight = 20;
12 |
13 | #import "WeChatStylePlaceHolder.h"
14 |
15 | @interface WeChatStylePlaceHolder ()
16 |
17 | @property (nonatomic, strong) UIImageView *emptyOverlayImageView;
18 |
19 | @end
20 |
21 | @implementation WeChatStylePlaceHolder
22 |
23 | - (instancetype)initWithFrame:(CGRect)frame {
24 | self = [super initWithFrame:frame];
25 | if (self) {
26 | self = [self sharedInit];
27 | }
28 | return self;
29 | }
30 |
31 | - (instancetype)initWithCoder:(NSCoder *)aDecoder {
32 | self = [super initWithCoder:aDecoder];
33 | if (self) {
34 | self = [self sharedInit];
35 | }
36 | return self;
37 | }
38 |
39 | - (instancetype)sharedInit {
40 | self.backgroundColor = [UIColor whiteColor];
41 | self.backgroundColor = [UIColor whiteColor];
42 | self.contentMode = UIViewContentModeTop;
43 | [self addUIemptyOverlayImageView];
44 | [self addUIemptyOverlayLabel];
45 | [self setupUIemptyOverlay];
46 | return self;
47 | }
48 |
49 | - (void)addUIemptyOverlayImageView {
50 | self.emptyOverlayImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 150, 150)];
51 | self.emptyOverlayImageView.center = CGPointMake(CGRectGetWidth(self.frame) / 2, CGRectGetHeight(self.frame) / 2 - 100);
52 | self.emptyOverlayImageView.image = [UIImage imageNamed:@"WebView_LoadFail_Refresh_Icon"];
53 | [self addSubview:self.emptyOverlayImageView];
54 | }
55 |
56 | - (void)addUIemptyOverlayLabel {
57 | CGRect emptyOverlayViewFrame = CGRectMake(kUIemptyOverlayLabelX, kUIemptyOverlayLabelY, CGRectGetWidth(self.frame), kUIemptyOverlayLabelHeight);
58 | UILabel *emptyOverlayLabel = [[UILabel alloc] initWithFrame:emptyOverlayViewFrame];
59 | emptyOverlayLabel.textAlignment = NSTextAlignmentCenter;
60 | emptyOverlayLabel.numberOfLines = 0;
61 | emptyOverlayLabel.backgroundColor = [UIColor clearColor];
62 | emptyOverlayLabel.text = @"暂无数据,轻触屏幕重新加载";
63 | emptyOverlayLabel.font = [UIFont boldSystemFontOfSize:15];
64 | emptyOverlayLabel.frame = ({
65 | CGRect frame = emptyOverlayLabel.frame;
66 | frame.origin.y = CGRectGetMaxY(self.emptyOverlayImageView.frame) + 10;
67 | frame;
68 | });
69 | emptyOverlayLabel.textColor = [UIColor grayColor];
70 | [self addSubview:emptyOverlayLabel];
71 | }
72 |
73 | - (void)setupUIemptyOverlay {
74 | self.userInteractionEnabled = YES;
75 | UILongPressGestureRecognizer *longPressUIemptyOverlay = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(longPressUIemptyOverlay:)];
76 | [longPressUIemptyOverlay setMinimumPressDuration:0.001];
77 | [self addGestureRecognizer:longPressUIemptyOverlay];
78 | self.userInteractionEnabled = YES;
79 | }
80 |
81 | - (void)longPressUIemptyOverlay:(UILongPressGestureRecognizer *)gesture {
82 | if (gesture.state == UIGestureRecognizerStateBegan) {
83 | self.emptyOverlayImageView.alpha = 0.4;
84 | }
85 | if ( gesture.state == UIGestureRecognizerStateEnded ) {
86 | self.emptyOverlayImageView.alpha = 1;
87 | if ([self.delegate respondsToSelector:@selector(emptyOverlayClicked:)]) {
88 | [self.delegate emptyOverlayClicked:nil];
89 | }
90 | }
91 | }
92 |
93 | @end
94 |
--------------------------------------------------------------------------------
/Example/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "20x20",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "20x20",
11 | "scale" : "3x"
12 | },
13 | {
14 | "size" : "29x29",
15 | "idiom" : "iphone",
16 | "filename" : "Icon-Small.png",
17 | "scale" : "1x"
18 | },
19 | {
20 | "size" : "29x29",
21 | "idiom" : "iphone",
22 | "filename" : "Icon-Small@2x.png",
23 | "scale" : "2x"
24 | },
25 | {
26 | "size" : "29x29",
27 | "idiom" : "iphone",
28 | "filename" : "Icon-Small@3x.png",
29 | "scale" : "3x"
30 | },
31 | {
32 | "size" : "40x40",
33 | "idiom" : "iphone",
34 | "filename" : "Icon-40@2x.png",
35 | "scale" : "2x"
36 | },
37 | {
38 | "size" : "40x40",
39 | "idiom" : "iphone",
40 | "filename" : "Icon-40@3x.png",
41 | "scale" : "3x"
42 | },
43 | {
44 | "size" : "57x57",
45 | "idiom" : "iphone",
46 | "filename" : "Icon.png",
47 | "scale" : "1x"
48 | },
49 | {
50 | "size" : "57x57",
51 | "idiom" : "iphone",
52 | "filename" : "Icon@2x.png",
53 | "scale" : "2x"
54 | },
55 | {
56 | "size" : "60x60",
57 | "idiom" : "iphone",
58 | "filename" : "Icon-60@2x.png",
59 | "scale" : "2x"
60 | },
61 | {
62 | "size" : "60x60",
63 | "idiom" : "iphone",
64 | "filename" : "Icon-60@3x.png",
65 | "scale" : "3x"
66 | },
67 | {
68 | "idiom" : "ipad",
69 | "size" : "20x20",
70 | "scale" : "1x"
71 | },
72 | {
73 | "idiom" : "ipad",
74 | "size" : "20x20",
75 | "scale" : "2x"
76 | },
77 | {
78 | "size" : "29x29",
79 | "idiom" : "ipad",
80 | "filename" : "Icon-Small.png",
81 | "scale" : "1x"
82 | },
83 | {
84 | "size" : "29x29",
85 | "idiom" : "ipad",
86 | "filename" : "Icon-Small@2x.png",
87 | "scale" : "2x"
88 | },
89 | {
90 | "size" : "40x40",
91 | "idiom" : "ipad",
92 | "filename" : "Icon-40.png",
93 | "scale" : "1x"
94 | },
95 | {
96 | "size" : "40x40",
97 | "idiom" : "ipad",
98 | "filename" : "Icon-40@2x.png",
99 | "scale" : "2x"
100 | },
101 | {
102 | "size" : "50x50",
103 | "idiom" : "ipad",
104 | "filename" : "Icon-Small-50.png",
105 | "scale" : "1x"
106 | },
107 | {
108 | "size" : "50x50",
109 | "idiom" : "ipad",
110 | "filename" : "Icon-Small-50@2x.png",
111 | "scale" : "2x"
112 | },
113 | {
114 | "size" : "72x72",
115 | "idiom" : "ipad",
116 | "filename" : "Icon-72.png",
117 | "scale" : "1x"
118 | },
119 | {
120 | "size" : "72x72",
121 | "idiom" : "ipad",
122 | "filename" : "Icon-72@2x.png",
123 | "scale" : "2x"
124 | },
125 | {
126 | "size" : "76x76",
127 | "idiom" : "ipad",
128 | "filename" : "Icon-76.png",
129 | "scale" : "1x"
130 | },
131 | {
132 | "size" : "76x76",
133 | "idiom" : "ipad",
134 | "filename" : "Icon-76@2x.png",
135 | "scale" : "2x"
136 | },
137 | {
138 | "size" : "83.5x83.5",
139 | "idiom" : "ipad",
140 | "filename" : "Icon-83.5@2x.png",
141 | "scale" : "2x"
142 | },
143 | {
144 | "idiom" : "ios-marketing",
145 | "size" : "1024x1024",
146 | "scale" : "1x"
147 | }
148 | ],
149 | "info" : {
150 | "version" : 1,
151 | "author" : "xcode"
152 | }
153 | }
--------------------------------------------------------------------------------
/CYLTableViewPlaceHolder.xcodeproj/xcuserdata/nidom.xcuserdatad/xcschemes/CYLTableViewPlaceHolder.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
39 |
40 |
41 |
42 |
43 |
44 |
54 |
56 |
62 |
63 |
64 |
65 |
66 |
67 |
73 |
75 |
81 |
82 |
83 |
84 |
86 |
87 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/CYLTableViewPlaceHolder.xcodeproj/xcuserdata/chenyilong.xcuserdatad/xcschemes/CYLTableViewPlaceHolder.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
39 |
40 |
41 |
42 |
43 |
44 |
54 |
56 |
62 |
63 |
64 |
65 |
66 |
67 |
73 |
75 |
81 |
82 |
83 |
84 |
86 |
87 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/Example/PlaceHolderView/XTNetReloader/XTNetReloader.m:
--------------------------------------------------------------------------------
1 | //
2 | // XTNetReloader.m
3 | // Demo_MjRefresh
4 | //
5 | // Created by TuTu on 15/12/8.
6 | // Copyright © 2015年 teason. All rights reserved.
7 | //
8 |
9 | #define NO_WIFI_WORDS @"网络不太顺畅喔~"
10 |
11 | float const width_displayNoWifiView = 200.0 ;
12 | float const height_displayNoWifiView = 150.0 ;
13 |
14 | float const width_labelshow = 300.0 ;
15 | float const height_labelshow = 35.0 ;
16 | float const fontSize_labelshow = 17.0 ;
17 |
18 | float const flexY_lb_bt = 10.0 ;
19 |
20 | float const width_bt = 100.0 ;
21 | float const height_bt = 30.0 ;
22 | float const fontSize_bt = 15.0 ;
23 |
24 | #import "XTNetReloader.h"
25 |
26 | @interface XTNetReloader ()
27 |
28 | @property (nonatomic, strong) UIImageView *nowifiImgView ;
29 | @property (nonatomic, strong) UILabel *lb ;
30 | @property (nonatomic, strong) UIButton *bt ;
31 | @property (nonatomic, copy) ReloadButtonClickBlock reloadButtonClickBlock ;
32 |
33 | @end
34 |
35 | @implementation XTNetReloader
36 |
37 | - (void)showInView:(UIView *)viewWillShow {
38 | [viewWillShow addSubview:self] ;
39 | }
40 |
41 | - (void)dismiss {
42 | [self removeFromSuperview] ;
43 | }
44 |
45 | - (instancetype)initWithFrame:(CGRect)frame
46 | reloadBlock:(ReloadButtonClickBlock)reloadBlock {
47 | self = [super initWithFrame:frame];
48 | if (self) {
49 | self.reloadButtonClickBlock = reloadBlock ;
50 | [self setup] ;
51 | }
52 | return self;
53 | }
54 |
55 | - (void)layoutSubviews {
56 | [super layoutSubviews] ;
57 |
58 | CGRect rectWifi = CGRectZero ;
59 | rectWifi.size = CGSizeMake(width_displayNoWifiView, height_displayNoWifiView) ;
60 | rectWifi.origin.x = (self.frame.size.width - width_displayNoWifiView) / 2.0 ;
61 | rectWifi.origin.y = (self.frame.size.height - height_displayNoWifiView - height_labelshow - flexY_lb_bt - height_bt) / 2.0 ;
62 | self.nowifiImgView.frame = rectWifi ;
63 |
64 | CGRect rectLabel = CGRectZero ;
65 | rectLabel.origin.x = (self.frame.size.width - width_labelshow) / 2.0 ;
66 | rectLabel.origin.y = rectWifi.origin.y + rectWifi.size.height ;
67 | rectLabel.size = CGSizeMake(width_labelshow, height_labelshow) ;
68 | self.lb.frame = rectLabel ;
69 |
70 | CGRect rectButton = CGRectZero ;
71 | rectButton.origin.x = (self.frame.size.width - width_bt) / 2.0 ;
72 | rectButton.origin.y = rectLabel.origin.y + rectLabel.size.height + flexY_lb_bt ;
73 | rectButton.size = CGSizeMake(width_bt, height_bt) ;
74 | self.bt.frame = rectButton ;
75 | }
76 |
77 | - (void)setup {
78 | [self configure] ;
79 | [self nowifiImgView] ;
80 | [self lb] ;
81 | [self bt] ;
82 | }
83 |
84 | - (void)configure {
85 | self.backgroundColor = [UIColor whiteColor] ;
86 | }
87 |
88 | - (UIImageView *)nowifiImgView {
89 | if (!_nowifiImgView) {
90 | _nowifiImgView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"no-wifi"]] ;
91 | _nowifiImgView.contentMode = UIViewContentModeScaleAspectFit ;
92 | if (![_nowifiImgView superview]) {
93 | [self addSubview:_nowifiImgView] ;
94 | }
95 | }
96 | return _nowifiImgView ;
97 | }
98 |
99 | - (UILabel *)lb {
100 | if (!_lb) {
101 | _lb = [[UILabel alloc] init] ;
102 | _lb.text = NO_WIFI_WORDS ;
103 | _lb.font = [UIFont boldSystemFontOfSize:fontSize_labelshow] ;
104 | _lb.textAlignment = NSTextAlignmentCenter ;
105 | _lb.textColor = [UIColor darkGrayColor] ;
106 | if (![_lb superview]) {
107 | [self addSubview:_lb] ;
108 | }
109 | }
110 | return _lb ;
111 | }
112 |
113 | - (UIButton *)bt {
114 | if (!_bt) {
115 | _bt = [[UIButton alloc] init] ;
116 | [_bt setTitle:@"重新加载" forState:0] ;
117 | [_bt setTitleColor:[UIColor darkGrayColor] forState:0] ;
118 | _bt.titleLabel.font = [UIFont systemFontOfSize:fontSize_bt] ;
119 | _bt.layer.cornerRadius = 5.0f ;
120 | _bt.layer.borderWidth = 1.0f ;
121 | _bt.layer.borderColor = [UIColor darkGrayColor].CGColor ;
122 | [_bt addTarget:self action:@selector(reloadButtonClicked) forControlEvents:UIControlEventTouchUpInside] ;
123 | if (![_bt superview]) {
124 | [self addSubview:_bt] ;
125 | }
126 | }
127 | return _bt ;
128 | }
129 |
130 | - (void)reloadButtonClicked {
131 | self.reloadButtonClickBlock() ;
132 | }
133 |
134 | @end
135 |
136 |
137 |
138 |
139 |
--------------------------------------------------------------------------------
/Example/ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.m
3 | // CYLNoResultTableViewController
4 | //
5 | // Created by 微博@iOS程序犭袁 ( http://weibo.com/luohanchenyilong/ ) on 15/12/22.
6 | // Copyright © 2015年 https://github.com/ChenYilong . All rights reserved.
7 | //
8 |
9 | #import "ViewController.h"
10 | #import "MJRefresh.h"
11 | #import "XTNetReloader.h"
12 | #import "WeChatStylePlaceHolder.h"
13 |
14 | static const CGFloat CYLDuration = 1.0;
15 | #define CYLRandomData [NSString stringWithFormat:@"随机数据---%d", arc4random_uniform(1000000)]
16 |
17 | @interface ViewController ()
18 | @property (nonatomic, strong) NSMutableArray *dataSource;
19 | @property (nonatomic, assign, getter=isNoResult) BOOL noResult;
20 |
21 | @end
22 |
23 | @implementation ViewController
24 |
25 | /**
26 | * lazy load dataSource
27 | *
28 | * @return NSMutableArray
29 | */
30 | - (NSMutableArray *)dataSource {
31 | if (_dataSource == nil) {
32 | _dataSource = [[NSMutableArray alloc] init];
33 | }
34 | return _dataSource;
35 | }
36 |
37 | - (BOOL)isNoResult {
38 | _noResult = (self.dataSource.count == 0);
39 | return _noResult;
40 | }
41 |
42 | - (void)viewDidLoad {
43 | [super viewDidLoad];
44 | self.title = @"CYLTableViewPlaceHolder";
45 | self.tableView.frame = CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height);
46 | self.view.backgroundColor = [UIColor yellowColor];
47 | self.dataSource = nil;
48 | [self setUpMJRefresh];
49 | self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
50 | [self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"cell"];
51 | }
52 |
53 | - (void)viewDidAppear:(BOOL)animated {
54 | [self.tableView cyl_reloadData];
55 | }
56 |
57 | - (void)setUpMJRefresh {
58 | __unsafe_unretained __typeof(self) weakSelf = self;
59 |
60 | // 设置回调(一旦进入刷新状态就会调用这个refreshingBlock)
61 | self.tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
62 | [weakSelf loadNewData];
63 | }];
64 |
65 | // 马上进入刷新状态
66 | [self.tableView.mj_header beginRefreshing];
67 | }
68 |
69 | #pragma mark - UITableViewDataSource
70 |
71 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
72 | return self.dataSource.count;
73 | }
74 |
75 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
76 | static NSString * ID = @"cell";
77 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
78 | if (cell == nil) {
79 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:ID];
80 | }
81 |
82 | cell.textLabel.text = [NSString stringWithFormat:@"%@ - %@", @"Random Data", self.dataSource[indexPath.row]];
83 | return cell;
84 | }
85 |
86 | #pragma mark - 下拉刷新数据
87 |
88 | - (void)loadNewData {
89 | if (!self.isNoResult) {
90 | self.dataSource = nil;
91 | } else {
92 | // 1.添加假数据
93 | for (int i = 0; i<5; i++) {
94 | [self.dataSource insertObject:CYLRandomData atIndex:0];
95 | }
96 | }
97 | // 2.模拟1秒后刷新表格UI(真实开发中,可以移除这段gcd代码)
98 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(CYLDuration * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
99 | // 刷新表格
100 | [self.tableView cyl_reloadData];
101 | // 拿到当前的下拉刷新控件,结束刷新状态
102 | [self.tableView.mj_header endRefreshing];
103 | });
104 | }
105 |
106 | #pragma mark - CYLTableViewPlaceHolderDelegate Method
107 |
108 | - (UIView *)makePlaceHolderView {
109 | UIView *taobaoStyle = [self taoBaoStylePlaceHolder];
110 | UIView *weChatStyle = [self weChatStylePlaceHolder];
111 | return (arc4random_uniform(2)==0)?taobaoStyle:weChatStyle;
112 | }
113 |
114 | - (UIView *)taoBaoStylePlaceHolder {
115 | __block XTNetReloader *netReloader = [[XTNetReloader alloc] initWithFrame:CGRectMake(0, 0, 0, 0)
116 | reloadBlock:^{
117 | [self.tableView.mj_header beginRefreshing];
118 | }] ;
119 | return netReloader;
120 | }
121 |
122 | - (UIView *)weChatStylePlaceHolder {
123 | WeChatStylePlaceHolder *weChatStylePlaceHolder = [[WeChatStylePlaceHolder alloc] initWithFrame:self.tableView.frame];
124 | weChatStylePlaceHolder.delegate = self;
125 | return weChatStylePlaceHolder;
126 | }
127 |
128 | #pragma mark - WeChatStylePlaceHolderDelegate Method
129 |
130 | - (void)emptyOverlayClicked:(id)sender {
131 | [self.tableView.mj_header beginRefreshing];
132 | }
133 |
134 | @end
135 |
--------------------------------------------------------------------------------
/Example/Assets.xcassets/LaunchImage.launchimage/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "extent" : "full-screen",
5 | "idiom" : "iphone",
6 | "subtype" : "2436h",
7 | "filename" : "iPhonex-portrait@3x.png",
8 | "minimum-system-version" : "11.0",
9 | "orientation" : "portrait",
10 | "scale" : "3x"
11 | },
12 | {
13 | "extent" : "full-screen",
14 | "idiom" : "iphone",
15 | "subtype" : "2436h",
16 | "filename" : "iPhonex-landscape@3x.png",
17 | "minimum-system-version" : "11.0",
18 | "orientation" : "landscape",
19 | "scale" : "3x"
20 | },
21 | {
22 | "extent" : "full-screen",
23 | "idiom" : "iphone",
24 | "subtype" : "736h",
25 | "filename" : "iPhone6-Plus-portrait@3x.png",
26 | "minimum-system-version" : "8.0",
27 | "orientation" : "portrait",
28 | "scale" : "3x"
29 | },
30 | {
31 | "extent" : "full-screen",
32 | "idiom" : "iphone",
33 | "subtype" : "736h",
34 | "filename" : "iPhone6-Plus-landscape@3x.png",
35 | "minimum-system-version" : "8.0",
36 | "orientation" : "landscape",
37 | "scale" : "3x"
38 | },
39 | {
40 | "extent" : "full-screen",
41 | "idiom" : "iphone",
42 | "subtype" : "667h",
43 | "filename" : "iPhone6-portrait@2x.png",
44 | "minimum-system-version" : "8.0",
45 | "orientation" : "portrait",
46 | "scale" : "2x"
47 | },
48 | {
49 | "orientation" : "portrait",
50 | "idiom" : "iphone",
51 | "filename" : "Default@2x.png",
52 | "extent" : "full-screen",
53 | "minimum-system-version" : "7.0",
54 | "scale" : "2x"
55 | },
56 | {
57 | "extent" : "full-screen",
58 | "idiom" : "iphone",
59 | "subtype" : "retina4",
60 | "filename" : "Default-568h@2x.png",
61 | "minimum-system-version" : "7.0",
62 | "orientation" : "portrait",
63 | "scale" : "2x"
64 | },
65 | {
66 | "orientation" : "portrait",
67 | "idiom" : "ipad",
68 | "filename" : "Default~ipad~nostatusbar.png",
69 | "extent" : "full-screen",
70 | "minimum-system-version" : "7.0",
71 | "scale" : "1x"
72 | },
73 | {
74 | "orientation" : "landscape",
75 | "idiom" : "ipad",
76 | "filename" : "Default~ipad~landscape~nostatusbar.png",
77 | "extent" : "full-screen",
78 | "minimum-system-version" : "7.0",
79 | "scale" : "1x"
80 | },
81 | {
82 | "orientation" : "portrait",
83 | "idiom" : "ipad",
84 | "filename" : "Default~ipad~nostatusbar@2x.png",
85 | "extent" : "full-screen",
86 | "minimum-system-version" : "7.0",
87 | "scale" : "2x"
88 | },
89 | {
90 | "orientation" : "landscape",
91 | "idiom" : "ipad",
92 | "filename" : "Default~ipad~landscape~nostatusbar@2x.png",
93 | "extent" : "full-screen",
94 | "minimum-system-version" : "7.0",
95 | "scale" : "2x"
96 | },
97 | {
98 | "orientation" : "portrait",
99 | "idiom" : "iphone",
100 | "filename" : "Default.png",
101 | "extent" : "full-screen",
102 | "scale" : "1x"
103 | },
104 | {
105 | "orientation" : "portrait",
106 | "idiom" : "iphone",
107 | "filename" : "Default@2x.png",
108 | "extent" : "full-screen",
109 | "scale" : "2x"
110 | },
111 | {
112 | "orientation" : "portrait",
113 | "idiom" : "iphone",
114 | "filename" : "Default-568h@2x.png",
115 | "extent" : "full-screen",
116 | "subtype" : "retina4",
117 | "scale" : "2x"
118 | },
119 | {
120 | "orientation" : "portrait",
121 | "idiom" : "ipad",
122 | "filename" : "Default~ipad.png",
123 | "extent" : "to-status-bar",
124 | "scale" : "1x"
125 | },
126 | {
127 | "orientation" : "portrait",
128 | "idiom" : "ipad",
129 | "filename" : "Default~ipad~nostatusbar.png",
130 | "extent" : "full-screen",
131 | "scale" : "1x"
132 | },
133 | {
134 | "orientation" : "landscape",
135 | "idiom" : "ipad",
136 | "filename" : "Default~ipad~landscape.png",
137 | "extent" : "to-status-bar",
138 | "scale" : "1x"
139 | },
140 | {
141 | "orientation" : "landscape",
142 | "idiom" : "ipad",
143 | "filename" : "Default~ipad~landscape~nostatusbar.png",
144 | "extent" : "full-screen",
145 | "scale" : "1x"
146 | },
147 | {
148 | "orientation" : "portrait",
149 | "idiom" : "ipad",
150 | "filename" : "Default~ipad@2x.png",
151 | "extent" : "to-status-bar",
152 | "scale" : "2x"
153 | },
154 | {
155 | "orientation" : "portrait",
156 | "idiom" : "ipad",
157 | "filename" : "Default~ipad~nostatusbar@2x.png",
158 | "extent" : "full-screen",
159 | "scale" : "2x"
160 | },
161 | {
162 | "orientation" : "landscape",
163 | "idiom" : "ipad",
164 | "filename" : "Default~ipad~landscape@2x.png",
165 | "extent" : "to-status-bar",
166 | "scale" : "2x"
167 | },
168 | {
169 | "orientation" : "landscape",
170 | "idiom" : "ipad",
171 | "filename" : "Default~ipad~landscape~nostatusbar@2x.png",
172 | "extent" : "full-screen",
173 | "scale" : "2x"
174 | }
175 | ],
176 | "info" : {
177 | "version" : 1,
178 | "author" : "xcode"
179 | }
180 | }
--------------------------------------------------------------------------------
/CYLTableViewPlaceHolder/UITableView+CYLTableViewPlaceHolder.m:
--------------------------------------------------------------------------------
1 | //
2 | // UITableViewController+CYLEmptyReloader.m
3 | // CYLNoResultTableViewController
4 | //
5 | // Created by 微博@iOS程序犭袁 ( http://weibo.com/luohanchenyilong/ ) on 15/12/23.
6 | // Copyright © 2015年 https://github.com/ChenYilong . All rights reserved.
7 | //
8 |
9 | #import "UITableView+CYLTableViewPlaceHolder.h"
10 | #import "CYLTableViewPlaceHolderDelegate.h"
11 |
12 | #import
13 |
14 | @interface UITableView ()
15 |
16 | @property (nonatomic, assign) BOOL scrollWasEnabled;
17 | @property (nonatomic, strong) UIView *placeHolderView;
18 |
19 | @end
20 |
21 | @implementation UITableView (CYLTableViewPlaceHolder)
22 |
23 | - (BOOL)scrollWasEnabled {
24 | NSNumber *scrollWasEnabledObject = objc_getAssociatedObject(self, @selector(scrollWasEnabled));
25 | return [scrollWasEnabledObject boolValue];
26 | }
27 |
28 | - (void)setScrollWasEnabled:(BOOL)scrollWasEnabled {
29 | NSNumber *scrollWasEnabledObject = [NSNumber numberWithBool:scrollWasEnabled];
30 | objc_setAssociatedObject(self, @selector(scrollWasEnabled), scrollWasEnabledObject, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
31 | }
32 |
33 | - (UIView *)placeHolderView {
34 | return objc_getAssociatedObject(self, @selector(placeHolderView));
35 | }
36 |
37 | - (void)setPlaceHolderView:(UIView *)placeHolderView {
38 | objc_setAssociatedObject(self, @selector(placeHolderView), placeHolderView, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
39 | }
40 |
41 | - (void)cyl_reloadData {
42 | [self reloadData];
43 | [self cyl_checkEmpty];
44 | }
45 |
46 | - (void)cyl_checkEmpty {
47 | BOOL isEmpty = YES;
48 |
49 | id src = self.dataSource;
50 | NSInteger sections = 1;
51 | if ([src respondsToSelector: @selector(numberOfSectionsInTableView:)]) {
52 | sections = [src numberOfSectionsInTableView:self];
53 | }
54 | for (int i = 0; i
4 | 
5 |  
6 |
7 |
8 | ## 导航
9 |
10 | 1. [ 与其他框架的区别 ](https://github.com/ChenYilong/CYLTableViewPlaceHolder#与其他框架的区别)
11 | 2. [ 集成后的效果 ](https://github.com/ChenYilong/CYLTableViewPlaceHolder#集成后的效果)
12 | 3. [ 使用CYLTableViewPlaceHolder ](https://github.com/ChenYilong/CYLTableViewPlaceHolder#使用cyltableviewplaceholder)
13 | 4. [ 运行Demo ](https://github.com/ChenYilong/CYLTableViewPlaceHolder#运行demo)
14 | 5. [ 适用于多种应用应用场景 ](https://github.com/ChenYilong/CYLTableViewPlaceHolder#适用于多种应用应用场景)
15 | 1. [ 网络故障 ](https://github.com/ChenYilong/CYLTableViewPlaceHolder#网络故障)
16 | 2. [ 暂无数据 ](https://github.com/ChenYilong/CYLTableViewPlaceHolder#暂无数据)
17 |
18 |
19 | ## 与其他框架的区别
20 | -| 特点 |解释
21 | -------------|-------------|-------------
22 | 1 | 轻量级、无污染 | 基于 UITableView 分类,无污染,比基于子类化、继承的框架更加轻量级
23 | 2 | 低耦合 | 自定义占位视图的可自行实现,通过协议传递,耦合性极低。
24 | 3 | 简单,无学习成本 | 一行代码完成,仅需使用 `cyl_reloadData` 代替 `reloadData` 即可。自动检测是否需要 `addSubview` 和 `removeFromSuperview` ,省去学习繁琐的 add 和 remove 的调用时机。
25 | 4 | 使用方法简单 | [CYLTableViewPlaceHolder](https://github.com/ChenYilong/CYLTableViewPlaceHolder) 基于 `dataSource` 数据源,所以只需操作 `dataSource` 数据源,即可完成占位视图的 `addSubview` 和 `removeFromSuperview` 的时机,更加直观。搭配 MJRefresh 使用十分方便,demo 中也给出了搭配使用方法。
26 | 5 |支持CocoaPods |容易集成
27 |
28 | (学习交流群:465239521)
29 |
30 |
31 |
32 | ## 集成后的效果
33 |
34 | 
35 |
36 | ## 使用[CYLTableViewPlaceHolder](https://github.com/ChenYilong/CYLTableViewPlaceHolder)
37 |
38 | 三步完成:
39 |
40 | 1. [ 第一步:使用cocoaPods导入CYLTableViewPlaceHolder ](https://github.com/ChenYilong/CYLTableViewPlaceHolder#第一步使用cocoapods导入cyltableviewplaceholder)
41 | 2. [第二步:遵循协议](https://github.com/ChenYilong/CYLTableViewPlaceHolder#第二步遵循协议)
42 | 3. [第三步:使用cyl_reloadData代替reloadData](https://github.com/ChenYilong/CYLTableViewPlaceHolder#第三步使用cyl_reloaddata代替reloaddata)
43 |
44 |
45 | ### 第一步:使用CocoaPods导入CYLTableViewPlaceHolder
46 |
47 |
48 | 在 `Podfile` 中进行如下导入:
49 |
50 |
51 | ```Objective-C
52 | pod 'CYLTableViewPlaceHolder'
53 | ```
54 |
55 |
56 |
57 | 然后使用 `cocoaPods` 进行安装:
58 |
59 | 如果尚未安装 CocoaPods, 运行以下命令进行安装:
60 |
61 |
62 | ```Objective-C
63 | gem install cocoapods
64 | ```
65 |
66 |
67 | 安装成功后就可以安装依赖了:
68 |
69 | 建议使用如下方式:
70 |
71 |
72 | ```Objective-C
73 | # 禁止升级CocoaPods的spec仓库,否则会卡在 Analyzing dependencies ,非常慢
74 | pod update --verbose --no-repo-update
75 | ```
76 |
77 |
78 | 如果提示找不到库,则可去掉 --no-repo-update
79 |
80 |
81 | ```Objective-C
82 | pod update
83 | ```
84 |
85 |
86 |
87 | ### 第二步:遵循协议
88 |
89 |
90 |
91 | 导入头文件
92 |
93 | ```Objective-C
94 | #import "CYLTableViewPlaceHolder.h"
95 | ```
96 |
97 | 遵循协议
98 |
99 | ```Objective-C
100 | @interface ViewController ()
101 | ```
102 |
103 |
104 |
105 | 实现协议方法:
106 |
107 | 仅一个必须实现的协议方法:
108 |
109 | 创建一个自定义的占位视图并返回
110 |
111 | ```Objective-C
112 | @required
113 | /*!
114 | @brief make an empty overlay view when the tableView is empty
115 | @return an empty overlay view
116 | */
117 | - (UIView *)makePlaceHolderView;
118 | ```
119 |
120 | 这里注意两点:
121 |
122 |
123 | 1. [CYLTableViewPlaceHolder](https://github.com/ChenYilong/CYLTableViewPlaceHolder) 的 `cyl_reloadData`方法内部会重新将该占位视图的 frame 进行设置,设置为与当前的的 `TableView` 一致:包括 xy 坐标和宽高。防止 `TableView` 位置或尺寸的变更。
124 | 2. 以上步骤,包括遵循协议实现协议方法,既可以在自定义的 `TableView` 中去做,也可以在 `TableView` 的代理中去做。
125 |
126 | 既可以让代理遵循协议,实现协议方法:
127 |
128 | ```Objective-C
129 | @interface ViewController ()
130 | ```
131 |
132 | 也可以让自定义的 `TableView` 遵循协议,实现协议方法:
133 |
134 | ```Objective-C
135 | @interface MyTableView ()
136 | ```
137 |
138 | 这里推荐在自定义的 `TableView` 中实现,以降低耦合性,同时也可以为 Controller 瘦身。
139 |
140 | 占位视图的点击事件等,请自行在 `- (UIView *)makePlaceHolderView;` 中所创建的 View 中实现。
141 |
142 | 另外,占位视图默认的设置是不能滚动的,也就不能下拉刷新了,但是如果想让占位视图可以滚动,则需要实现下面的可选代理方法。
143 |
144 | ```Objective-C
145 | @optional
146 | /*!
147 | @brief enable tableView scroll when place holder view is showing,it is disabled by default.
148 | @attention There is no need to return NO , it will be NO by default
149 | @return enable tableView scroll, you can only return YES
150 | */
151 | - (BOOL)enableScrollWhenPlaceHolderViewShowing;
152 | ```
153 |
154 |
155 |
156 | ### 第三步:使用cyl_reloadData代替reloadData
157 |
158 | 使用方法:
159 |
160 | 仅需使用 `cyl_reloadData` 代替 `reloadData` 即可。
161 |
162 | ```Objective-C
163 | [self.tableView cyl_reloadData];
164 | ```
165 |
166 | 注意: `cyl_reloadData` 内部已经实现了 `[self.tableView reloadData]; ` 方法,请避免重复调用。
167 |
168 | ## 运行Demo
169 |
170 | demo 的刷新组件使用的是 MJRefresh,所以需要导入相应的 CocoaPods 库
171 |
172 |
173 |
174 | ```Objective-C
175 | # 打开终端,进入 clone 的文件夹
176 | cd /Users/YourUserName/Documents/CYLTableViewPlaceHolder
177 | # 如果提示找不到库,则可去掉 --no-repo-update
178 | pod install --verbose --no-repo-update
179 | open CYLTableViewPlaceHolder.xcworkspace
180 | ```
181 |
182 |
183 | ## 适用于多种应用应用场景
184 |
185 | [CYLTableViewPlaceHolder](https://github.com/ChenYilong/CYLTableViewPlaceHolder) 是基于 `dataSource` 数据源是否为空,所以只需操作 `dataSource` 数据源,即可完成占位视图的 `。只要为空就会触发。并且每次在操作占位视图的 `addSubview` 和 `removeFromSuperview` 时,每次都会将旧的销毁,并触发 `- (UIView *)makePlaceHolderView` 创建一个新的视图。如果在该方法中进行 if 判断,也就能适用于不同的场景。
186 |
187 | 1. [ 网络故障 ](https://github.com/ChenYilong/CYLTableViewPlaceHolder#网络故障)
188 | 1. [ 网络不可用,禁止重新加载 ](https://github.com/ChenYilong/CYLTableViewPlaceHolder#网络不可用禁止重新加载)
189 | 2. [ 暂无数据 ](https://github.com/ChenYilong/CYLTableViewPlaceHolder#暂无数据)
190 |
191 | ### 网络故障
192 |
193 | 适用于那些造成 dataSource 为空的原因只能是网络故障,比如首页、团购列表、商品列表等
194 |
195 | 比如
196 |
197 | 携程 网络故障 | 携程 网络故障 | 携程 网络故障
198 | -------------|-------------|-------------
199 |  |  | 
200 |
201 | 代码实现时直接返回网络故障占位视图,用伪代码表示则是:
202 |
203 | ```Objective-C
204 | - (UIView *)makePlaceHolderView {
205 | return NetNotAvailableView;
206 | }
207 | ```
208 |
209 |
210 |
211 | #### 网络不可用,禁止重新加载
212 |
213 | 如果此时检测到网络断开可以禁止用户刷新的行为,比如:
214 |
215 | QQ空间 | 苏宁易购 | 嘟嘟美甲
216 | -------------|-------------|-------------
217 |  | ||
218 |
219 |
220 |
221 |
222 | ### 暂无数据
223 |
224 | 适用于那些造成 dataSource 为空的原因不仅有网络故障,也可能是确实是服务端也没有数据,这种场景下需要判断下当前网络再返回占位视图,比如:
225 |
226 |
227 |
228 |
229 | App | 暂无数据 | 网络故障
230 | -------------|------------- | ---------
231 | 百度传课 |  |
232 |
233 |
234 |
235 | 暂无数据 | 暂无数据(美团)
236 | -------------|-------------
237 |  | 
238 |
239 |
240 | 代码实现,用伪代码表示则是:
241 |
242 |
243 | ```Objective-C
244 | - (UIView *)makePlaceHolderView {
245 | if (NetNotAvailable) {
246 | return NetNotAvailableView;
247 | } else {
248 | return NoDataView;
249 | }
250 | }
251 | ```
252 |
253 |
254 | ### 网络不可达场景
255 |
256 |
257 | - | 应用场景之加载失败 | ---
258 | -------------|-------------|-------------
259 |  |  | 
260 |  |  | 
261 |  |  | 
262 |  |  | 
263 |  |  | 
264 |  |  | 
265 |  |  | 
266 |  |  | 
267 |  | | 
268 |  | |
269 | |  |
270 |
271 |
272 |
273 | (更多iOS开发干货,欢迎关注 [微博@iOS程序犭袁](http://weibo.com/luohanchenyilong/) )
274 |
275 | ----------
276 | Posted by [微博@iOS程序犭袁](http://weibo.com/luohanchenyilong/)
277 | 原创文章,版权声明:自由转载-非商用-非衍生-保持署名 | [Creative Commons BY-NC-ND 3.0](http://creativecommons.org/licenses/by-nc-nd/3.0/deed.zh)
278 |
279 |
--------------------------------------------------------------------------------
/CYLTableViewPlaceHolder.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 9A68F2E61C2A67E800D2E9B0 /* UITableView+CYLTableViewPlaceHolder.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A68F2E51C2A67E800D2E9B0 /* UITableView+CYLTableViewPlaceHolder.m */; };
11 | 9A68F2F61C2A67F700D2E9B0 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A68F2E91C2A67F600D2E9B0 /* AppDelegate.m */; };
12 | 9A68F2F71C2A67F700D2E9B0 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9A68F2EA1C2A67F600D2E9B0 /* Assets.xcassets */; };
13 | 9A68F2F81C2A67F700D2E9B0 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9A68F2EB1C2A67F700D2E9B0 /* LaunchScreen.storyboard */; };
14 | 9A68F2FB1C2A67F700D2E9B0 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A68F2F01C2A67F700D2E9B0 /* main.m */; };
15 | 9A68F2FC1C2A67F700D2E9B0 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A68F2F21C2A67F700D2E9B0 /* ViewController.m */; };
16 | 9A91C46D1C2A88020007284C /* XTNetReloader.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A91C46C1C2A88020007284C /* XTNetReloader.m */; };
17 | 9A91C4701C2A88290007284C /* WeChatStylePlaceHolder.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A91C46F1C2A88290007284C /* WeChatStylePlaceHolder.m */; };
18 | F4A926DFC982A7AEB98E1B12 /* libPods-CYLTableViewPlaceHolder.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9EB4DBA5E44F2D283EDB316C /* libPods-CYLTableViewPlaceHolder.a */; };
19 | /* End PBXBuildFile section */
20 |
21 | /* Begin PBXFileReference section */
22 | 5F359A443CF30F79AB578C54 /* Pods-CYLTableViewPlaceHolder.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CYLTableViewPlaceHolder.debug.xcconfig"; path = "Pods/Target Support Files/Pods-CYLTableViewPlaceHolder/Pods-CYLTableViewPlaceHolder.debug.xcconfig"; sourceTree = ""; };
23 | 74224AFF19B3C33D313756FC /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; };
24 | 7F27CE38CFEAC36D07942C50 /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = ""; };
25 | 8BD37F2AD1CB081E05776118 /* Pods-CYLTableViewPlaceHolder.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CYLTableViewPlaceHolder.release.xcconfig"; path = "Pods/Target Support Files/Pods-CYLTableViewPlaceHolder/Pods-CYLTableViewPlaceHolder.release.xcconfig"; sourceTree = ""; };
26 | 9A68F2E21C2A67E800D2E9B0 /* CYLTableViewPlaceHolder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CYLTableViewPlaceHolder.h; sourceTree = ""; };
27 | 9A68F2E31C2A67E800D2E9B0 /* CYLTableViewPlaceHolderDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CYLTableViewPlaceHolderDelegate.h; sourceTree = ""; };
28 | 9A68F2E41C2A67E800D2E9B0 /* UITableView+CYLTableViewPlaceHolder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UITableView+CYLTableViewPlaceHolder.h"; sourceTree = ""; };
29 | 9A68F2E51C2A67E800D2E9B0 /* UITableView+CYLTableViewPlaceHolder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UITableView+CYLTableViewPlaceHolder.m"; sourceTree = ""; };
30 | 9A68F2E81C2A67F600D2E9B0 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; };
31 | 9A68F2E91C2A67F600D2E9B0 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; };
32 | 9A68F2EA1C2A67F600D2E9B0 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
33 | 9A68F2EC1C2A67F700D2E9B0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
34 | 9A68F2EF1C2A67F700D2E9B0 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
35 | 9A68F2F01C2A67F700D2E9B0 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
36 | 9A68F2F11C2A67F700D2E9B0 /* ViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; };
37 | 9A68F2F21C2A67F700D2E9B0 /* ViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; };
38 | 9A91C46B1C2A88020007284C /* XTNetReloader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XTNetReloader.h; sourceTree = ""; };
39 | 9A91C46C1C2A88020007284C /* XTNetReloader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XTNetReloader.m; sourceTree = ""; };
40 | 9A91C46E1C2A88290007284C /* WeChatStylePlaceHolder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WeChatStylePlaceHolder.h; sourceTree = ""; };
41 | 9A91C46F1C2A88290007284C /* WeChatStylePlaceHolder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WeChatStylePlaceHolder.m; sourceTree = ""; };
42 | 9ADE6FD51C29A0C500214C69 /* CYLTableViewPlaceHolder.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CYLTableViewPlaceHolder.app; sourceTree = BUILT_PRODUCTS_DIR; };
43 | 9EB4DBA5E44F2D283EDB316C /* libPods-CYLTableViewPlaceHolder.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-CYLTableViewPlaceHolder.a"; sourceTree = BUILT_PRODUCTS_DIR; };
44 | A7015287120658EA03D5FB8C /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = ""; };
45 | /* End PBXFileReference section */
46 |
47 | /* Begin PBXFrameworksBuildPhase section */
48 | 9ADE6FD21C29A0C500214C69 /* Frameworks */ = {
49 | isa = PBXFrameworksBuildPhase;
50 | buildActionMask = 2147483647;
51 | files = (
52 | F4A926DFC982A7AEB98E1B12 /* libPods-CYLTableViewPlaceHolder.a in Frameworks */,
53 | );
54 | runOnlyForDeploymentPostprocessing = 0;
55 | };
56 | /* End PBXFrameworksBuildPhase section */
57 |
58 | /* Begin PBXGroup section */
59 | 7B27652ABACFC00CE98A227F /* Frameworks */ = {
60 | isa = PBXGroup;
61 | children = (
62 | 74224AFF19B3C33D313756FC /* libPods.a */,
63 | 9EB4DBA5E44F2D283EDB316C /* libPods-CYLTableViewPlaceHolder.a */,
64 | );
65 | name = Frameworks;
66 | sourceTree = "";
67 | };
68 | 97FB7FF57030726C67EE6D69 /* Pods */ = {
69 | isa = PBXGroup;
70 | children = (
71 | 7F27CE38CFEAC36D07942C50 /* Pods.debug.xcconfig */,
72 | A7015287120658EA03D5FB8C /* Pods.release.xcconfig */,
73 | 5F359A443CF30F79AB578C54 /* Pods-CYLTableViewPlaceHolder.debug.xcconfig */,
74 | 8BD37F2AD1CB081E05776118 /* Pods-CYLTableViewPlaceHolder.release.xcconfig */,
75 | );
76 | name = Pods;
77 | sourceTree = "";
78 | };
79 | 9A68F2E11C2A67E800D2E9B0 /* CYLTableViewPlaceHolder */ = {
80 | isa = PBXGroup;
81 | children = (
82 | 9A68F2E21C2A67E800D2E9B0 /* CYLTableViewPlaceHolder.h */,
83 | 9A68F2E31C2A67E800D2E9B0 /* CYLTableViewPlaceHolderDelegate.h */,
84 | 9A68F2E41C2A67E800D2E9B0 /* UITableView+CYLTableViewPlaceHolder.h */,
85 | 9A68F2E51C2A67E800D2E9B0 /* UITableView+CYLTableViewPlaceHolder.m */,
86 | );
87 | path = CYLTableViewPlaceHolder;
88 | sourceTree = "";
89 | };
90 | 9A68F2E71C2A67F600D2E9B0 /* Example */ = {
91 | isa = PBXGroup;
92 | children = (
93 | 9A68F2E81C2A67F600D2E9B0 /* AppDelegate.h */,
94 | 9A68F2E91C2A67F600D2E9B0 /* AppDelegate.m */,
95 | 9A68F2EA1C2A67F600D2E9B0 /* Assets.xcassets */,
96 | 9A68F2EB1C2A67F700D2E9B0 /* LaunchScreen.storyboard */,
97 | 9A68F2EF1C2A67F700D2E9B0 /* Info.plist */,
98 | 9A68F2F01C2A67F700D2E9B0 /* main.m */,
99 | 9A68F2F11C2A67F700D2E9B0 /* ViewController.h */,
100 | 9A68F2F21C2A67F700D2E9B0 /* ViewController.m */,
101 | 9A91C4681C2A88020007284C /* PlaceHolderView */,
102 | );
103 | path = Example;
104 | sourceTree = "";
105 | };
106 | 9A91C4681C2A88020007284C /* PlaceHolderView */ = {
107 | isa = PBXGroup;
108 | children = (
109 | 9A91C4691C2A88020007284C /* WeChatStyle */,
110 | 9A91C46A1C2A88020007284C /* XTNetReloader */,
111 | );
112 | path = PlaceHolderView;
113 | sourceTree = "";
114 | };
115 | 9A91C4691C2A88020007284C /* WeChatStyle */ = {
116 | isa = PBXGroup;
117 | children = (
118 | 9A91C46E1C2A88290007284C /* WeChatStylePlaceHolder.h */,
119 | 9A91C46F1C2A88290007284C /* WeChatStylePlaceHolder.m */,
120 | );
121 | path = WeChatStyle;
122 | sourceTree = "";
123 | };
124 | 9A91C46A1C2A88020007284C /* XTNetReloader */ = {
125 | isa = PBXGroup;
126 | children = (
127 | 9A91C46B1C2A88020007284C /* XTNetReloader.h */,
128 | 9A91C46C1C2A88020007284C /* XTNetReloader.m */,
129 | );
130 | path = XTNetReloader;
131 | sourceTree = "";
132 | };
133 | 9ADE6FCC1C29A0C500214C69 = {
134 | isa = PBXGroup;
135 | children = (
136 | 9A68F2E11C2A67E800D2E9B0 /* CYLTableViewPlaceHolder */,
137 | 9A68F2E71C2A67F600D2E9B0 /* Example */,
138 | 9ADE6FD61C29A0C500214C69 /* Products */,
139 | 97FB7FF57030726C67EE6D69 /* Pods */,
140 | 7B27652ABACFC00CE98A227F /* Frameworks */,
141 | );
142 | sourceTree = "";
143 | };
144 | 9ADE6FD61C29A0C500214C69 /* Products */ = {
145 | isa = PBXGroup;
146 | children = (
147 | 9ADE6FD51C29A0C500214C69 /* CYLTableViewPlaceHolder.app */,
148 | );
149 | name = Products;
150 | sourceTree = "";
151 | };
152 | /* End PBXGroup section */
153 |
154 | /* Begin PBXNativeTarget section */
155 | 9ADE6FD41C29A0C500214C69 /* CYLTableViewPlaceHolder */ = {
156 | isa = PBXNativeTarget;
157 | buildConfigurationList = 9ADE6FEC1C29A0C500214C69 /* Build configuration list for PBXNativeTarget "CYLTableViewPlaceHolder" */;
158 | buildPhases = (
159 | 990C3B2C4C20ECB5C082754B /* [CP] Check Pods Manifest.lock */,
160 | 3CAD2691A4D273A850EB2119 /* Check Pods Manifest.lock */,
161 | 9ADE6FD11C29A0C500214C69 /* Sources */,
162 | 9ADE6FD21C29A0C500214C69 /* Frameworks */,
163 | 9ADE6FD31C29A0C500214C69 /* Resources */,
164 | 7EFDAA84B6F015EC7B8FDCFE /* [CP] Copy Pods Resources */,
165 | );
166 | buildRules = (
167 | );
168 | dependencies = (
169 | );
170 | name = CYLTableViewPlaceHolder;
171 | productName = CYLNoResultTableViewController;
172 | productReference = 9ADE6FD51C29A0C500214C69 /* CYLTableViewPlaceHolder.app */;
173 | productType = "com.apple.product-type.application";
174 | };
175 | /* End PBXNativeTarget section */
176 |
177 | /* Begin PBXProject section */
178 | 9ADE6FCD1C29A0C500214C69 /* Project object */ = {
179 | isa = PBXProject;
180 | attributes = {
181 | LastUpgradeCheck = 0720;
182 | ORGANIZATIONNAME = "http://weibo.com/luohanchenyilong/ 微博@iOS程序犭袁";
183 | TargetAttributes = {
184 | 9ADE6FD41C29A0C500214C69 = {
185 | CreatedOnToolsVersion = 7.2;
186 | DevelopmentTeam = 2NJT7K4VZ7;
187 | };
188 | };
189 | };
190 | buildConfigurationList = 9ADE6FD01C29A0C500214C69 /* Build configuration list for PBXProject "CYLTableViewPlaceHolder" */;
191 | compatibilityVersion = "Xcode 3.2";
192 | developmentRegion = English;
193 | hasScannedForEncodings = 0;
194 | knownRegions = (
195 | en,
196 | Base,
197 | );
198 | mainGroup = 9ADE6FCC1C29A0C500214C69;
199 | productRefGroup = 9ADE6FD61C29A0C500214C69 /* Products */;
200 | projectDirPath = "";
201 | projectRoot = "";
202 | targets = (
203 | 9ADE6FD41C29A0C500214C69 /* CYLTableViewPlaceHolder */,
204 | );
205 | };
206 | /* End PBXProject section */
207 |
208 | /* Begin PBXResourcesBuildPhase section */
209 | 9ADE6FD31C29A0C500214C69 /* Resources */ = {
210 | isa = PBXResourcesBuildPhase;
211 | buildActionMask = 2147483647;
212 | files = (
213 | 9A68F2F71C2A67F700D2E9B0 /* Assets.xcassets in Resources */,
214 | 9A68F2F81C2A67F700D2E9B0 /* LaunchScreen.storyboard in Resources */,
215 | );
216 | runOnlyForDeploymentPostprocessing = 0;
217 | };
218 | /* End PBXResourcesBuildPhase section */
219 |
220 | /* Begin PBXShellScriptBuildPhase section */
221 | 3CAD2691A4D273A850EB2119 /* Check Pods Manifest.lock */ = {
222 | isa = PBXShellScriptBuildPhase;
223 | buildActionMask = 2147483647;
224 | files = (
225 | );
226 | inputPaths = (
227 | );
228 | name = "Check Pods Manifest.lock";
229 | outputPaths = (
230 | );
231 | runOnlyForDeploymentPostprocessing = 0;
232 | shellPath = /bin/sh;
233 | shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
234 | showEnvVarsInLog = 0;
235 | };
236 | 7EFDAA84B6F015EC7B8FDCFE /* [CP] Copy Pods Resources */ = {
237 | isa = PBXShellScriptBuildPhase;
238 | buildActionMask = 2147483647;
239 | files = (
240 | );
241 | inputPaths = (
242 | "${SRCROOT}/Pods/Target Support Files/Pods-CYLTableViewPlaceHolder/Pods-CYLTableViewPlaceHolder-resources.sh",
243 | "${PODS_ROOT}/MJRefresh/MJRefresh/MJRefresh.bundle",
244 | );
245 | name = "[CP] Copy Pods Resources";
246 | outputPaths = (
247 | "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/MJRefresh.bundle",
248 | );
249 | runOnlyForDeploymentPostprocessing = 0;
250 | shellPath = /bin/sh;
251 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-CYLTableViewPlaceHolder/Pods-CYLTableViewPlaceHolder-resources.sh\"\n";
252 | showEnvVarsInLog = 0;
253 | };
254 | 990C3B2C4C20ECB5C082754B /* [CP] Check Pods Manifest.lock */ = {
255 | isa = PBXShellScriptBuildPhase;
256 | buildActionMask = 2147483647;
257 | files = (
258 | );
259 | inputPaths = (
260 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
261 | "${PODS_ROOT}/Manifest.lock",
262 | );
263 | name = "[CP] Check Pods Manifest.lock";
264 | outputPaths = (
265 | "$(DERIVED_FILE_DIR)/Pods-CYLTableViewPlaceHolder-checkManifestLockResult.txt",
266 | );
267 | runOnlyForDeploymentPostprocessing = 0;
268 | shellPath = /bin/sh;
269 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
270 | showEnvVarsInLog = 0;
271 | };
272 | /* End PBXShellScriptBuildPhase section */
273 |
274 | /* Begin PBXSourcesBuildPhase section */
275 | 9ADE6FD11C29A0C500214C69 /* Sources */ = {
276 | isa = PBXSourcesBuildPhase;
277 | buildActionMask = 2147483647;
278 | files = (
279 | 9A68F2F61C2A67F700D2E9B0 /* AppDelegate.m in Sources */,
280 | 9A68F2FB1C2A67F700D2E9B0 /* main.m in Sources */,
281 | 9A68F2E61C2A67E800D2E9B0 /* UITableView+CYLTableViewPlaceHolder.m in Sources */,
282 | 9A91C4701C2A88290007284C /* WeChatStylePlaceHolder.m in Sources */,
283 | 9A68F2FC1C2A67F700D2E9B0 /* ViewController.m in Sources */,
284 | 9A91C46D1C2A88020007284C /* XTNetReloader.m in Sources */,
285 | );
286 | runOnlyForDeploymentPostprocessing = 0;
287 | };
288 | /* End PBXSourcesBuildPhase section */
289 |
290 | /* Begin PBXVariantGroup section */
291 | 9A68F2EB1C2A67F700D2E9B0 /* LaunchScreen.storyboard */ = {
292 | isa = PBXVariantGroup;
293 | children = (
294 | 9A68F2EC1C2A67F700D2E9B0 /* Base */,
295 | );
296 | name = LaunchScreen.storyboard;
297 | sourceTree = "";
298 | };
299 | /* End PBXVariantGroup section */
300 |
301 | /* Begin XCBuildConfiguration section */
302 | 9ADE6FEA1C29A0C500214C69 /* Debug */ = {
303 | isa = XCBuildConfiguration;
304 | buildSettings = {
305 | ALWAYS_SEARCH_USER_PATHS = NO;
306 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
307 | CLANG_CXX_LIBRARY = "libc++";
308 | CLANG_ENABLE_MODULES = YES;
309 | CLANG_ENABLE_OBJC_ARC = YES;
310 | CLANG_WARN_BOOL_CONVERSION = YES;
311 | CLANG_WARN_CONSTANT_CONVERSION = YES;
312 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
313 | CLANG_WARN_EMPTY_BODY = YES;
314 | CLANG_WARN_ENUM_CONVERSION = YES;
315 | CLANG_WARN_INT_CONVERSION = YES;
316 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
317 | CLANG_WARN_UNREACHABLE_CODE = YES;
318 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
319 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
320 | COPY_PHASE_STRIP = NO;
321 | DEBUG_INFORMATION_FORMAT = dwarf;
322 | ENABLE_STRICT_OBJC_MSGSEND = YES;
323 | ENABLE_TESTABILITY = YES;
324 | GCC_C_LANGUAGE_STANDARD = gnu99;
325 | GCC_DYNAMIC_NO_PIC = NO;
326 | GCC_NO_COMMON_BLOCKS = YES;
327 | GCC_OPTIMIZATION_LEVEL = 0;
328 | GCC_PREPROCESSOR_DEFINITIONS = (
329 | "DEBUG=1",
330 | "$(inherited)",
331 | );
332 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
333 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
334 | GCC_WARN_UNDECLARED_SELECTOR = YES;
335 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
336 | GCC_WARN_UNUSED_FUNCTION = YES;
337 | GCC_WARN_UNUSED_VARIABLE = YES;
338 | IPHONEOS_DEPLOYMENT_TARGET = 6.0;
339 | MTL_ENABLE_DEBUG_INFO = YES;
340 | ONLY_ACTIVE_ARCH = YES;
341 | SDKROOT = iphoneos;
342 | TARGETED_DEVICE_FAMILY = "1,2";
343 | };
344 | name = Debug;
345 | };
346 | 9ADE6FEB1C29A0C500214C69 /* Release */ = {
347 | isa = XCBuildConfiguration;
348 | buildSettings = {
349 | ALWAYS_SEARCH_USER_PATHS = NO;
350 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
351 | CLANG_CXX_LIBRARY = "libc++";
352 | CLANG_ENABLE_MODULES = YES;
353 | CLANG_ENABLE_OBJC_ARC = YES;
354 | CLANG_WARN_BOOL_CONVERSION = YES;
355 | CLANG_WARN_CONSTANT_CONVERSION = YES;
356 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
357 | CLANG_WARN_EMPTY_BODY = YES;
358 | CLANG_WARN_ENUM_CONVERSION = YES;
359 | CLANG_WARN_INT_CONVERSION = YES;
360 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
361 | CLANG_WARN_UNREACHABLE_CODE = YES;
362 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
363 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
364 | COPY_PHASE_STRIP = NO;
365 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
366 | ENABLE_NS_ASSERTIONS = NO;
367 | ENABLE_STRICT_OBJC_MSGSEND = YES;
368 | GCC_C_LANGUAGE_STANDARD = gnu99;
369 | GCC_NO_COMMON_BLOCKS = YES;
370 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
371 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
372 | GCC_WARN_UNDECLARED_SELECTOR = YES;
373 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
374 | GCC_WARN_UNUSED_FUNCTION = YES;
375 | GCC_WARN_UNUSED_VARIABLE = YES;
376 | IPHONEOS_DEPLOYMENT_TARGET = 6.0;
377 | MTL_ENABLE_DEBUG_INFO = NO;
378 | SDKROOT = iphoneos;
379 | TARGETED_DEVICE_FAMILY = "1,2";
380 | VALIDATE_PRODUCT = YES;
381 | };
382 | name = Release;
383 | };
384 | 9ADE6FED1C29A0C500214C69 /* Debug */ = {
385 | isa = XCBuildConfiguration;
386 | baseConfigurationReference = 5F359A443CF30F79AB578C54 /* Pods-CYLTableViewPlaceHolder.debug.xcconfig */;
387 | buildSettings = {
388 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
389 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
390 | DEVELOPMENT_TEAM = 2NJT7K4VZ7;
391 | INFOPLIST_FILE = "$(SRCROOT)/Example/Info.plist";
392 | IPHONEOS_DEPLOYMENT_TARGET = 6.0;
393 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
394 | OTHER_LDFLAGS = "$(inherited)";
395 | PRODUCT_BUNDLE_IDENTIFIER = ChenYilong.CYLNoResultTableViewController;
396 | PRODUCT_NAME = CYLTableViewPlaceHolder;
397 | };
398 | name = Debug;
399 | };
400 | 9ADE6FEE1C29A0C500214C69 /* Release */ = {
401 | isa = XCBuildConfiguration;
402 | baseConfigurationReference = 8BD37F2AD1CB081E05776118 /* Pods-CYLTableViewPlaceHolder.release.xcconfig */;
403 | buildSettings = {
404 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
405 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
406 | DEVELOPMENT_TEAM = 2NJT7K4VZ7;
407 | INFOPLIST_FILE = "$(SRCROOT)/Example/Info.plist";
408 | IPHONEOS_DEPLOYMENT_TARGET = 6.0;
409 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
410 | OTHER_LDFLAGS = "$(inherited)";
411 | PRODUCT_BUNDLE_IDENTIFIER = ChenYilong.CYLNoResultTableViewController;
412 | PRODUCT_NAME = CYLTableViewPlaceHolder;
413 | };
414 | name = Release;
415 | };
416 | /* End XCBuildConfiguration section */
417 |
418 | /* Begin XCConfigurationList section */
419 | 9ADE6FD01C29A0C500214C69 /* Build configuration list for PBXProject "CYLTableViewPlaceHolder" */ = {
420 | isa = XCConfigurationList;
421 | buildConfigurations = (
422 | 9ADE6FEA1C29A0C500214C69 /* Debug */,
423 | 9ADE6FEB1C29A0C500214C69 /* Release */,
424 | );
425 | defaultConfigurationIsVisible = 0;
426 | defaultConfigurationName = Release;
427 | };
428 | 9ADE6FEC1C29A0C500214C69 /* Build configuration list for PBXNativeTarget "CYLTableViewPlaceHolder" */ = {
429 | isa = XCConfigurationList;
430 | buildConfigurations = (
431 | 9ADE6FED1C29A0C500214C69 /* Debug */,
432 | 9ADE6FEE1C29A0C500214C69 /* Release */,
433 | );
434 | defaultConfigurationIsVisible = 0;
435 | defaultConfigurationName = Release;
436 | };
437 | /* End XCConfigurationList section */
438 | };
439 | rootObject = 9ADE6FCD1C29A0C500214C69 /* Project object */;
440 | }
441 |
--------------------------------------------------------------------------------