├── Pods ├── Headers │ ├── Private │ │ └── MJRefresh │ │ │ ├── MJRefresh.h │ │ │ ├── MJRefreshConst.h │ │ │ ├── MJRefreshFooter.h │ │ │ ├── MJRefreshHeader.h │ │ │ ├── NSBundle+MJRefresh.h │ │ │ ├── UIView+MJExtension.h │ │ │ ├── MJRefreshAutoFooter.h │ │ │ ├── MJRefreshBackFooter.h │ │ │ ├── MJRefreshComponent.h │ │ │ ├── UIScrollView+MJRefresh.h │ │ │ ├── UIScrollView+MJExtension.h │ │ │ ├── MJRefreshGifHeader.h │ │ │ ├── MJRefreshStateHeader.h │ │ │ ├── MJRefreshNormalHeader.h │ │ │ ├── MJRefreshAutoGifFooter.h │ │ │ ├── MJRefreshBackGifFooter.h │ │ │ ├── MJRefreshAutoNormalFooter.h │ │ │ ├── MJRefreshAutoStateFooter.h │ │ │ ├── MJRefreshBackNormalFooter.h │ │ │ └── MJRefreshBackStateFooter.h │ └── Public │ │ └── MJRefresh │ │ ├── MJRefresh.h │ │ ├── MJRefreshConst.h │ │ ├── MJRefreshFooter.h │ │ ├── MJRefreshHeader.h │ │ ├── NSBundle+MJRefresh.h │ │ ├── UIView+MJExtension.h │ │ ├── MJRefreshAutoFooter.h │ │ ├── MJRefreshBackFooter.h │ │ ├── MJRefreshComponent.h │ │ ├── UIScrollView+MJRefresh.h │ │ ├── MJRefreshGifHeader.h │ │ ├── UIScrollView+MJExtension.h │ │ ├── MJRefreshStateHeader.h │ │ ├── MJRefreshNormalHeader.h │ │ ├── MJRefreshAutoGifFooter.h │ │ ├── MJRefreshBackGifFooter.h │ │ ├── MJRefreshAutoNormalFooter.h │ │ ├── MJRefreshAutoStateFooter.h │ │ ├── MJRefreshBackNormalFooter.h │ │ └── MJRefreshBackStateFooter.h ├── MJRefresh │ ├── MJRefresh │ │ ├── MJRefresh.bundle │ │ │ ├── arrow@2x.png │ │ │ ├── zh-Hans.lproj │ │ │ │ └── Localizable.strings │ │ │ ├── zh-Hant.lproj │ │ │ │ └── Localizable.strings │ │ │ └── en.lproj │ │ │ │ └── Localizable.strings │ │ ├── Base │ │ │ ├── MJRefreshBackFooter.h │ │ │ ├── MJRefreshAutoFooter.h │ │ │ ├── MJRefreshHeader.h │ │ │ ├── MJRefreshFooter.h │ │ │ ├── MJRefreshFooter.m │ │ │ ├── MJRefreshComponent.h │ │ │ ├── MJRefreshAutoFooter.m │ │ │ ├── MJRefreshBackFooter.m │ │ │ └── MJRefreshHeader.m │ │ ├── Custom │ │ │ ├── Footer │ │ │ │ ├── Auto │ │ │ │ │ ├── MJRefreshAutoNormalFooter.h │ │ │ │ │ ├── MJRefreshAutoGifFooter.h │ │ │ │ │ ├── MJRefreshAutoStateFooter.h │ │ │ │ │ ├── MJRefreshAutoNormalFooter.m │ │ │ │ │ ├── MJRefreshAutoStateFooter.m │ │ │ │ │ └── MJRefreshAutoGifFooter.m │ │ │ │ └── Back │ │ │ │ │ ├── MJRefreshBackNormalFooter.h │ │ │ │ │ ├── MJRefreshBackGifFooter.h │ │ │ │ │ ├── MJRefreshBackStateFooter.h │ │ │ │ │ ├── MJRefreshBackStateFooter.m │ │ │ │ │ ├── MJRefreshBackGifFooter.m │ │ │ │ │ └── MJRefreshBackNormalFooter.m │ │ │ └── Header │ │ │ │ ├── MJRefreshNormalHeader.h │ │ │ │ ├── MJRefreshGifHeader.h │ │ │ │ ├── MJRefreshStateHeader.h │ │ │ │ ├── MJRefreshGifHeader.m │ │ │ │ ├── MJRefreshNormalHeader.m │ │ │ │ └── MJRefreshStateHeader.m │ │ ├── NSBundle+MJRefresh.h │ │ ├── MJRefresh.h │ │ ├── UIView+MJExtension.h │ │ ├── UIScrollView+MJExtension.h │ │ ├── UIScrollView+MJRefresh.h │ │ ├── UIView+MJExtension.m │ │ ├── MJRefreshConst.m │ │ ├── NSBundle+MJRefresh.m │ │ ├── MJRefreshConst.h │ │ ├── UIScrollView+MJExtension.m │ │ └── UIScrollView+MJRefresh.m │ └── LICENSE ├── Target Support Files │ ├── MJRefresh │ │ ├── MJRefresh-dummy.m │ │ ├── MJRefresh-prefix.pch │ │ └── MJRefresh.xcconfig │ └── Pods-ZKTreeTableView │ │ ├── Pods-ZKTreeTableView-dummy.m │ │ ├── Pods-ZKTreeTableView.debug.xcconfig │ │ ├── Pods-ZKTreeTableView.release.xcconfig │ │ ├── Pods-ZKTreeTableView-acknowledgements.markdown │ │ ├── Pods-ZKTreeTableView-acknowledgements.plist │ │ └── Pods-ZKTreeTableView-resources.sh ├── Manifest.lock └── Pods.xcodeproj │ └── xcuserdata │ └── bestdew.xcuserdatad │ └── xcschemes │ ├── xcschememanagement.plist │ ├── MJRefresh.xcscheme │ └── Pods-ZKTreeTableView.xcscheme ├── ZKTreeTableView ├── Untitled.gif ├── Assets.xcassets │ ├── Contents.json │ ├── 弹出提示.imageset │ │ ├── 弹出提示@2x.png │ │ ├── 弹出提示@3x.png │ │ └── Contents.json │ ├── 椭圆形.imageset │ │ ├── 椭圆形@2x.png │ │ ├── 椭圆形@3x.png │ │ └── Contents.json │ ├── arrow.imageset │ │ ├── arrow@2x.png │ │ ├── arrow@3x.png │ │ └── Contents.json │ ├── share.imageset │ │ ├── share@2x.png │ │ ├── share@3x.png │ │ └── Contents.json │ ├── touxiang_nv.imageset │ │ ├── touxiang_nv@2x.png │ │ ├── touxiang_nv@3x.png │ │ └── Contents.json │ ├── share_normal.imageset │ │ ├── share_normal@2x.png │ │ ├── share_normal@3x.png │ │ └── Contents.json │ ├── touxiang_nan.imageset │ │ ├── touxiang_nan@2x.png │ │ ├── touxiang_nan@3x.png │ │ └── Contents.json │ ├── ic_comment_new.imageset │ │ ├── ic_comment_new@2x.png │ │ ├── ic_comment_new@3x.png │ │ └── Contents.json │ ├── select_top_icon.imageset │ │ ├── select_top_icon@2x.png │ │ ├── select_top_icon@3x.png │ │ └── Contents.json │ ├── select_down_icon.imageset │ │ ├── select_down_icon@2x.png │ │ ├── select_down_icon@3x.png │ │ └── Contents.json │ ├── options_none_icon.imageset │ │ ├── options_none_icon@2x.png │ │ ├── options_none_icon@3x.png │ │ └── Contents.json │ ├── options_selected_icon.imageset │ │ ├── options_selected_icon@2x.png │ │ ├── options_selected_icon@3x.png │ │ └── Contents.json │ └── AppIcon.appiconset │ │ └── Contents.json ├── CheckNode.m ├── MainViewController.h ├── CheckViewController.h ├── TreeListViewController.h ├── CheckNode.h ├── AppDelegate.h ├── CommentCell.h ├── main.m ├── YYFPSLabel │ ├── YYFPSLabel.h │ ├── YYWeakProxy.h │ ├── YYWeakProxy.m │ └── YYFPSLabel.m ├── CheckCell.h ├── ZKToolBar.h ├── CommentModel.m ├── RequestHepler.h ├── CommentModel.h ├── ZKInputView.h ├── Info.plist ├── Base.lproj │ ├── Main.storyboard │ └── LaunchScreen.storyboard ├── ZKTreeListView │ ├── ZKTreeListViewCell.h │ ├── ZKTreeNode.h │ ├── ZKTreeNode.m │ ├── ZKTreeManager.h │ └── ZKTreeListView.h ├── MainViewController.m ├── AppDelegate.m ├── CheckCell.m ├── RequestHepler.m ├── ZKToolBar.m ├── CommentCell.m └── CheckViewController.m ├── ZKTreeTableView.xcodeproj ├── xcuserdata │ └── bestdew.xcuserdatad │ │ ├── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist │ │ └── xcschemes │ │ ├── xcschememanagement.plist │ │ └── ZKTreeTableView.xcscheme └── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ └── IDEWorkspaceChecks.plist ├── ZKTreeTableView.xcworkspace ├── xcuserdata │ └── bestdew.xcuserdatad │ │ └── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist ├── contents.xcworkspacedata └── xcshareddata │ └── IDEWorkspaceChecks.plist ├── Podfile.lock ├── podfile └── README.md /Pods/Headers/Private/MJRefresh/MJRefresh.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/MJRefresh.h -------------------------------------------------------------------------------- /Pods/Headers/Public/MJRefresh/MJRefresh.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/MJRefresh.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJRefresh/MJRefreshConst.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/MJRefreshConst.h -------------------------------------------------------------------------------- /Pods/Headers/Public/MJRefresh/MJRefreshConst.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/MJRefreshConst.h -------------------------------------------------------------------------------- /Pods/Headers/Public/MJRefresh/MJRefreshFooter.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/Base/MJRefreshFooter.h -------------------------------------------------------------------------------- /Pods/Headers/Public/MJRefresh/MJRefreshHeader.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/Base/MJRefreshHeader.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJRefresh/MJRefreshFooter.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/Base/MJRefreshFooter.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJRefresh/MJRefreshHeader.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/Base/MJRefreshHeader.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJRefresh/NSBundle+MJRefresh.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/NSBundle+MJRefresh.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJRefresh/UIView+MJExtension.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/UIView+MJExtension.h -------------------------------------------------------------------------------- /Pods/Headers/Public/MJRefresh/NSBundle+MJRefresh.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/NSBundle+MJRefresh.h -------------------------------------------------------------------------------- /Pods/Headers/Public/MJRefresh/UIView+MJExtension.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/UIView+MJExtension.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJRefresh/MJRefreshAutoFooter.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/Base/MJRefreshAutoFooter.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJRefresh/MJRefreshBackFooter.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/Base/MJRefreshBackFooter.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJRefresh/MJRefreshComponent.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/Base/MJRefreshComponent.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJRefresh/UIScrollView+MJRefresh.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/UIScrollView+MJRefresh.h -------------------------------------------------------------------------------- /Pods/Headers/Public/MJRefresh/MJRefreshAutoFooter.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/Base/MJRefreshAutoFooter.h -------------------------------------------------------------------------------- /Pods/Headers/Public/MJRefresh/MJRefreshBackFooter.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/Base/MJRefreshBackFooter.h -------------------------------------------------------------------------------- /Pods/Headers/Public/MJRefresh/MJRefreshComponent.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/Base/MJRefreshComponent.h -------------------------------------------------------------------------------- /Pods/Headers/Public/MJRefresh/UIScrollView+MJRefresh.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/UIScrollView+MJRefresh.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJRefresh/UIScrollView+MJExtension.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/UIScrollView+MJExtension.h -------------------------------------------------------------------------------- /Pods/Headers/Public/MJRefresh/MJRefreshGifHeader.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/Custom/Header/MJRefreshGifHeader.h -------------------------------------------------------------------------------- /Pods/Headers/Public/MJRefresh/UIScrollView+MJExtension.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/UIScrollView+MJExtension.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJRefresh/MJRefreshGifHeader.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/Custom/Header/MJRefreshGifHeader.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJRefresh/MJRefreshStateHeader.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/Custom/Header/MJRefreshStateHeader.h -------------------------------------------------------------------------------- /Pods/Headers/Public/MJRefresh/MJRefreshStateHeader.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/Custom/Header/MJRefreshStateHeader.h -------------------------------------------------------------------------------- /ZKTreeTableView/Untitled.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bestDew/ZKTreeTableView/HEAD/ZKTreeTableView/Untitled.gif -------------------------------------------------------------------------------- /Pods/Headers/Private/MJRefresh/MJRefreshNormalHeader.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/Custom/Header/MJRefreshNormalHeader.h -------------------------------------------------------------------------------- /Pods/Headers/Public/MJRefresh/MJRefreshNormalHeader.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/Custom/Header/MJRefreshNormalHeader.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJRefresh/MJRefreshAutoGifFooter.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/Custom/Footer/Auto/MJRefreshAutoGifFooter.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJRefresh/MJRefreshBackGifFooter.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/Custom/Footer/Back/MJRefreshBackGifFooter.h -------------------------------------------------------------------------------- /Pods/Headers/Public/MJRefresh/MJRefreshAutoGifFooter.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/Custom/Footer/Auto/MJRefreshAutoGifFooter.h -------------------------------------------------------------------------------- /Pods/Headers/Public/MJRefresh/MJRefreshBackGifFooter.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/Custom/Footer/Back/MJRefreshBackGifFooter.h -------------------------------------------------------------------------------- /ZKTreeTableView/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Pods/Headers/Private/MJRefresh/MJRefreshAutoNormalFooter.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/Custom/Footer/Auto/MJRefreshAutoNormalFooter.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJRefresh/MJRefreshAutoStateFooter.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/Custom/Footer/Auto/MJRefreshAutoStateFooter.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJRefresh/MJRefreshBackNormalFooter.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/Custom/Footer/Back/MJRefreshBackNormalFooter.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJRefresh/MJRefreshBackStateFooter.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/Custom/Footer/Back/MJRefreshBackStateFooter.h -------------------------------------------------------------------------------- /Pods/Headers/Public/MJRefresh/MJRefreshAutoNormalFooter.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/Custom/Footer/Auto/MJRefreshAutoNormalFooter.h -------------------------------------------------------------------------------- /Pods/Headers/Public/MJRefresh/MJRefreshAutoStateFooter.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/Custom/Footer/Auto/MJRefreshAutoStateFooter.h -------------------------------------------------------------------------------- /Pods/Headers/Public/MJRefresh/MJRefreshBackNormalFooter.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/Custom/Footer/Back/MJRefreshBackNormalFooter.h -------------------------------------------------------------------------------- /Pods/Headers/Public/MJRefresh/MJRefreshBackStateFooter.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/Custom/Footer/Back/MJRefreshBackStateFooter.h -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/MJRefresh.bundle/arrow@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bestDew/ZKTreeTableView/HEAD/Pods/MJRefresh/MJRefresh/MJRefresh.bundle/arrow@2x.png -------------------------------------------------------------------------------- /ZKTreeTableView/Assets.xcassets/弹出提示.imageset/弹出提示@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bestDew/ZKTreeTableView/HEAD/ZKTreeTableView/Assets.xcassets/弹出提示.imageset/弹出提示@2x.png -------------------------------------------------------------------------------- /ZKTreeTableView/Assets.xcassets/弹出提示.imageset/弹出提示@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bestDew/ZKTreeTableView/HEAD/ZKTreeTableView/Assets.xcassets/弹出提示.imageset/弹出提示@3x.png -------------------------------------------------------------------------------- /ZKTreeTableView/Assets.xcassets/椭圆形.imageset/椭圆形@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bestDew/ZKTreeTableView/HEAD/ZKTreeTableView/Assets.xcassets/椭圆形.imageset/椭圆形@2x.png -------------------------------------------------------------------------------- /ZKTreeTableView/Assets.xcassets/椭圆形.imageset/椭圆形@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bestDew/ZKTreeTableView/HEAD/ZKTreeTableView/Assets.xcassets/椭圆形.imageset/椭圆形@3x.png -------------------------------------------------------------------------------- /ZKTreeTableView/Assets.xcassets/arrow.imageset/arrow@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bestDew/ZKTreeTableView/HEAD/ZKTreeTableView/Assets.xcassets/arrow.imageset/arrow@2x.png -------------------------------------------------------------------------------- /ZKTreeTableView/Assets.xcassets/arrow.imageset/arrow@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bestDew/ZKTreeTableView/HEAD/ZKTreeTableView/Assets.xcassets/arrow.imageset/arrow@3x.png -------------------------------------------------------------------------------- /ZKTreeTableView/Assets.xcassets/share.imageset/share@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bestDew/ZKTreeTableView/HEAD/ZKTreeTableView/Assets.xcassets/share.imageset/share@2x.png -------------------------------------------------------------------------------- /ZKTreeTableView/Assets.xcassets/share.imageset/share@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bestDew/ZKTreeTableView/HEAD/ZKTreeTableView/Assets.xcassets/share.imageset/share@3x.png -------------------------------------------------------------------------------- /Pods/Target Support Files/MJRefresh/MJRefresh-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_MJRefresh : NSObject 3 | @end 4 | @implementation PodsDummy_MJRefresh 5 | @end 6 | -------------------------------------------------------------------------------- /ZKTreeTableView/Assets.xcassets/touxiang_nv.imageset/touxiang_nv@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bestDew/ZKTreeTableView/HEAD/ZKTreeTableView/Assets.xcassets/touxiang_nv.imageset/touxiang_nv@2x.png -------------------------------------------------------------------------------- /ZKTreeTableView/Assets.xcassets/touxiang_nv.imageset/touxiang_nv@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bestDew/ZKTreeTableView/HEAD/ZKTreeTableView/Assets.xcassets/touxiang_nv.imageset/touxiang_nv@3x.png -------------------------------------------------------------------------------- /ZKTreeTableView.xcodeproj/xcuserdata/bestdew.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /ZKTreeTableView.xcworkspace/xcuserdata/bestdew.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /ZKTreeTableView/Assets.xcassets/share_normal.imageset/share_normal@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bestDew/ZKTreeTableView/HEAD/ZKTreeTableView/Assets.xcassets/share_normal.imageset/share_normal@2x.png -------------------------------------------------------------------------------- /ZKTreeTableView/Assets.xcassets/share_normal.imageset/share_normal@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bestDew/ZKTreeTableView/HEAD/ZKTreeTableView/Assets.xcassets/share_normal.imageset/share_normal@3x.png -------------------------------------------------------------------------------- /ZKTreeTableView/Assets.xcassets/touxiang_nan.imageset/touxiang_nan@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bestDew/ZKTreeTableView/HEAD/ZKTreeTableView/Assets.xcassets/touxiang_nan.imageset/touxiang_nan@2x.png -------------------------------------------------------------------------------- /ZKTreeTableView/Assets.xcassets/touxiang_nan.imageset/touxiang_nan@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bestDew/ZKTreeTableView/HEAD/ZKTreeTableView/Assets.xcassets/touxiang_nan.imageset/touxiang_nan@3x.png -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/MJRefresh.bundle/zh-Hans.lproj/Localizable.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bestDew/ZKTreeTableView/HEAD/Pods/MJRefresh/MJRefresh/MJRefresh.bundle/zh-Hans.lproj/Localizable.strings -------------------------------------------------------------------------------- /ZKTreeTableView/Assets.xcassets/ic_comment_new.imageset/ic_comment_new@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bestDew/ZKTreeTableView/HEAD/ZKTreeTableView/Assets.xcassets/ic_comment_new.imageset/ic_comment_new@2x.png -------------------------------------------------------------------------------- /ZKTreeTableView/Assets.xcassets/ic_comment_new.imageset/ic_comment_new@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bestDew/ZKTreeTableView/HEAD/ZKTreeTableView/Assets.xcassets/ic_comment_new.imageset/ic_comment_new@3x.png -------------------------------------------------------------------------------- /ZKTreeTableView/Assets.xcassets/select_top_icon.imageset/select_top_icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bestDew/ZKTreeTableView/HEAD/ZKTreeTableView/Assets.xcassets/select_top_icon.imageset/select_top_icon@2x.png -------------------------------------------------------------------------------- /ZKTreeTableView/Assets.xcassets/select_top_icon.imageset/select_top_icon@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bestDew/ZKTreeTableView/HEAD/ZKTreeTableView/Assets.xcassets/select_top_icon.imageset/select_top_icon@3x.png -------------------------------------------------------------------------------- /ZKTreeTableView/Assets.xcassets/select_down_icon.imageset/select_down_icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bestDew/ZKTreeTableView/HEAD/ZKTreeTableView/Assets.xcassets/select_down_icon.imageset/select_down_icon@2x.png -------------------------------------------------------------------------------- /ZKTreeTableView/Assets.xcassets/select_down_icon.imageset/select_down_icon@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bestDew/ZKTreeTableView/HEAD/ZKTreeTableView/Assets.xcassets/select_down_icon.imageset/select_down_icon@3x.png -------------------------------------------------------------------------------- /ZKTreeTableView/Assets.xcassets/options_none_icon.imageset/options_none_icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bestDew/ZKTreeTableView/HEAD/ZKTreeTableView/Assets.xcassets/options_none_icon.imageset/options_none_icon@2x.png -------------------------------------------------------------------------------- /ZKTreeTableView/Assets.xcassets/options_none_icon.imageset/options_none_icon@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bestDew/ZKTreeTableView/HEAD/ZKTreeTableView/Assets.xcassets/options_none_icon.imageset/options_none_icon@3x.png -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ZKTreeTableView/Pods-ZKTreeTableView-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_ZKTreeTableView : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_ZKTreeTableView 5 | @end 6 | -------------------------------------------------------------------------------- /ZKTreeTableView/Assets.xcassets/options_selected_icon.imageset/options_selected_icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bestDew/ZKTreeTableView/HEAD/ZKTreeTableView/Assets.xcassets/options_selected_icon.imageset/options_selected_icon@2x.png -------------------------------------------------------------------------------- /ZKTreeTableView/Assets.xcassets/options_selected_icon.imageset/options_selected_icon@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bestDew/ZKTreeTableView/HEAD/ZKTreeTableView/Assets.xcassets/options_selected_icon.imageset/options_selected_icon@3x.png -------------------------------------------------------------------------------- /ZKTreeTableView.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ZKTreeTableView/CheckNode.m: -------------------------------------------------------------------------------- 1 | // 2 | // CheckNode.m 3 | // ZKTreeTableView 4 | // 5 | // Created by bestdew on 2018/9/24. 6 | // Copyright © 2018年 bestdew. All rights reserved. 7 | // 8 | 9 | #import "CheckNode.h" 10 | 11 | @implementation CheckNode 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Pods/Target Support Files/MJRefresh/MJRefresh-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /ZKTreeTableView/MainViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MainViewController.h 3 | // ZKTreeTableView 4 | // 5 | // Created by bestdew on 2018/9/4. 6 | // Copyright © 2018年 bestdew. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MainViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /ZKTreeTableView/CheckViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // CheckViewController.h 3 | // ZKTreeTableView 4 | // 5 | // Created by bestdew on 2018/9/23. 6 | // Copyright © 2018年 bestdew. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface CheckViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /ZKTreeTableView.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ZKTreeTableView.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ZKTreeTableView/TreeListViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // ZKTreeTableView 4 | // 5 | // Created by bestdew on 2018/8/29. 6 | // Copyright © 2018年 bestdew. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface TreeListViewController : UIViewController 12 | 13 | @end 14 | 15 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/Base/MJRefreshBackFooter.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshBackFooter.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshFooter.h" 10 | 11 | @interface MJRefreshBackFooter : MJRefreshFooter 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /ZKTreeTableView.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ZKTreeTableView/CheckNode.h: -------------------------------------------------------------------------------- 1 | // 2 | // CheckNode.h 3 | // ZKTreeTableView 4 | // 5 | // Created by bestdew on 2018/9/24. 6 | // Copyright © 2018年 bestdew. All rights reserved. 7 | // 8 | 9 | #import "ZKTreeNode.h" 10 | 11 | @interface CheckNode : ZKTreeNode 12 | 13 | @property (nonatomic, assign, getter=isChecked) BOOL checked; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - MJRefresh (3.1.15.6) 3 | 4 | DEPENDENCIES: 5 | - MJRefresh 6 | 7 | SPEC REPOS: 8 | https://github.com/cocoapods/specs.git: 9 | - MJRefresh 10 | 11 | SPEC CHECKSUMS: 12 | MJRefresh: 0efa19656679d70a0f47cbe76e56c2271fe53a97 13 | 14 | PODFILE CHECKSUM: bad116a5d8b67ba3c71186ea4a12d8c25801ec4a 15 | 16 | COCOAPODS: 1.5.3 17 | -------------------------------------------------------------------------------- /Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - MJRefresh (3.1.15.6) 3 | 4 | DEPENDENCIES: 5 | - MJRefresh 6 | 7 | SPEC REPOS: 8 | https://github.com/cocoapods/specs.git: 9 | - MJRefresh 10 | 11 | SPEC CHECKSUMS: 12 | MJRefresh: 0efa19656679d70a0f47cbe76e56c2271fe53a97 13 | 14 | PODFILE CHECKSUM: bad116a5d8b67ba3c71186ea4a12d8c25801ec4a 15 | 16 | COCOAPODS: 1.5.3 17 | -------------------------------------------------------------------------------- /podfile: -------------------------------------------------------------------------------- 1 | # Uncomment the next line to define a global platform for your project 2 | platform :ios, '8.0' 3 | 4 | target 'ZKTreeTableView' do 5 | # Uncomment the next line if you're using Swift or would like to use dynamic frameworks 6 | # use_frameworks! 7 | 8 | pod ‘MJRefresh’,:inhibit_warnings => true 9 | 10 | # Pods for ZKTreeTableView 11 | 12 | end 13 | -------------------------------------------------------------------------------- /ZKTreeTableView/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // ZKTreeTableView 4 | // 5 | // Created by bestdew on 2018/8/29. 6 | // Copyright © 2018年 bestdew. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /ZKTreeTableView/CommentCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // CommentCell.h 3 | // ZKTreeTableView 4 | // 5 | // Created by bestdew on 2018/8/30. 6 | // Copyright © 2018年 bestdew. All rights reserved. 7 | // 8 | 9 | #import "ZKTreeListViewCell.h" 10 | 11 | typedef void (^ExpandBlock)(ZKTreeNode *node); 12 | 13 | @interface CommentCell : ZKTreeListViewCell 14 | 15 | @property (nonatomic, copy) ExpandBlock block; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /ZKTreeTableView/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // ZKTreeTableView 4 | // 5 | // Created by bestdew on 2018/8/29. 6 | // Copyright © 2018年 bestdew. 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 | -------------------------------------------------------------------------------- /ZKTreeTableView/YYFPSLabel/YYFPSLabel.h: -------------------------------------------------------------------------------- 1 | // 2 | // YYFPSLabel.h 3 | // YYKitExample 4 | // 5 | // Created by ibireme on 15/9/3. 6 | // Copyright (c) 2015 ibireme. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /** 12 | Show Screen FPS... 13 | 14 | The maximum fps in OSX/iOS Simulator is 60.00. 15 | The maximum fps on iPhone is 59.97. 16 | The maxmium fps on iPad is 60.0. 17 | */ 18 | @interface YYFPSLabel : UILabel 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/Custom/Footer/Auto/MJRefreshAutoNormalFooter.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshAutoNormalFooter.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshAutoStateFooter.h" 10 | 11 | @interface MJRefreshAutoNormalFooter : MJRefreshAutoStateFooter 12 | /** 菊花的样式 */ 13 | @property (assign, nonatomic) UIActivityIndicatorViewStyle activityIndicatorViewStyle; 14 | @end 15 | -------------------------------------------------------------------------------- /ZKTreeTableView/Assets.xcassets/弹出提示.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "弹出提示@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "弹出提示@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ZKTreeTableView/Assets.xcassets/椭圆形.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "椭圆形@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "椭圆形@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ZKTreeTableView/Assets.xcassets/arrow.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "arrow@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "arrow@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ZKTreeTableView/Assets.xcassets/share.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "share@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "share@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ZKTreeTableView/CheckCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // CustomCell.h 3 | // ZKTreeTableView 4 | // 5 | // Created by bestdew on 2018/9/4. 6 | // Copyright © 2018年 bestdew. All rights reserved. 7 | // 8 | 9 | #import "ZKTreeListViewCell.h" 10 | 11 | typedef void (^CheckBlock)(ZKTreeNode *node, BOOL isCheck); 12 | 13 | @interface CheckCell : ZKTreeListViewCell 14 | 15 | @property (nonatomic, copy) CheckBlock block; 16 | 17 | - (void)refreshArrowDirection:(CGFloat)angle animated:(BOOL)animated; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/NSBundle+MJRefresh.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSBundle+MJRefresh.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 16/6/13. 6 | // Copyright © 2016年 小码哥. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSBundle (MJRefresh) 12 | + (instancetype)mj_refreshBundle; 13 | + (UIImage *)mj_arrowImage; 14 | + (NSString *)mj_localizedStringForKey:(NSString *)key value:(NSString *)value; 15 | + (NSString *)mj_localizedStringForKey:(NSString *)key; 16 | @end 17 | -------------------------------------------------------------------------------- /ZKTreeTableView/Assets.xcassets/share_normal.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "share_normal@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "share_normal@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ZKTreeTableView/Assets.xcassets/touxiang_nan.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "touxiang_nan@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "touxiang_nan@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ZKTreeTableView/Assets.xcassets/touxiang_nv.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "touxiang_nv@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "touxiang_nv@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ZKTreeTableView/Assets.xcassets/ic_comment_new.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "ic_comment_new@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "ic_comment_new@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/Custom/Header/MJRefreshNormalHeader.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshNormalHeader.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshStateHeader.h" 10 | 11 | @interface MJRefreshNormalHeader : MJRefreshStateHeader 12 | @property (weak, nonatomic, readonly) UIImageView *arrowView; 13 | /** 菊花的样式 */ 14 | @property (assign, nonatomic) UIActivityIndicatorViewStyle activityIndicatorViewStyle; 15 | @end 16 | -------------------------------------------------------------------------------- /ZKTreeTableView/Assets.xcassets/select_top_icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "select_top_icon@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "select_top_icon@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ZKTreeTableView/Assets.xcassets/options_none_icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "options_none_icon@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "options_none_icon@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ZKTreeTableView/Assets.xcassets/select_down_icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "select_down_icon@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "select_down_icon@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ZKTreeTableView/Assets.xcassets/options_selected_icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "options_selected_icon@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "options_selected_icon@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/Custom/Footer/Back/MJRefreshBackNormalFooter.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshBackNormalFooter.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshBackStateFooter.h" 10 | 11 | @interface MJRefreshBackNormalFooter : MJRefreshBackStateFooter 12 | @property (weak, nonatomic, readonly) UIImageView *arrowView; 13 | /** 菊花的样式 */ 14 | @property (assign, nonatomic) UIActivityIndicatorViewStyle activityIndicatorViewStyle; 15 | @end 16 | -------------------------------------------------------------------------------- /ZKTreeTableView/ZKToolBar.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZKToolBar.h 3 | // ZKTreeTableView 4 | // 5 | // Created by bestdew on 2018/9/23. 6 | // Copyright © 2018年 bestdew. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class ZKToolBar; 12 | 13 | @protocol ZKToolBarDelegate 14 | 15 | @optional 16 | - (void)toolBar:(ZKToolBar *)toolBar didCilckAtIndex:(NSInteger)index; 17 | 18 | @end 19 | 20 | @interface ZKToolBar : UIView 21 | 22 | @property (nonatomic, weak) id delegate; 23 | @property (nonatomic, assign) NSInteger brigeCount; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/MJRefresh.h: -------------------------------------------------------------------------------- 1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh 2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 3 | 4 | #import "UIScrollView+MJRefresh.h" 5 | #import "UIScrollView+MJExtension.h" 6 | #import "UIView+MJExtension.h" 7 | 8 | #import "MJRefreshNormalHeader.h" 9 | #import "MJRefreshGifHeader.h" 10 | 11 | #import "MJRefreshBackNormalFooter.h" 12 | #import "MJRefreshBackGifFooter.h" 13 | #import "MJRefreshAutoNormalFooter.h" 14 | #import "MJRefreshAutoGifFooter.h" -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/Custom/Header/MJRefreshGifHeader.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshGifHeader.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshStateHeader.h" 10 | 11 | @interface MJRefreshGifHeader : MJRefreshStateHeader 12 | @property (weak, nonatomic, readonly) UIImageView *gifView; 13 | 14 | /** 设置state状态下的动画图片images 动画持续时间duration*/ 15 | - (void)setImages:(NSArray *)images duration:(NSTimeInterval)duration forState:(MJRefreshState)state; 16 | - (void)setImages:(NSArray *)images forState:(MJRefreshState)state; 17 | @end 18 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/bestdew.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | MJRefresh.xcscheme 8 | 9 | isShown 10 | 11 | 12 | Pods-ZKTreeTableView.xcscheme 13 | 14 | isShown 15 | 16 | 17 | 18 | SuppressBuildableAutocreation 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/Custom/Footer/Auto/MJRefreshAutoGifFooter.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshAutoGifFooter.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshAutoStateFooter.h" 10 | 11 | @interface MJRefreshAutoGifFooter : MJRefreshAutoStateFooter 12 | @property (weak, nonatomic, readonly) UIImageView *gifView; 13 | 14 | /** 设置state状态下的动画图片images 动画持续时间duration*/ 15 | - (void)setImages:(NSArray *)images duration:(NSTimeInterval)duration forState:(MJRefreshState)state; 16 | - (void)setImages:(NSArray *)images forState:(MJRefreshState)state; 17 | @end 18 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/Custom/Footer/Back/MJRefreshBackGifFooter.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshBackGifFooter.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshBackStateFooter.h" 10 | 11 | @interface MJRefreshBackGifFooter : MJRefreshBackStateFooter 12 | @property (weak, nonatomic, readonly) UIImageView *gifView; 13 | 14 | /** 设置state状态下的动画图片images 动画持续时间duration*/ 15 | - (void)setImages:(NSArray *)images duration:(NSTimeInterval)duration forState:(MJRefreshState)state; 16 | - (void)setImages:(NSArray *)images forState:(MJRefreshState)state; 17 | @end 18 | -------------------------------------------------------------------------------- /Pods/Target Support Files/MJRefresh/MJRefresh.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/MJRefresh 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/MJRefresh" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/MJRefresh" 4 | PODS_BUILD_DIR = ${BUILD_DIR} 5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 6 | PODS_ROOT = ${SRCROOT} 7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/MJRefresh 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | -------------------------------------------------------------------------------- /ZKTreeTableView.xcodeproj/xcuserdata/bestdew.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | ZKTreeTableView.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | FD62A6D021366CD000815DAA 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ZKTreeTableView/Pods-ZKTreeTableView.debug.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/MJRefresh" 3 | LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/MJRefresh" 4 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/MJRefresh" 5 | OTHER_LDFLAGS = $(inherited) -ObjC -l"MJRefresh" 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ZKTreeTableView/Pods-ZKTreeTableView.release.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/MJRefresh" 3 | LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/MJRefresh" 4 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/MJRefresh" 5 | OTHER_LDFLAGS = $(inherited) -ObjC -l"MJRefresh" 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/Custom/Footer/Back/MJRefreshBackStateFooter.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshBackStateFooter.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/6/13. 6 | // Copyright © 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshBackFooter.h" 10 | 11 | @interface MJRefreshBackStateFooter : MJRefreshBackFooter 12 | /** 文字距离圈圈、箭头的距离 */ 13 | @property (assign, nonatomic) CGFloat labelLeftInset; 14 | /** 显示刷新状态的label */ 15 | @property (weak, nonatomic, readonly) UILabel *stateLabel; 16 | /** 设置state状态下的文字 */ 17 | - (void)setTitle:(NSString *)title forState:(MJRefreshState)state; 18 | 19 | /** 获取state状态下的title */ 20 | - (NSString *)titleForState:(MJRefreshState)state; 21 | @end 22 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/MJRefresh.bundle/zh-Hant.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | "MJRefreshHeaderIdleText" = "下拉可以刷新"; 2 | "MJRefreshHeaderPullingText" = "鬆開立即刷新"; 3 | "MJRefreshHeaderRefreshingText" = "正在刷新數據中..."; 4 | 5 | "MJRefreshAutoFooterIdleText" = "點擊或上拉加載更多"; 6 | "MJRefreshAutoFooterRefreshingText" = "正在加載更多的數據..."; 7 | "MJRefreshAutoFooterNoMoreDataText" = "已經全部加載完畢"; 8 | 9 | "MJRefreshBackFooterIdleText" = "上拉可以加載更多"; 10 | "MJRefreshBackFooterPullingText" = "鬆開立即加載更多"; 11 | "MJRefreshBackFooterRefreshingText" = "正在加載更多的數據..."; 12 | "MJRefreshBackFooterNoMoreDataText" = "已經全部加載完畢"; 13 | 14 | "MJRefreshHeaderLastTimeText" = "最後更新:"; 15 | "MJRefreshHeaderDateTodayText" = "今天"; 16 | "MJRefreshHeaderNoneLastDateText" = "無記錄"; 17 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/Custom/Footer/Auto/MJRefreshAutoStateFooter.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshAutoStateFooter.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/6/13. 6 | // Copyright © 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshAutoFooter.h" 10 | 11 | @interface MJRefreshAutoStateFooter : MJRefreshAutoFooter 12 | /** 文字距离圈圈、箭头的距离 */ 13 | @property (assign, nonatomic) CGFloat labelLeftInset; 14 | /** 显示刷新状态的label */ 15 | @property (weak, nonatomic, readonly) UILabel *stateLabel; 16 | 17 | /** 设置state状态下的文字 */ 18 | - (void)setTitle:(NSString *)title forState:(MJRefreshState)state; 19 | 20 | /** 隐藏刷新状态的文字 */ 21 | @property (assign, nonatomic, getter=isRefreshingTitleHidden) BOOL refreshingTitleHidden; 22 | @end 23 | -------------------------------------------------------------------------------- /ZKTreeTableView/CommentModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // CommentModel.m 3 | // ZKTreeTableView 4 | // 5 | // Created by bestdew on 2018/8/29. 6 | // Copyright © 2018年 bestdew. All rights reserved. 7 | // 8 | 9 | #import "CommentModel.h" 10 | 11 | @implementation CommentModel 12 | 13 | + (instancetype)modelWithDict:(NSDictionary *)dict 14 | { 15 | return [[self alloc] initWithDict:dict]; 16 | } 17 | 18 | - (instancetype)initWithDict:(NSDictionary *)dict 19 | { 20 | if (self = [super init]) { 21 | 22 | [self setValuesForKeysWithDictionary:dict]; 23 | } 24 | return self; 25 | } 26 | 27 | - (void)setValue:(id)value forUndefinedKey:(NSString *)key 28 | { 29 | if ([key isEqualToString:@"id"]) _ID = value; 30 | } 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/UIView+MJExtension.h: -------------------------------------------------------------------------------- 1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh 2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 3 | // UIView+Extension.h 4 | // MJRefreshExample 5 | // 6 | // Created by MJ Lee on 14-5-28. 7 | // Copyright (c) 2014年 小码哥. All rights reserved. 8 | // 9 | 10 | #import 11 | 12 | @interface UIView (MJExtension) 13 | @property (assign, nonatomic) CGFloat mj_x; 14 | @property (assign, nonatomic) CGFloat mj_y; 15 | @property (assign, nonatomic) CGFloat mj_w; 16 | @property (assign, nonatomic) CGFloat mj_h; 17 | @property (assign, nonatomic) CGSize mj_size; 18 | @property (assign, nonatomic) CGPoint mj_origin; 19 | @end 20 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/MJRefresh.bundle/en.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | "MJRefreshHeaderIdleText" = "Pull down to refresh"; 2 | "MJRefreshHeaderPullingText" = "Release to refresh"; 3 | "MJRefreshHeaderRefreshingText" = "Loading..."; 4 | 5 | "MJRefreshAutoFooterIdleText" = "Tap or pull up to load more"; 6 | "MJRefreshAutoFooterRefreshingText" = "Loading..."; 7 | "MJRefreshAutoFooterNoMoreDataText" = "No more data"; 8 | 9 | "MJRefreshBackFooterIdleText" = "Pull up to load more"; 10 | "MJRefreshBackFooterPullingText" = "Release to load more."; 11 | "MJRefreshBackFooterRefreshingText" = "Loading..."; 12 | "MJRefreshBackFooterNoMoreDataText" = "No more data"; 13 | 14 | "MJRefreshHeaderLastTimeText" = "Last updated: "; 15 | "MJRefreshHeaderDateTodayText" = "Today"; 16 | "MJRefreshHeaderNoneLastDateText" = "No record"; 17 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/Custom/Header/MJRefreshStateHeader.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshStateHeader.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshHeader.h" 10 | 11 | @interface MJRefreshStateHeader : MJRefreshHeader 12 | #pragma mark - 刷新时间相关 13 | /** 利用这个block来决定显示的更新时间文字 */ 14 | @property (copy, nonatomic) NSString *(^lastUpdatedTimeText)(NSDate *lastUpdatedTime); 15 | /** 显示上一次刷新时间的label */ 16 | @property (weak, nonatomic, readonly) UILabel *lastUpdatedTimeLabel; 17 | 18 | #pragma mark - 状态相关 19 | /** 文字距离圈圈、箭头的距离 */ 20 | @property (assign, nonatomic) CGFloat labelLeftInset; 21 | /** 显示刷新状态的label */ 22 | @property (weak, nonatomic, readonly) UILabel *stateLabel; 23 | /** 设置state状态下的文字 */ 24 | - (void)setTitle:(NSString *)title forState:(MJRefreshState)state; 25 | @end 26 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/Base/MJRefreshAutoFooter.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshAutoFooter.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshFooter.h" 10 | 11 | @interface MJRefreshAutoFooter : MJRefreshFooter 12 | /** 是否自动刷新(默认为YES) */ 13 | @property (assign, nonatomic, getter=isAutomaticallyRefresh) BOOL automaticallyRefresh; 14 | 15 | /** 当底部控件出现多少时就自动刷新(默认为1.0,也就是底部控件完全出现时,才会自动刷新) */ 16 | @property (assign, nonatomic) CGFloat appearencePercentTriggerAutoRefresh MJRefreshDeprecated("请使用triggerAutomaticallyRefreshPercent属性"); 17 | 18 | /** 当底部控件出现多少时就自动刷新(默认为1.0,也就是底部控件完全出现时,才会自动刷新) */ 19 | @property (assign, nonatomic) CGFloat triggerAutomaticallyRefreshPercent; 20 | 21 | /** 是否每一次拖拽只发一次请求 */ 22 | @property (assign, nonatomic, getter=isOnlyRefreshPerDrag) BOOL onlyRefreshPerDrag; 23 | @end 24 | -------------------------------------------------------------------------------- /ZKTreeTableView/RequestHepler.h: -------------------------------------------------------------------------------- 1 | // 2 | // RequestHepler.h 3 | // ZKTreeTableView 4 | // 5 | // Created by bestdew on 2018/9/23. 6 | // Copyright © 2018年 bestdew. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /** 12 | 请求成功回调 13 | 14 | @param response 成功后返回的数据 15 | */ 16 | typedef void (^ResponseSuccess)(id response); 17 | 18 | /** 19 | 请求失败回调 20 | 21 | @param error 错误信息 22 | */ 23 | typedef void (^ResponseFailure)(NSError *error); 24 | 25 | @interface RequestHepler : NSObject 26 | 27 | /** 模拟请求数据 */ 28 | + (void)mockRequestNodesDataWithParams:(id)params success:(ResponseSuccess)success failure:(ResponseFailure)failure; 29 | + (void)mackRequestMoreChildNodeDataWithParams:(id)params success:(ResponseSuccess)success failure:(ResponseFailure)failure; 30 | + (void)submitCommentsWithParams:(id)params success:(ResponseSuccess)success failure:(ResponseFailure)failure; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /ZKTreeTableView/CommentModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // CommentModel.h 3 | // ZKTreeTableView 4 | // 5 | // Created by bestdew on 2018/8/29. 6 | // Copyright © 2018年 bestdew. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface CommentModel : NSObject 12 | 13 | @property (nonatomic, readonly, copy) NSString *ID; // 节点ID 14 | @property (nonatomic, readonly, copy) NSString *pid; // 父节点ID 15 | @property (nonatomic, readonly, copy) NSString *image_name; // 头像 16 | @property (nonatomic, readonly, copy) NSString *nick_name; // 昵称 17 | @property (nonatomic, readonly, copy) NSString *content; // 评论内容 18 | @property (nonatomic, readonly, strong) NSNumber *level; // 层级 19 | @property (nonatomic, readonly, strong) NSNumber *order_no; // 序号 20 | @property (nonatomic, readonly, strong) NSNumber *childs_count; // 子节点总数 21 | 22 | + (instancetype)modelWithDict:(NSDictionary *)dict; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/UIScrollView+MJExtension.h: -------------------------------------------------------------------------------- 1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh 2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 3 | // UIScrollView+Extension.h 4 | // MJRefreshExample 5 | // 6 | // Created by MJ Lee on 14-5-28. 7 | // Copyright (c) 2014年 小码哥. All rights reserved. 8 | // 9 | 10 | #import 11 | 12 | @interface UIScrollView (MJExtension) 13 | @property (readonly, nonatomic) UIEdgeInsets mj_inset; 14 | 15 | @property (assign, nonatomic) CGFloat mj_insetT; 16 | @property (assign, nonatomic) CGFloat mj_insetB; 17 | @property (assign, nonatomic) CGFloat mj_insetL; 18 | @property (assign, nonatomic) CGFloat mj_insetR; 19 | 20 | @property (assign, nonatomic) CGFloat mj_offsetX; 21 | @property (assign, nonatomic) CGFloat mj_offsetY; 22 | 23 | @property (assign, nonatomic) CGFloat mj_contentW; 24 | @property (assign, nonatomic) CGFloat mj_contentH; 25 | @end 26 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/Base/MJRefreshHeader.h: -------------------------------------------------------------------------------- 1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh 2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 3 | // MJRefreshHeader.h 4 | // MJRefreshExample 5 | // 6 | // Created by MJ Lee on 15/3/4. 7 | // Copyright (c) 2015年 小码哥. All rights reserved. 8 | // 下拉刷新控件:负责监控用户下拉的状态 9 | 10 | #import "MJRefreshComponent.h" 11 | 12 | @interface MJRefreshHeader : MJRefreshComponent 13 | /** 创建header */ 14 | + (instancetype)headerWithRefreshingBlock:(MJRefreshComponentRefreshingBlock)refreshingBlock; 15 | /** 创建header */ 16 | + (instancetype)headerWithRefreshingTarget:(id)target refreshingAction:(SEL)action; 17 | 18 | /** 这个key用来存储上一次下拉刷新成功的时间 */ 19 | @property (copy, nonatomic) NSString *lastUpdatedTimeKey; 20 | /** 上一次下拉刷新成功的时间 */ 21 | @property (strong, nonatomic, readonly) NSDate *lastUpdatedTime; 22 | 23 | /** 忽略多少scrollView的contentInset的top */ 24 | @property (assign, nonatomic) CGFloat ignoredScrollViewContentInsetTop; 25 | @end 26 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/UIScrollView+MJRefresh.h: -------------------------------------------------------------------------------- 1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh 2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 3 | // UIScrollView+MJRefresh.h 4 | // MJRefreshExample 5 | // 6 | // Created by MJ Lee on 15/3/4. 7 | // Copyright (c) 2015年 小码哥. All rights reserved. 8 | // 给ScrollView增加下拉刷新、上拉刷新的功能 9 | 10 | #import 11 | #import "MJRefreshConst.h" 12 | 13 | @class MJRefreshHeader, MJRefreshFooter; 14 | 15 | @interface UIScrollView (MJRefresh) 16 | /** 下拉刷新控件 */ 17 | @property (strong, nonatomic) MJRefreshHeader *mj_header; 18 | @property (strong, nonatomic) MJRefreshHeader *header MJRefreshDeprecated("使用mj_header"); 19 | /** 上拉刷新控件 */ 20 | @property (strong, nonatomic) MJRefreshFooter *mj_footer; 21 | @property (strong, nonatomic) MJRefreshFooter *footer MJRefreshDeprecated("使用mj_footer"); 22 | 23 | #pragma mark - other 24 | - (NSInteger)mj_totalDataCount; 25 | @property (copy, nonatomic) void (^mj_reloadDataBlock)(NSInteger totalDataCount); 26 | @end 27 | -------------------------------------------------------------------------------- /Pods/MJRefresh/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013-2015 MJRefresh (https://github.com/CoderMJLee/MJRefresh) 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 | -------------------------------------------------------------------------------- /ZKTreeTableView/ZKInputView.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZKInputView.h 3 | // ZKTreeTableView 4 | // 5 | // Created by bestdew on 2018/9/23. 6 | // Copyright © 2018年 bestdew. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class ZKInputView; 12 | 13 | @protocol ZKInputViewDelagete 14 | 15 | @optional 16 | /** 将要显示的回调 */ 17 | - (void)inputViewWillShow:(ZKInputView *)inputView; 18 | /** 将要隐藏的回调 */ 19 | - (void)inputViewWillHide:(ZKInputView *)inputView; 20 | /** 点击了发送按钮的回调 */ 21 | - (void)inputView:(ZKInputView *)inputView didSendText:(NSString *)text; 22 | 23 | @end 24 | 25 | @interface ZKInputView : UIView 26 | 27 | /** 输入框最大行数(默认:3) */ 28 | @property (nonatomic, assign) NSInteger maxLine; 29 | /** 输入的最大字数(默认:200)*/ 30 | @property (nonatomic, assign) NSInteger maxCount; 31 | /** 占位文字 */ 32 | @property (nonatomic, copy) NSString *placeholder; 33 | /** 文字大小 */ 34 | @property (nonatomic, strong) UIFont *font; 35 | /** 输入的文字 */ 36 | @property (nonatomic, copy) NSString *inputText; 37 | /** 代理 */ 38 | @property (nonatomic, weak) id delegate; 39 | 40 | /** 展示 */ 41 | - (void)show; 42 | /** 隐藏 */ 43 | - (void)hide; 44 | /** 清理文字 */ 45 | - (void)clearText; 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/Base/MJRefreshFooter.h: -------------------------------------------------------------------------------- 1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh 2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 3 | // MJRefreshFooter.h 4 | // MJRefreshExample 5 | // 6 | // Created by MJ Lee on 15/3/5. 7 | // Copyright (c) 2015年 小码哥. All rights reserved. 8 | // 上拉刷新控件 9 | 10 | #import "MJRefreshComponent.h" 11 | 12 | @interface MJRefreshFooter : MJRefreshComponent 13 | /** 创建footer */ 14 | + (instancetype)footerWithRefreshingBlock:(MJRefreshComponentRefreshingBlock)refreshingBlock; 15 | /** 创建footer */ 16 | + (instancetype)footerWithRefreshingTarget:(id)target refreshingAction:(SEL)action; 17 | 18 | /** 提示没有更多的数据 */ 19 | - (void)endRefreshingWithNoMoreData; 20 | - (void)noticeNoMoreData MJRefreshDeprecated("使用endRefreshingWithNoMoreData"); 21 | 22 | /** 重置没有更多的数据(消除没有更多数据的状态) */ 23 | - (void)resetNoMoreData; 24 | 25 | /** 忽略多少scrollView的contentInset的bottom */ 26 | @property (assign, nonatomic) CGFloat ignoredScrollViewContentInsetBottom; 27 | 28 | /** 自动根据有无数据来显示和隐藏(有数据就显示,没有数据隐藏。默认是NO) */ 29 | @property (assign, nonatomic, getter=isAutomaticallyHidden) BOOL automaticallyHidden MJRefreshDeprecated("不建议使用此属性,开发者请自行控制footer的显示和隐藏。基于安全考虑,在未来的某些版本此属性可能作废"); 30 | @end 31 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ZKTreeTableView/Pods-ZKTreeTableView-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## MJRefresh 5 | 6 | Copyright (c) 2013-2015 MJRefresh (https://github.com/CoderMJLee/MJRefresh) 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in 16 | all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | THE SOFTWARE. 25 | 26 | Generated by CocoaPods - https://cocoapods.org 27 | -------------------------------------------------------------------------------- /ZKTreeTableView/YYFPSLabel/YYWeakProxy.h: -------------------------------------------------------------------------------- 1 | // 2 | // YYWeakProxy.h 3 | // YYKit 4 | // 5 | // Created by ibireme on 14/10/18. 6 | // Copyright (c) 2015 ibireme. 7 | // 8 | // This source code is licensed under the MIT-style license found in the 9 | // LICENSE file in the root directory of this source tree. 10 | // 11 | 12 | #import 13 | 14 | /** 15 | A proxy used to hold a weak object. 16 | It can be used to avoid retain cycles, such as the target in NSTimer or CADisplayLink. 17 | 18 | sample code: 19 | 20 | @implementation MyView { 21 | NSTimer *_timer; 22 | } 23 | 24 | - (void)initTimer { 25 | YYWeakProxy *proxy = [YYWeakProxy proxyWithTarget:self]; 26 | _timer = [NSTimer timerWithTimeInterval:0.1 target:proxy selector:@selector(tick:) userInfo:nil repeats:YES]; 27 | } 28 | 29 | - (void)tick:(NSTimer *)timer {...} 30 | @end 31 | */ 32 | @interface YYWeakProxy : NSProxy 33 | 34 | /** 35 | The proxy target. 36 | */ 37 | @property (nonatomic, weak, readonly) id target; 38 | 39 | /** 40 | Creates a new weak proxy for target. 41 | 42 | @param target Target object. 43 | 44 | @return A new proxy object. 45 | */ 46 | - (instancetype)initWithTarget:(id)target; 47 | 48 | /** 49 | Creates a new weak proxy for target. 50 | 51 | @param target Target object. 52 | 53 | @return A new proxy object. 54 | */ 55 | + (instancetype)proxyWithTarget:(id)target; 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /ZKTreeTableView/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 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 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIRequiredDeviceCapabilities 26 | 27 | armv7 28 | 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/UIView+MJExtension.m: -------------------------------------------------------------------------------- 1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh 2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 3 | // UIView+Extension.m 4 | // MJRefreshExample 5 | // 6 | // Created by MJ Lee on 14-5-28. 7 | // Copyright (c) 2014年 小码哥. All rights reserved. 8 | // 9 | 10 | #import "UIView+MJExtension.h" 11 | 12 | @implementation UIView (MJExtension) 13 | - (void)setMj_x:(CGFloat)mj_x 14 | { 15 | CGRect frame = self.frame; 16 | frame.origin.x = mj_x; 17 | self.frame = frame; 18 | } 19 | 20 | - (CGFloat)mj_x 21 | { 22 | return self.frame.origin.x; 23 | } 24 | 25 | - (void)setMj_y:(CGFloat)mj_y 26 | { 27 | CGRect frame = self.frame; 28 | frame.origin.y = mj_y; 29 | self.frame = frame; 30 | } 31 | 32 | - (CGFloat)mj_y 33 | { 34 | return self.frame.origin.y; 35 | } 36 | 37 | - (void)setMj_w:(CGFloat)mj_w 38 | { 39 | CGRect frame = self.frame; 40 | frame.size.width = mj_w; 41 | self.frame = frame; 42 | } 43 | 44 | - (CGFloat)mj_w 45 | { 46 | return self.frame.size.width; 47 | } 48 | 49 | - (void)setMj_h:(CGFloat)mj_h 50 | { 51 | CGRect frame = self.frame; 52 | frame.size.height = mj_h; 53 | self.frame = frame; 54 | } 55 | 56 | - (CGFloat)mj_h 57 | { 58 | return self.frame.size.height; 59 | } 60 | 61 | - (void)setMj_size:(CGSize)mj_size 62 | { 63 | CGRect frame = self.frame; 64 | frame.size = mj_size; 65 | self.frame = frame; 66 | } 67 | 68 | - (CGSize)mj_size 69 | { 70 | return self.frame.size; 71 | } 72 | 73 | - (void)setMj_origin:(CGPoint)mj_origin 74 | { 75 | CGRect frame = self.frame; 76 | frame.origin = mj_origin; 77 | self.frame = frame; 78 | } 79 | 80 | - (CGPoint)mj_origin 81 | { 82 | return self.frame.origin; 83 | } 84 | @end 85 | -------------------------------------------------------------------------------- /ZKTreeTableView/Base.lproj/Main.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 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /ZKTreeTableView/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 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/MJRefreshConst.m: -------------------------------------------------------------------------------- 1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh 2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 3 | #import 4 | 5 | const CGFloat MJRefreshLabelLeftInset = 25; 6 | const CGFloat MJRefreshHeaderHeight = 54.0; 7 | const CGFloat MJRefreshFooterHeight = 44.0; 8 | const CGFloat MJRefreshFastAnimationDuration = 0.25; 9 | const CGFloat MJRefreshSlowAnimationDuration = 0.4; 10 | 11 | NSString *const MJRefreshKeyPathContentOffset = @"contentOffset"; 12 | NSString *const MJRefreshKeyPathContentInset = @"contentInset"; 13 | NSString *const MJRefreshKeyPathContentSize = @"contentSize"; 14 | NSString *const MJRefreshKeyPathPanState = @"state"; 15 | 16 | NSString *const MJRefreshHeaderLastUpdatedTimeKey = @"MJRefreshHeaderLastUpdatedTimeKey"; 17 | 18 | NSString *const MJRefreshHeaderIdleText = @"MJRefreshHeaderIdleText"; 19 | NSString *const MJRefreshHeaderPullingText = @"MJRefreshHeaderPullingText"; 20 | NSString *const MJRefreshHeaderRefreshingText = @"MJRefreshHeaderRefreshingText"; 21 | 22 | NSString *const MJRefreshAutoFooterIdleText = @"MJRefreshAutoFooterIdleText"; 23 | NSString *const MJRefreshAutoFooterRefreshingText = @"MJRefreshAutoFooterRefreshingText"; 24 | NSString *const MJRefreshAutoFooterNoMoreDataText = @"MJRefreshAutoFooterNoMoreDataText"; 25 | 26 | NSString *const MJRefreshBackFooterIdleText = @"MJRefreshBackFooterIdleText"; 27 | NSString *const MJRefreshBackFooterPullingText = @"MJRefreshBackFooterPullingText"; 28 | NSString *const MJRefreshBackFooterRefreshingText = @"MJRefreshBackFooterRefreshingText"; 29 | NSString *const MJRefreshBackFooterNoMoreDataText = @"MJRefreshBackFooterNoMoreDataText"; 30 | 31 | NSString *const MJRefreshHeaderLastTimeText = @"MJRefreshHeaderLastTimeText"; 32 | NSString *const MJRefreshHeaderDateTodayText = @"MJRefreshHeaderDateTodayText"; 33 | NSString *const MJRefreshHeaderNoneLastDateText = @"MJRefreshHeaderNoneLastDateText"; -------------------------------------------------------------------------------- /ZKTreeTableView/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 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/Custom/Footer/Auto/MJRefreshAutoNormalFooter.m: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshAutoNormalFooter.m 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshAutoNormalFooter.h" 10 | 11 | @interface MJRefreshAutoNormalFooter() 12 | @property (weak, nonatomic) UIActivityIndicatorView *loadingView; 13 | @end 14 | 15 | @implementation MJRefreshAutoNormalFooter 16 | #pragma mark - 懒加载子控件 17 | - (UIActivityIndicatorView *)loadingView 18 | { 19 | if (!_loadingView) { 20 | UIActivityIndicatorView *loadingView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:self.activityIndicatorViewStyle]; 21 | loadingView.hidesWhenStopped = YES; 22 | [self addSubview:_loadingView = loadingView]; 23 | } 24 | return _loadingView; 25 | } 26 | 27 | - (void)setActivityIndicatorViewStyle:(UIActivityIndicatorViewStyle)activityIndicatorViewStyle 28 | { 29 | _activityIndicatorViewStyle = activityIndicatorViewStyle; 30 | 31 | self.loadingView = nil; 32 | [self setNeedsLayout]; 33 | } 34 | #pragma mark - 重写父类的方法 35 | - (void)prepare 36 | { 37 | [super prepare]; 38 | 39 | self.activityIndicatorViewStyle = UIActivityIndicatorViewStyleGray; 40 | } 41 | 42 | - (void)placeSubviews 43 | { 44 | [super placeSubviews]; 45 | 46 | if (self.loadingView.constraints.count) return; 47 | 48 | // 圈圈 49 | CGFloat loadingCenterX = self.mj_w * 0.5; 50 | if (!self.isRefreshingTitleHidden) { 51 | loadingCenterX -= self.stateLabel.mj_textWith * 0.5 + self.labelLeftInset; 52 | } 53 | CGFloat loadingCenterY = self.mj_h * 0.5; 54 | self.loadingView.center = CGPointMake(loadingCenterX, loadingCenterY); 55 | } 56 | 57 | - (void)setState:(MJRefreshState)state 58 | { 59 | MJRefreshCheckState 60 | 61 | // 根据状态做事情 62 | if (state == MJRefreshStateNoMoreData || state == MJRefreshStateIdle) { 63 | [self.loadingView stopAnimating]; 64 | } else if (state == MJRefreshStateRefreshing) { 65 | [self.loadingView startAnimating]; 66 | } 67 | } 68 | 69 | @end 70 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ⚠️已停止维护,使用需谨慎⚠️


2 | # ZKTreeListView 3 | 4 | ## 树状结构列表 5 | 6 | ![](https://github.com/bestDew/ZKTreeTableView/raw/master/ZKTreeTableView/Untitled.gif) 7 | 8 | ## 重要事项 9 | 10 | 构建一个树结构,需要一些必要的参数:
ID:当前节点唯一标识
parentID:即为父节点的ID
sortOrder:层级内子节点序号,用于排序 11 | 12 | ## 框架结构 13 | 14 | 本框架主要包含四大类: 15 | 16 | * ZKTreeNode:节点数据模型。用于将原始数据转化为节点数据模型 17 | 18 | * ZKTreeManager:数据模型管理类。核心类,用于构建树结构,提供对节点数据的增、删、改、查功能(非线程安全) 19 | 20 | * ZKTreeListViewCell:cell视图类。自定义cell时需继承此类 21 | 22 | * ZKTreeListView:主视图类。用于将数据操作可视化 23 | 24 | ## 代码示例 25 | 26 | ```ObjectiveC 27 | 28 | // ...初始化ZKTreeListView,并设置其代理 29 | // ...实现其代理方法:- (ZKTreeListViewCell *)treeListView:(ZKTreeListView *)listView cellForNode:(ZKTreeNode *)node atIndexPath:(NSIndexPath *)indexPath; 30 | // ...网络请求拿到原始数据:dataArray 31 | 32 | NSMutableArray *nodes = @[].mutableCopy; 33 | for (NSDictionary *data in dataArray) { 34 | // 1.字典转模型(你自己的数据模型) 35 | Model *model = [Model modelWithDict:data]; 36 | // 2.构建节点数据模型 37 | ZKTreeNode *node = [ZKTreeNode nodeWithID:ID parentID:pID sortOrder:sortOrder data:model]; 38 | // 后台未返回level时,可不设置,内部会自动计算 39 | node.level = level; 40 | /** 41 | 框架目前暂不支持自适应行高,建议提前计算好行高,有助于提升性能 42 | 注意:行高的计算依赖于level,若后台未返回level,此项可不设置,通过以下代理方法返回行高(此时level已内部自动设置): 43 | - (CGFloat)treeListView:(ZKTreeListView *)listView rowHeightForNode:(ZKTreeNode *)node atIndexPath:(NSIndexPath *)indexPath 44 | 此代理方法会在每次返回时为node.rowHeight赋值,避免重复计算带来的性能消耗 45 | */ 46 | node.rowHeight = rowHeight; 47 | // 如需子节点分页显示,可设置此项,需后台返回每个节点的子节点总数 48 | node.childNodesCount = [model.childs_count integerValue]; 49 | 50 | [nodes addObject:node]; 51 | } 52 | // 3.加载数据 53 | /** 54 | 若首次加载数据,使用:[_listView loadNodes:nodes]; 55 | 若在根节点追加数据,比如上拉加载更多可以使用:[_listView appendNodes:nodes]; 或 [_listView appendChildNodes:nodes node:nil];两种方式 56 | 两种方法的区别是:-appendNodes:分组,而 -appendChildNodes:node:不会;在根节点追加数据时推荐使用前者,在子节点追加数据时只能使用后者 57 | */ 58 | 59 | ``` 60 | 61 | 详细使用参见Demo,注释写得很清楚。 62 | 63 | ## 不足 64 | 65 | 由于树状结构列表使用范围较窄,并且与业务耦合严重,所以框架目前的可定制化程度不高。如果本框架不能满足项目需求,可将 ZKTreeNode 和 ZKTreeManager 单独抽离使用,自己去实现视图类。 66 | 67 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/NSBundle+MJRefresh.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSBundle+MJRefresh.m 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 16/6/13. 6 | // Copyright © 2016年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "NSBundle+MJRefresh.h" 10 | #import "MJRefreshComponent.h" 11 | 12 | @implementation NSBundle (MJRefresh) 13 | + (instancetype)mj_refreshBundle 14 | { 15 | static NSBundle *refreshBundle = nil; 16 | if (refreshBundle == nil) { 17 | // 这里不使用mainBundle是为了适配pod 1.x和0.x 18 | refreshBundle = [NSBundle bundleWithPath:[[NSBundle bundleForClass:[MJRefreshComponent class]] pathForResource:@"MJRefresh" ofType:@"bundle"]]; 19 | } 20 | return refreshBundle; 21 | } 22 | 23 | + (UIImage *)mj_arrowImage 24 | { 25 | static UIImage *arrowImage = nil; 26 | if (arrowImage == nil) { 27 | arrowImage = [[UIImage imageWithContentsOfFile:[[self mj_refreshBundle] pathForResource:@"arrow@2x" ofType:@"png"]] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; 28 | } 29 | return arrowImage; 30 | } 31 | 32 | + (NSString *)mj_localizedStringForKey:(NSString *)key 33 | { 34 | return [self mj_localizedStringForKey:key value:nil]; 35 | } 36 | 37 | + (NSString *)mj_localizedStringForKey:(NSString *)key value:(NSString *)value 38 | { 39 | static NSBundle *bundle = nil; 40 | if (bundle == nil) { 41 | // (iOS获取的语言字符串比较不稳定)目前框架只处理en、zh-Hans、zh-Hant三种情况,其他按照系统默认处理 42 | NSString *language = [NSLocale preferredLanguages].firstObject; 43 | if ([language hasPrefix:@"en"]) { 44 | language = @"en"; 45 | } else if ([language hasPrefix:@"zh"]) { 46 | if ([language rangeOfString:@"Hans"].location != NSNotFound) { 47 | language = @"zh-Hans"; // 简体中文 48 | } else { // zh-Hant\zh-HK\zh-TW 49 | language = @"zh-Hant"; // 繁體中文 50 | } 51 | } else { 52 | language = @"en"; 53 | } 54 | 55 | // 从MJRefresh.bundle中查找资源 56 | bundle = [NSBundle bundleWithPath:[[NSBundle mj_refreshBundle] pathForResource:language ofType:@"lproj"]]; 57 | } 58 | value = [bundle localizedStringForKey:key value:value table:nil]; 59 | return [[NSBundle mainBundle] localizedStringForKey:key value:value table:nil]; 60 | } 61 | @end 62 | -------------------------------------------------------------------------------- /ZKTreeTableView/YYFPSLabel/YYWeakProxy.m: -------------------------------------------------------------------------------- 1 | // 2 | // YYWeakProxy.m 3 | // YYKit 4 | // 5 | // Created by ibireme on 14/10/18. 6 | // Copyright (c) 2015 ibireme. 7 | // 8 | // This source code is licensed under the MIT-style license found in the 9 | // LICENSE file in the root directory of this source tree. 10 | // 11 | 12 | #import "YYWeakProxy.h" 13 | 14 | /** 15 | 实现的原理: 使用 NSProxy 持有 NSTimer 的 target 16 | 不再用 NSTimer 直接持有 self,就不会导致 timer 对 self 的循环强引用了 17 | */ 18 | @implementation YYWeakProxy 19 | 20 | - (instancetype)initWithTarget:(id)target { 21 | _target = target; 22 | return self; 23 | } 24 | 25 | //类方法 26 | + (instancetype)proxyWithTarget:(id)target { 27 | return [[YYWeakProxy alloc] initWithTarget:target]; 28 | } 29 | 30 | #pragma mark - private 31 | 32 | - (id)forwardingTargetForSelector:(SEL)selector { 33 | return _target; 34 | } 35 | 36 | #pragma mark - over write 37 | 38 | //重写NSProxy如下两个方法,在处理消息转发时,将消息转发给真正的Target处理 39 | - (void)forwardInvocation:(NSInvocation *)invocation { 40 | void *null = NULL; 41 | [invocation setReturnValue:&null]; 42 | } 43 | 44 | - (NSMethodSignature *)methodSignatureForSelector:(SEL)selector { 45 | return [NSObject instanceMethodSignatureForSelector:@selector(init)]; 46 | } 47 | 48 | - (BOOL)respondsToSelector:(SEL)aSelector { 49 | return [_target respondsToSelector:aSelector]; 50 | } 51 | 52 | #pragma mark - 53 | 54 | - (BOOL)isEqual:(id)object { 55 | return [_target isEqual:object]; 56 | } 57 | 58 | - (NSUInteger)hash { 59 | return [_target hash]; 60 | } 61 | 62 | - (Class)superclass { 63 | return [_target superclass]; 64 | } 65 | 66 | - (Class)class { 67 | return [_target class]; 68 | } 69 | 70 | - (BOOL)isKindOfClass:(Class)aClass { 71 | return [_target isKindOfClass:aClass]; 72 | } 73 | 74 | - (BOOL)isMemberOfClass:(Class)aClass { 75 | return [_target isMemberOfClass:aClass]; 76 | } 77 | 78 | - (BOOL)conformsToProtocol:(Protocol *)aProtocol { 79 | return [_target conformsToProtocol:aProtocol]; 80 | } 81 | 82 | - (BOOL)isProxy { 83 | return YES; 84 | } 85 | 86 | - (NSString *)description { 87 | return [_target description]; 88 | } 89 | 90 | - (NSString *)debugDescription { 91 | return [_target debugDescription]; 92 | } 93 | 94 | @end 95 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/Base/MJRefreshFooter.m: -------------------------------------------------------------------------------- 1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh 2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 3 | // MJRefreshFooter.m 4 | // MJRefreshExample 5 | // 6 | // Created by MJ Lee on 15/3/5. 7 | // Copyright (c) 2015年 小码哥. All rights reserved. 8 | // 9 | 10 | #import "MJRefreshFooter.h" 11 | #include "UIScrollView+MJRefresh.h" 12 | 13 | @interface MJRefreshFooter() 14 | 15 | @end 16 | 17 | @implementation MJRefreshFooter 18 | #pragma mark - 构造方法 19 | + (instancetype)footerWithRefreshingBlock:(MJRefreshComponentRefreshingBlock)refreshingBlock 20 | { 21 | MJRefreshFooter *cmp = [[self alloc] init]; 22 | cmp.refreshingBlock = refreshingBlock; 23 | return cmp; 24 | } 25 | + (instancetype)footerWithRefreshingTarget:(id)target refreshingAction:(SEL)action 26 | { 27 | MJRefreshFooter *cmp = [[self alloc] init]; 28 | [cmp setRefreshingTarget:target refreshingAction:action]; 29 | return cmp; 30 | } 31 | 32 | #pragma mark - 重写父类的方法 33 | - (void)prepare 34 | { 35 | [super prepare]; 36 | 37 | // 设置自己的高度 38 | self.mj_h = MJRefreshFooterHeight; 39 | 40 | // 默认不会自动隐藏 41 | self.automaticallyHidden = NO; 42 | } 43 | 44 | - (void)willMoveToSuperview:(UIView *)newSuperview 45 | { 46 | [super willMoveToSuperview:newSuperview]; 47 | 48 | if (newSuperview) { 49 | // 监听scrollView数据的变化 50 | if ([self.scrollView isKindOfClass:[UITableView class]] || [self.scrollView isKindOfClass:[UICollectionView class]]) { 51 | [self.scrollView setMj_reloadDataBlock:^(NSInteger totalDataCount) { 52 | if (self.isAutomaticallyHidden) { 53 | self.hidden = (totalDataCount == 0); 54 | } 55 | }]; 56 | } 57 | } 58 | } 59 | 60 | #pragma mark - 公共方法 61 | - (void)endRefreshingWithNoMoreData 62 | { 63 | MJRefreshDispatchAsyncOnMainQueue(self.state = MJRefreshStateNoMoreData;) 64 | } 65 | 66 | - (void)noticeNoMoreData 67 | { 68 | [self endRefreshingWithNoMoreData]; 69 | } 70 | 71 | - (void)resetNoMoreData 72 | { 73 | MJRefreshDispatchAsyncOnMainQueue(self.state = MJRefreshStateIdle;) 74 | } 75 | 76 | - (void)setAutomaticallyHidden:(BOOL)automaticallyHidden 77 | { 78 | _automaticallyHidden = automaticallyHidden; 79 | } 80 | @end 81 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/Custom/Footer/Back/MJRefreshBackStateFooter.m: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshBackStateFooter.m 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/6/13. 6 | // Copyright © 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshBackStateFooter.h" 10 | 11 | @interface MJRefreshBackStateFooter() 12 | { 13 | /** 显示刷新状态的label */ 14 | __unsafe_unretained UILabel *_stateLabel; 15 | } 16 | /** 所有状态对应的文字 */ 17 | @property (strong, nonatomic) NSMutableDictionary *stateTitles; 18 | @end 19 | 20 | @implementation MJRefreshBackStateFooter 21 | #pragma mark - 懒加载 22 | - (NSMutableDictionary *)stateTitles 23 | { 24 | if (!_stateTitles) { 25 | self.stateTitles = [NSMutableDictionary dictionary]; 26 | } 27 | return _stateTitles; 28 | } 29 | 30 | - (UILabel *)stateLabel 31 | { 32 | if (!_stateLabel) { 33 | [self addSubview:_stateLabel = [UILabel mj_label]]; 34 | } 35 | return _stateLabel; 36 | } 37 | 38 | #pragma mark - 公共方法 39 | - (void)setTitle:(NSString *)title forState:(MJRefreshState)state 40 | { 41 | if (title == nil) return; 42 | self.stateTitles[@(state)] = title; 43 | self.stateLabel.text = self.stateTitles[@(self.state)]; 44 | } 45 | 46 | - (NSString *)titleForState:(MJRefreshState)state { 47 | return self.stateTitles[@(state)]; 48 | } 49 | 50 | #pragma mark - 重写父类的方法 51 | - (void)prepare 52 | { 53 | [super prepare]; 54 | 55 | // 初始化间距 56 | self.labelLeftInset = MJRefreshLabelLeftInset; 57 | 58 | // 初始化文字 59 | [self setTitle:[NSBundle mj_localizedStringForKey:MJRefreshBackFooterIdleText] forState:MJRefreshStateIdle]; 60 | [self setTitle:[NSBundle mj_localizedStringForKey:MJRefreshBackFooterPullingText] forState:MJRefreshStatePulling]; 61 | [self setTitle:[NSBundle mj_localizedStringForKey:MJRefreshBackFooterRefreshingText] forState:MJRefreshStateRefreshing]; 62 | [self setTitle:[NSBundle mj_localizedStringForKey:MJRefreshBackFooterNoMoreDataText] forState:MJRefreshStateNoMoreData]; 63 | } 64 | 65 | - (void)placeSubviews 66 | { 67 | [super placeSubviews]; 68 | 69 | if (self.stateLabel.constraints.count) return; 70 | 71 | // 状态标签 72 | self.stateLabel.frame = self.bounds; 73 | } 74 | 75 | - (void)setState:(MJRefreshState)state 76 | { 77 | MJRefreshCheckState 78 | 79 | // 设置状态文字 80 | self.stateLabel.text = self.stateTitles[@(state)]; 81 | } 82 | @end 83 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ZKTreeTableView/Pods-ZKTreeTableView-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Copyright (c) 2013-2015 MJRefresh (https://github.com/CoderMJLee/MJRefresh) 18 | 19 | Permission is hereby granted, free of charge, to any person obtaining a copy 20 | of this software and associated documentation files (the "Software"), to deal 21 | in the Software without restriction, including without limitation the rights 22 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 23 | copies of the Software, and to permit persons to whom the Software is 24 | furnished to do so, subject to the following conditions: 25 | 26 | The above copyright notice and this permission notice shall be included in 27 | all copies or substantial portions of the Software. 28 | 29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 35 | THE SOFTWARE. 36 | 37 | License 38 | MIT 39 | Title 40 | MJRefresh 41 | Type 42 | PSGroupSpecifier 43 | 44 | 45 | FooterText 46 | Generated by CocoaPods - https://cocoapods.org 47 | Title 48 | 49 | Type 50 | PSGroupSpecifier 51 | 52 | 53 | StringsTable 54 | Acknowledgements 55 | Title 56 | Acknowledgements 57 | 58 | 59 | -------------------------------------------------------------------------------- /ZKTreeTableView/ZKTreeListView/ZKTreeListViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZKTreeListViewCell.h 3 | // ZKTreeListViewDemo 4 | // 5 | // Created by bestdew on 2018/9/5. 6 | // Copyright © 2018年 bestdew. All rights reserved. 7 | // 8 | // d*##$. 9 | // zP"""""$e. $" $o 10 | //4$ '$ $" $ 11 | //'$ '$ J$ $F 12 | // 'b $k $> $ 13 | // $k $r J$ d$ 14 | // '$ $ $" $~ 15 | // '$ "$ '$E $ 16 | // $ $L $" $F ... 17 | // $. 4B $ $$$*"""*b 18 | // '$ $. $$ $$ $F 19 | // "$ R$ $F $" $ 20 | // $k ?$ u* dF .$ 21 | // ^$. $$" z$ u$$$$e 22 | // #$b $E.dW@e$" ?$ 23 | // #$ .o$$# d$$$$c ?F 24 | // $ .d$$#" . zo$> #$r .uF 25 | // $L .u$*" $&$$$k .$$d$$F 26 | // $$" ""^"$$$P"$P9$ 27 | // JP .o$$$$u:$P $$ 28 | // $ ..ue$" "" $" 29 | // d$ $F $ 30 | // $$ ....udE 4B 31 | // #$ """"` $r @$ 32 | // ^$L '$ $F 33 | // RN 4N $ 34 | // *$b d$ 35 | // $$k $F 36 | // $$b $F 37 | // $"" $F 38 | // '$ $ 39 | // $L $ 40 | // '$ $ 41 | // $ $ 42 | 43 | #import 44 | #import "ZKTreeNode.h" 45 | 46 | @interface ZKTreeListViewCell : UITableViewCell 47 | 48 | /** 内容视图,子类添加子控件需添加在内容容器上 */ 49 | @property (nonatomic, readonly, strong) UIView *view; 50 | /** 子类中重写 -setNode: 方法,通过 node.data 进行赋值处理 */ 51 | @property (nonatomic, strong) ZKTreeNode *node; 52 | /** 是否显示结构线 */ 53 | @property (nonatomic, assign) BOOL showStructureLine; 54 | 55 | @end 56 | 57 | typedef NS_ENUM(NSInteger, ZKTreeTailCellState) { 58 | ZKTreeTailCellStateIdle, // 闲置状态 59 | ZKTreeTailCellStateLoading, // 加载中... 60 | ZKTreeTailCellStateLoadError // 加载失败 61 | }; 62 | 63 | @interface ZKTreeTailCell : ZKTreeListViewCell 64 | 65 | /** 当前状态 */ 66 | @property (nonatomic, assign) ZKTreeTailCellState state; 67 | 68 | /** 设置响应状态下的文字 */ 69 | - (void)setText:(NSString *)text forState:(ZKTreeTailCellState)state; 70 | 71 | @end 72 | -------------------------------------------------------------------------------- /ZKTreeTableView/MainViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // MainViewController.m 3 | // ZKTreeTableView 4 | // 5 | // Created by bestdew on 2018/9/4. 6 | // Copyright © 2018年 bestdew. All rights reserved. 7 | // 8 | 9 | #import "MainViewController.h" 10 | #import "CheckViewController.h" 11 | #import "TreeListViewController.h" 12 | 13 | @interface MainViewController () 14 | 15 | @end 16 | 17 | @implementation MainViewController 18 | 19 | - (void)viewDidLoad { 20 | [super viewDidLoad]; 21 | 22 | self.navigationItem.title = @"ZKTreeListViewDemo"; 23 | 24 | CGFloat screenWidth = UIScreen.mainScreen.bounds.size.width; 25 | CGFloat screenHeight = UIScreen.mainScreen.bounds.size.height; 26 | 27 | UIButton *firstButton = [UIButton buttonWithType:UIButtonTypeCustom]; 28 | firstButton.frame = CGRectMake(60.f, (screenHeight - 100.f) / 2, screenWidth - 120.f, 40.f); 29 | firstButton.layer.backgroundColor = [UIColor colorWithRed:0.35 green:0.58 blue:0.91 alpha:1.00].CGColor; 30 | firstButton.layer.masksToBounds = YES; 31 | firstButton.layer.cornerRadius = 20.f; 32 | firstButton.tag = 10; 33 | [firstButton setTitle:@"NormalStyle" forState:UIControlStateNormal]; 34 | [firstButton addTarget:self action:@selector(buttonAction:) forControlEvents:UIControlEventTouchUpInside]; 35 | [self.view addSubview:firstButton]; 36 | 37 | UIButton *secondButton = [UIButton buttonWithType:UIButtonTypeCustom]; 38 | secondButton.frame = CGRectMake(60.f, CGRectGetMaxY(firstButton.frame) + 20.f, firstButton.frame.size.width, 40.f); 39 | secondButton.layer.backgroundColor = [UIColor colorWithRed:0.35 green:0.58 blue:0.91 alpha:1.00].CGColor; 40 | secondButton.layer.masksToBounds = YES; 41 | secondButton.layer.cornerRadius = 20.f; 42 | secondButton.tag = 11; 43 | [secondButton setTitle:@"StructureLineStyle" forState:UIControlStateNormal]; 44 | [secondButton addTarget:self action:@selector(buttonAction:) forControlEvents:UIControlEventTouchUpInside]; 45 | [self.view addSubview:secondButton]; 46 | } 47 | 48 | - (void)buttonAction:(UIButton *)button 49 | { 50 | switch (button.tag) { 51 | case 10: { 52 | CheckViewController *checkVC = [[CheckViewController alloc] init]; 53 | [self.navigationController pushViewController:checkVC animated:YES]; 54 | break; 55 | } 56 | case 11: { 57 | TreeListViewController *treeListVC = [[TreeListViewController alloc] init]; 58 | [self.navigationController pushViewController:treeListVC animated:YES]; 59 | break; 60 | } 61 | } 62 | } 63 | 64 | @end 65 | -------------------------------------------------------------------------------- /ZKTreeTableView/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // ZKTreeTableView 4 | // 5 | // Created by bestdew on 2018/8/29. 6 | // Copyright © 2018年 bestdew. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "MainViewController.h" 11 | 12 | @interface AppDelegate () 13 | 14 | @end 15 | 16 | @implementation AppDelegate 17 | 18 | 19 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 20 | 21 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 22 | self.window.backgroundColor = [UIColor whiteColor]; 23 | 24 | MainViewController *mainVC = [[MainViewController alloc] init]; 25 | UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:mainVC]; 26 | self.window.rootViewController = nav; 27 | 28 | [self.window makeKeyAndVisible]; 29 | 30 | return YES; 31 | } 32 | 33 | 34 | - (void)applicationWillResignActive:(UIApplication *)application { 35 | // 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. 36 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 37 | } 38 | 39 | 40 | - (void)applicationDidEnterBackground:(UIApplication *)application { 41 | // 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. 42 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 43 | } 44 | 45 | 46 | - (void)applicationWillEnterForeground:(UIApplication *)application { 47 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 48 | } 49 | 50 | 51 | - (void)applicationDidBecomeActive:(UIApplication *)application { 52 | // 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. 53 | } 54 | 55 | 56 | - (void)applicationWillTerminate:(UIApplication *)application { 57 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 58 | } 59 | 60 | 61 | @end 62 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/Custom/Footer/Auto/MJRefreshAutoStateFooter.m: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshAutoStateFooter.m 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/6/13. 6 | // Copyright © 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshAutoStateFooter.h" 10 | 11 | @interface MJRefreshAutoStateFooter() 12 | { 13 | /** 显示刷新状态的label */ 14 | __unsafe_unretained UILabel *_stateLabel; 15 | } 16 | /** 所有状态对应的文字 */ 17 | @property (strong, nonatomic) NSMutableDictionary *stateTitles; 18 | @end 19 | 20 | @implementation MJRefreshAutoStateFooter 21 | #pragma mark - 懒加载 22 | - (NSMutableDictionary *)stateTitles 23 | { 24 | if (!_stateTitles) { 25 | self.stateTitles = [NSMutableDictionary dictionary]; 26 | } 27 | return _stateTitles; 28 | } 29 | 30 | - (UILabel *)stateLabel 31 | { 32 | if (!_stateLabel) { 33 | [self addSubview:_stateLabel = [UILabel mj_label]]; 34 | } 35 | return _stateLabel; 36 | } 37 | 38 | #pragma mark - 公共方法 39 | - (void)setTitle:(NSString *)title forState:(MJRefreshState)state 40 | { 41 | if (title == nil) return; 42 | self.stateTitles[@(state)] = title; 43 | self.stateLabel.text = self.stateTitles[@(self.state)]; 44 | } 45 | 46 | #pragma mark - 私有方法 47 | - (void)stateLabelClick 48 | { 49 | if (self.state == MJRefreshStateIdle) { 50 | [self beginRefreshing]; 51 | } 52 | } 53 | 54 | #pragma mark - 重写父类的方法 55 | - (void)prepare 56 | { 57 | [super prepare]; 58 | 59 | // 初始化间距 60 | self.labelLeftInset = MJRefreshLabelLeftInset; 61 | 62 | // 初始化文字 63 | [self setTitle:[NSBundle mj_localizedStringForKey:MJRefreshAutoFooterIdleText] forState:MJRefreshStateIdle]; 64 | [self setTitle:[NSBundle mj_localizedStringForKey:MJRefreshAutoFooterRefreshingText] forState:MJRefreshStateRefreshing]; 65 | [self setTitle:[NSBundle mj_localizedStringForKey:MJRefreshAutoFooterNoMoreDataText] forState:MJRefreshStateNoMoreData]; 66 | 67 | // 监听label 68 | self.stateLabel.userInteractionEnabled = YES; 69 | [self.stateLabel addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(stateLabelClick)]]; 70 | } 71 | 72 | - (void)placeSubviews 73 | { 74 | [super placeSubviews]; 75 | 76 | if (self.stateLabel.constraints.count) return; 77 | 78 | // 状态标签 79 | self.stateLabel.frame = self.bounds; 80 | } 81 | 82 | - (void)setState:(MJRefreshState)state 83 | { 84 | MJRefreshCheckState 85 | 86 | if (self.isRefreshingTitleHidden && state == MJRefreshStateRefreshing) { 87 | self.stateLabel.text = nil; 88 | } else { 89 | self.stateLabel.text = self.stateTitles[@(state)]; 90 | } 91 | } 92 | @end -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/bestdew.xcuserdatad/xcschemes/MJRefresh.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 66 | 67 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/bestdew.xcuserdatad/xcschemes/Pods-ZKTreeTableView.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 66 | 67 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/MJRefreshConst.h: -------------------------------------------------------------------------------- 1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh 2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 3 | #import 4 | #import 5 | 6 | // 弱引用 7 | #define MJWeakSelf __weak typeof(self) weakSelf = self; 8 | 9 | // 日志输出 10 | #ifdef DEBUG 11 | #define MJRefreshLog(...) NSLog(__VA_ARGS__) 12 | #else 13 | #define MJRefreshLog(...) 14 | #endif 15 | 16 | // 过期提醒 17 | #define MJRefreshDeprecated(instead) NS_DEPRECATED(2_0, 2_0, 2_0, 2_0, instead) 18 | 19 | // 运行时objc_msgSend 20 | #define MJRefreshMsgSend(...) ((void (*)(void *, SEL, UIView *))objc_msgSend)(__VA_ARGS__) 21 | #define MJRefreshMsgTarget(target) (__bridge void *)(target) 22 | 23 | // RGB颜色 24 | #define MJRefreshColor(r, g, b) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1.0] 25 | 26 | // 文字颜色 27 | #define MJRefreshLabelTextColor MJRefreshColor(90, 90, 90) 28 | 29 | // 字体大小 30 | #define MJRefreshLabelFont [UIFont boldSystemFontOfSize:14] 31 | 32 | // 常量 33 | UIKIT_EXTERN const CGFloat MJRefreshLabelLeftInset; 34 | UIKIT_EXTERN const CGFloat MJRefreshHeaderHeight; 35 | UIKIT_EXTERN const CGFloat MJRefreshFooterHeight; 36 | UIKIT_EXTERN const CGFloat MJRefreshFastAnimationDuration; 37 | UIKIT_EXTERN const CGFloat MJRefreshSlowAnimationDuration; 38 | 39 | UIKIT_EXTERN NSString *const MJRefreshKeyPathContentOffset; 40 | UIKIT_EXTERN NSString *const MJRefreshKeyPathContentSize; 41 | UIKIT_EXTERN NSString *const MJRefreshKeyPathContentInset; 42 | UIKIT_EXTERN NSString *const MJRefreshKeyPathPanState; 43 | 44 | UIKIT_EXTERN NSString *const MJRefreshHeaderLastUpdatedTimeKey; 45 | 46 | UIKIT_EXTERN NSString *const MJRefreshHeaderIdleText; 47 | UIKIT_EXTERN NSString *const MJRefreshHeaderPullingText; 48 | UIKIT_EXTERN NSString *const MJRefreshHeaderRefreshingText; 49 | 50 | UIKIT_EXTERN NSString *const MJRefreshAutoFooterIdleText; 51 | UIKIT_EXTERN NSString *const MJRefreshAutoFooterRefreshingText; 52 | UIKIT_EXTERN NSString *const MJRefreshAutoFooterNoMoreDataText; 53 | 54 | UIKIT_EXTERN NSString *const MJRefreshBackFooterIdleText; 55 | UIKIT_EXTERN NSString *const MJRefreshBackFooterPullingText; 56 | UIKIT_EXTERN NSString *const MJRefreshBackFooterRefreshingText; 57 | UIKIT_EXTERN NSString *const MJRefreshBackFooterNoMoreDataText; 58 | 59 | UIKIT_EXTERN NSString *const MJRefreshHeaderLastTimeText; 60 | UIKIT_EXTERN NSString *const MJRefreshHeaderDateTodayText; 61 | UIKIT_EXTERN NSString *const MJRefreshHeaderNoneLastDateText; 62 | 63 | // 状态检查 64 | #define MJRefreshCheckState \ 65 | MJRefreshState oldState = self.state; \ 66 | if (state == oldState) return; \ 67 | [super setState:state]; 68 | 69 | // 异步主线程执行,不强持有Self 70 | #define MJRefreshDispatchAsyncOnMainQueue(x) \ 71 | __weak typeof(self) weakSelf = self; \ 72 | dispatch_async(dispatch_get_main_queue(), ^{ \ 73 | typeof(weakSelf) self = weakSelf; \ 74 | {x} \ 75 | }); 76 | 77 | -------------------------------------------------------------------------------- /ZKTreeTableView/YYFPSLabel/YYFPSLabel.m: -------------------------------------------------------------------------------- 1 | // 2 | // YYFPSLabel.m 3 | // YYKitExample 4 | // 5 | // Created by ibireme on 15/9/3. 6 | // Copyright (c) 2015 ibireme. All rights reserved. 7 | // 8 | 9 | #import "YYFPSLabel.h" 10 | #import "YYWeakProxy.h" 11 | 12 | #define kSize CGSizeMake(55, 20) 13 | 14 | @implementation YYFPSLabel { 15 | CADisplayLink *_link; 16 | NSUInteger _count; 17 | NSTimeInterval _lastTime; 18 | UIFont *_font; 19 | UIFont *_subFont; 20 | 21 | NSTimeInterval _llll; 22 | } 23 | 24 | - (instancetype)initWithFrame:(CGRect)frame { 25 | if (frame.size.width == 0 && frame.size.height == 0) { 26 | frame.size = kSize; 27 | } 28 | self = [super initWithFrame:frame]; 29 | 30 | self.layer.cornerRadius = 5; 31 | self.clipsToBounds = YES; 32 | self.textAlignment = NSTextAlignmentCenter; 33 | self.userInteractionEnabled = NO; 34 | self.backgroundColor = [UIColor colorWithWhite:0.000 alpha:0.700]; 35 | 36 | _font = [UIFont fontWithName:@"Menlo" size:14]; 37 | if (_font) { 38 | _subFont = [UIFont fontWithName:@"Menlo" size:4]; 39 | } else { 40 | _font = [UIFont fontWithName:@"Courier" size:14]; 41 | _subFont = [UIFont fontWithName:@"Courier" size:4]; 42 | } 43 | 44 | // 如果直接用 self 或者 weakSelf,都不能解决循环引用问题 45 | 46 | // 将 timer 的 target 从 self ,变成了中间人 NSProxy 47 | // timer 调用 target 的 selector 时,会被 NSProxy 内部转调用 self 的 selector 48 | _link = [CADisplayLink displayLinkWithTarget:[YYWeakProxy proxyWithTarget:self] selector:@selector(tick:)]; 49 | // __weak typeof(self) weakSelf = self; 50 | // _link = [CADisplayLink displayLinkWithTarget:weakSelf selector:@selector(tick:)]; 51 | [_link addToRunLoop:[NSRunLoop mainRunLoop] forMode:NSRunLoopCommonModes]; 52 | 53 | return self; 54 | } 55 | 56 | - (void)dealloc { 57 | [_link invalidate]; 58 | NSLog(@"timer release"); 59 | } 60 | 61 | - (CGSize)sizeThatFits:(CGSize)size { 62 | return kSize; 63 | } 64 | 65 | - (void)tick:(CADisplayLink *)link { 66 | if (_lastTime == 0) { 67 | _lastTime = link.timestamp; 68 | return; 69 | } 70 | 71 | _count++; 72 | NSTimeInterval delta = link.timestamp - _lastTime; 73 | if (delta < 1) return; 74 | _lastTime = link.timestamp; 75 | float fps = _count / delta; 76 | _count = 0; 77 | 78 | CGFloat progress = fps / 60.0; 79 | UIColor *color = [UIColor colorWithHue:0.27 * (progress - 0.2) saturation:1 brightness:0.9 alpha:1]; 80 | 81 | //NSString *text1 = [NSString stringWithFormat:@"%d FPS",(int)round(fps)]; 82 | //NSLog(@"%@", text1); 83 | 84 | 85 | NSMutableAttributedString *text = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%d FPS",(int)round(fps)]]; 86 | [text addAttribute:NSForegroundColorAttributeName value:color range:NSMakeRange(0, text.length - 3)]; 87 | [text addAttribute:NSForegroundColorAttributeName value:[UIColor whiteColor] range:NSMakeRange(text.length - 3, 3)]; 88 | [text addAttribute:NSFontAttributeName value:_font range:NSMakeRange(0, text.length)]; 89 | [text addAttribute:NSFontAttributeName value:_subFont range:NSMakeRange(text.length - 4, 1)]; 90 | self.attributedText = text; 91 | } 92 | 93 | @end 94 | -------------------------------------------------------------------------------- /ZKTreeTableView/ZKTreeListView/ZKTreeNode.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZKTreeNode.h 3 | // ZKTreeListViewDemo 4 | // 5 | // Created by bestdew on 2018/9/5. 6 | // Copyright © 2018年 bestdew. All rights reserved. 7 | // 8 | // d*##$. 9 | // zP"""""$e. $" $o 10 | //4$ '$ $" $ 11 | //'$ '$ J$ $F 12 | // 'b $k $> $ 13 | // $k $r J$ d$ 14 | // '$ $ $" $~ 15 | // '$ "$ '$E $ 16 | // $ $L $" $F ... 17 | // $. 4B $ $$$*"""*b 18 | // '$ $. $$ $$ $F 19 | // "$ R$ $F $" $ 20 | // $k ?$ u* dF .$ 21 | // ^$. $$" z$ u$$$$e 22 | // #$b $E.dW@e$" ?$ 23 | // #$ .o$$# d$$$$c ?F 24 | // $ .d$$#" . zo$> #$r .uF 25 | // $L .u$*" $&$$$k .$$d$$F 26 | // $$" ""^"$$$P"$P9$ 27 | // JP .o$$$$u:$P $$ 28 | // $ ..ue$" "" $" 29 | // d$ $F $ 30 | // $$ ....udE 4B 31 | // #$ """"` $r @$ 32 | // ^$L '$ $F 33 | // RN 4N $ 34 | // *$b d$ 35 | // $$k $F 36 | // $$b $F 37 | // $"" $F 38 | // '$ $ 39 | // $L $ 40 | // '$ $ 41 | // $ $ 42 | 43 | #import 44 | 45 | @import CoreGraphics.CGBase; 46 | 47 | NS_ASSUME_NONNULL_BEGIN 48 | 49 | @interface ZKTreeNode : NSObject 50 | 51 | @property (nonatomic, readonly, copy) NSString *ID; // 节点唯一标识 52 | @property (nonatomic, readonly, copy) NSString *parentID; // 父节点唯一标识 53 | @property (nonatomic, readonly, assign) NSInteger order; // 节点在其父节点的子节点数组中的排序依据 54 | @property (nonatomic, readonly, strong) id data; // 节点完整数据,可以是数据模型 55 | 56 | @property (nonatomic, assign) NSInteger level; // 节点所处层级(0,1,2...) 57 | @property (nonatomic, assign) CGFloat rowHeight; // 行高 58 | @property (nonatomic, assign, getter=isExpand) BOOL expand; // 节点展开状态(YES:展开,NO:折叠) 59 | 60 | @property (nonatomic, assign) NSInteger childNodesCount; // 子节点总数(用于分页) 61 | @property (nonatomic, assign) NSInteger pageIndex; // 分页页码(默认为1) 62 | 63 | @property (nullable, nonatomic, weak) ZKTreeNode *parentNode; // 父节点 64 | @property (nullable, nonatomic, strong) NSMutableArray *childNodes; // 子节点数组 65 | 66 | /** 快捷初始化 */ 67 | - (instancetype)initWithID:(NSString *)ID 68 | parentID:(NSString *)pID 69 | sortOrder:(NSInteger)order 70 | data:(nullable id)data; 71 | 72 | + (instancetype)nodeWithID:(NSString *)ID 73 | parentID:(NSString *)pID 74 | sortOrder:(NSInteger)order 75 | data:(nullable id)data; 76 | 77 | - (instancetype)init NS_UNAVAILABLE; 78 | + (instancetype)new NS_UNAVAILABLE; 79 | 80 | /** 判断两个节点是否相同(⚠️仅比较节点 ID )*/ 81 | - (BOOL)isEqualToNode:(ZKTreeNode *)node; 82 | - (BOOL)isTail; 83 | 84 | @end 85 | 86 | FOUNDATION_EXTERN NSString * const kTailIDPrefix; 87 | 88 | NS_ASSUME_NONNULL_END 89 | -------------------------------------------------------------------------------- /ZKTreeTableView/ZKTreeListView/ZKTreeNode.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZKTreeNode.m 3 | // ZKTreeListViewDemo 4 | // 5 | // Created by bestdew on 2018/9/5. 6 | // Copyright © 2018年 bestdew. All rights reserved. 7 | // 8 | // d*##$. 9 | // zP"""""$e. $" $o 10 | //4$ '$ $" $ 11 | //'$ '$ J$ $F 12 | // 'b $k $> $ 13 | // $k $r J$ d$ 14 | // '$ $ $" $~ 15 | // '$ "$ '$E $ 16 | // $ $L $" $F ... 17 | // $. 4B $ $$$*"""*b 18 | // '$ $. $$ $$ $F 19 | // "$ R$ $F $" $ 20 | // $k ?$ u* dF .$ 21 | // ^$. $$" z$ u$$$$e 22 | // #$b $E.dW@e$" ?$ 23 | // #$ .o$$# d$$$$c ?F 24 | // $ .d$$#" . zo$> #$r .uF 25 | // $L .u$*" $&$$$k .$$d$$F 26 | // $$" ""^"$$$P"$P9$ 27 | // JP .o$$$$u:$P $$ 28 | // $ ..ue$" "" $" 29 | // d$ $F $ 30 | // $$ ....udE 4B 31 | // #$ """"` $r @$ 32 | // ^$L '$ $F 33 | // RN 4N $ 34 | // *$b d$ 35 | // $$k $F 36 | // $$b $F 37 | // $"" $F 38 | // '$ $ 39 | // $L $ 40 | // '$ $ 41 | // $ $ 42 | 43 | #import "ZKTreeNode.h" 44 | 45 | NSString * const kTailIDPrefix = @"node_tail_"; 46 | 47 | @implementation ZKTreeNode 48 | 49 | - (instancetype)initWithID:(NSString *)ID parentID:(NSString *)pID sortOrder:(NSInteger)order data:(nullable id)data 50 | { 51 | if (self = [super init]) { 52 | 53 | _ID = ID; 54 | _parentID = pID; 55 | _order = order; 56 | _data = data; 57 | _level = -1; 58 | _expand = NO; 59 | _rowHeight = -1.f; 60 | _pageIndex = 1; 61 | _childNodesCount = -1; 62 | _parentNode = nil; 63 | _childNodes = @[].mutableCopy; 64 | } 65 | return self; 66 | } 67 | 68 | + (instancetype)nodeWithID:(NSString *)ID parentID:(NSString *)pID sortOrder:(NSInteger)order data:(nullable id)data 69 | { 70 | return [[self alloc] initWithID:ID parentID:pID sortOrder:order data:data]; 71 | } 72 | 73 | - (BOOL)isEqualToNode:(ZKTreeNode *)node 74 | { 75 | if (!node) return NO; 76 | 77 | return [self.ID isEqualToString:node.ID]; 78 | } 79 | 80 | - (BOOL)isEqual:(id)object 81 | { 82 | if (self == object) return YES; 83 | if (![object isKindOfClass:[ZKTreeNode class]]) { 84 | return NO; 85 | } 86 | return [self isEqualToNode:(ZKTreeNode *)object]; 87 | } 88 | 89 | - (BOOL)isTail 90 | { 91 | return [self.ID hasPrefix:kTailIDPrefix]; 92 | } 93 | 94 | - (void)setLevel:(NSInteger)level 95 | { 96 | _level = MAX(level, 0); 97 | } 98 | 99 | - (void)setRowHeight:(CGFloat)rowHeight 100 | { 101 | _rowHeight = MAX(rowHeight, 0); 102 | } 103 | 104 | - (void)setChildNodesCount:(NSInteger)childNodesCount 105 | { 106 | _childNodesCount = MAX(childNodesCount, 0); 107 | } 108 | 109 | @end 110 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/Custom/Footer/Auto/MJRefreshAutoGifFooter.m: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshAutoGifFooter.m 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshAutoGifFooter.h" 10 | 11 | @interface MJRefreshAutoGifFooter() 12 | { 13 | __unsafe_unretained UIImageView *_gifView; 14 | } 15 | /** 所有状态对应的动画图片 */ 16 | @property (strong, nonatomic) NSMutableDictionary *stateImages; 17 | /** 所有状态对应的动画时间 */ 18 | @property (strong, nonatomic) NSMutableDictionary *stateDurations; 19 | @end 20 | 21 | @implementation MJRefreshAutoGifFooter 22 | #pragma mark - 懒加载 23 | - (UIImageView *)gifView 24 | { 25 | if (!_gifView) { 26 | UIImageView *gifView = [[UIImageView alloc] init]; 27 | [self addSubview:_gifView = gifView]; 28 | } 29 | return _gifView; 30 | } 31 | 32 | - (NSMutableDictionary *)stateImages 33 | { 34 | if (!_stateImages) { 35 | self.stateImages = [NSMutableDictionary dictionary]; 36 | } 37 | return _stateImages; 38 | } 39 | 40 | - (NSMutableDictionary *)stateDurations 41 | { 42 | if (!_stateDurations) { 43 | self.stateDurations = [NSMutableDictionary dictionary]; 44 | } 45 | return _stateDurations; 46 | } 47 | 48 | #pragma mark - 公共方法 49 | - (void)setImages:(NSArray *)images duration:(NSTimeInterval)duration forState:(MJRefreshState)state 50 | { 51 | if (images == nil) return; 52 | 53 | self.stateImages[@(state)] = images; 54 | self.stateDurations[@(state)] = @(duration); 55 | 56 | /* 根据图片设置控件的高度 */ 57 | UIImage *image = [images firstObject]; 58 | if (image.size.height > self.mj_h) { 59 | self.mj_h = image.size.height; 60 | } 61 | } 62 | 63 | - (void)setImages:(NSArray *)images forState:(MJRefreshState)state 64 | { 65 | [self setImages:images duration:images.count * 0.1 forState:state]; 66 | } 67 | 68 | #pragma mark - 实现父类的方法 69 | - (void)prepare 70 | { 71 | [super prepare]; 72 | 73 | // 初始化间距 74 | self.labelLeftInset = 20; 75 | } 76 | 77 | - (void)placeSubviews 78 | { 79 | [super placeSubviews]; 80 | 81 | if (self.gifView.constraints.count) return; 82 | 83 | self.gifView.frame = self.bounds; 84 | if (self.isRefreshingTitleHidden) { 85 | self.gifView.contentMode = UIViewContentModeCenter; 86 | } else { 87 | self.gifView.contentMode = UIViewContentModeRight; 88 | self.gifView.mj_w = self.mj_w * 0.5 - self.labelLeftInset - self.stateLabel.mj_textWith * 0.5; 89 | } 90 | } 91 | 92 | - (void)setState:(MJRefreshState)state 93 | { 94 | MJRefreshCheckState 95 | 96 | // 根据状态做事情 97 | if (state == MJRefreshStateRefreshing) { 98 | NSArray *images = self.stateImages[@(state)]; 99 | if (images.count == 0) return; 100 | [self.gifView stopAnimating]; 101 | 102 | self.gifView.hidden = NO; 103 | if (images.count == 1) { // 单张图片 104 | self.gifView.image = [images lastObject]; 105 | } else { // 多张图片 106 | self.gifView.animationImages = images; 107 | self.gifView.animationDuration = [self.stateDurations[@(state)] doubleValue]; 108 | [self.gifView startAnimating]; 109 | } 110 | } else if (state == MJRefreshStateNoMoreData || state == MJRefreshStateIdle) { 111 | [self.gifView stopAnimating]; 112 | self.gifView.hidden = YES; 113 | } 114 | } 115 | @end 116 | 117 | -------------------------------------------------------------------------------- /ZKTreeTableView/CheckCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // CustomCell.m 3 | // ZKTreeTableView 4 | // 5 | // Created by bestdew on 2018/9/4. 6 | // Copyright © 2018年 bestdew. All rights reserved. 7 | // 8 | 9 | #import "CheckCell.h" 10 | #import "CommentModel.h" 11 | #import "CheckNode.h" 12 | 13 | @interface CheckCell () 14 | 15 | @property (nonatomic, weak) UIImageView *arrowImgView; 16 | @property (nonatomic, weak) UILabel *titleLabel; 17 | @property (nonatomic, weak) UIButton *checkButton; 18 | 19 | @end 20 | 21 | @implementation CheckCell 22 | 23 | #pragma mark -- Init 24 | - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier 25 | { 26 | if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) { 27 | 28 | [self addSubViews]; 29 | } 30 | return self; 31 | } 32 | 33 | #pragma mark -- Action 34 | - (void)check:(UIButton *)button 35 | { 36 | button.selected = !button.isSelected; 37 | 38 | if (self.block) { 39 | self.block(self.node, button.isSelected); 40 | } 41 | } 42 | 43 | #pragma mark -- Other 44 | - (void)addSubViews 45 | { 46 | UIImageView *arrowImgView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"arrow"]]; 47 | [self.view addSubview:arrowImgView]; 48 | _arrowImgView = arrowImgView; 49 | 50 | UILabel *titleLabel = [[UILabel alloc] init]; 51 | [self.view addSubview:titleLabel]; 52 | _titleLabel = titleLabel; 53 | 54 | UIButton *checkButton = [UIButton buttonWithType:UIButtonTypeCustom]; 55 | [checkButton setImage:[UIImage imageNamed:@"options_none_icon"] forState:UIControlStateNormal]; 56 | [checkButton setImage:[UIImage imageNamed:@"options_selected_icon"] forState:UIControlStateSelected]; 57 | [checkButton addTarget:self action:@selector(check:) forControlEvents:UIControlEventTouchUpInside]; 58 | [self.view addSubview:checkButton]; 59 | _checkButton = checkButton; 60 | } 61 | 62 | - (void)layoutSubviews 63 | { 64 | [super layoutSubviews]; 65 | 66 | CGFloat arrowX = (self.node.level == 0) ? 16.f : 10.f; 67 | _arrowImgView.frame = CGRectMake(arrowX, 12.f, 20.f, 20.f); 68 | 69 | CGFloat titleX = (_arrowImgView.isHidden) ? 16.f : 46.f; 70 | _titleLabel.frame = CGRectMake(titleX, 0, self.view.frame.size.width - titleX - 50.f, 44.f); 71 | _checkButton.frame = CGRectMake(self.view.frame.size.width - 46.f, 7.f, 30.f, 30.f); 72 | } 73 | 74 | - (void)refreshArrowDirection:(CGFloat)angle animated:(BOOL)animated 75 | { 76 | if (CGAffineTransformEqualToTransform(_arrowImgView.transform, CGAffineTransformMakeRotation(angle))) return; 77 | 78 | if (animated) { 79 | [UIView animateWithDuration:0.25 animations:^{ 80 | _arrowImgView.transform = CGAffineTransformMakeRotation(angle); 81 | }]; 82 | } else { 83 | _arrowImgView.transform = CGAffineTransformMakeRotation(angle); 84 | } 85 | } 86 | 87 | #pragma mark -- Setter && Getter 88 | - (void)setNode:(ZKTreeNode *)node 89 | { 90 | [super setNode:node]; 91 | 92 | CheckNode *checkNode = (CheckNode *)node; 93 | _checkButton.selected = checkNode.isChecked; 94 | 95 | CommentModel *model = (CommentModel *)node.data; 96 | _titleLabel.text = model.nick_name; 97 | 98 | _arrowImgView.hidden = (node.childNodes.count <= 0); 99 | 100 | CGFloat angle = (node.isExpand) ? M_PI_2 : 0.f; 101 | [self refreshArrowDirection:angle animated:NO]; 102 | } 103 | 104 | @end 105 | -------------------------------------------------------------------------------- /ZKTreeTableView.xcodeproj/xcuserdata/bestdew.xcuserdatad/xcschemes/ZKTreeTableView.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 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/Custom/Footer/Back/MJRefreshBackGifFooter.m: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshBackGifFooter.m 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshBackGifFooter.h" 10 | 11 | @interface MJRefreshBackGifFooter() 12 | { 13 | __unsafe_unretained UIImageView *_gifView; 14 | } 15 | /** 所有状态对应的动画图片 */ 16 | @property (strong, nonatomic) NSMutableDictionary *stateImages; 17 | /** 所有状态对应的动画时间 */ 18 | @property (strong, nonatomic) NSMutableDictionary *stateDurations; 19 | @end 20 | 21 | @implementation MJRefreshBackGifFooter 22 | #pragma mark - 懒加载 23 | - (UIImageView *)gifView 24 | { 25 | if (!_gifView) { 26 | UIImageView *gifView = [[UIImageView alloc] init]; 27 | [self addSubview:_gifView = gifView]; 28 | } 29 | return _gifView; 30 | } 31 | 32 | - (NSMutableDictionary *)stateImages 33 | { 34 | if (!_stateImages) { 35 | self.stateImages = [NSMutableDictionary dictionary]; 36 | } 37 | return _stateImages; 38 | } 39 | 40 | - (NSMutableDictionary *)stateDurations 41 | { 42 | if (!_stateDurations) { 43 | self.stateDurations = [NSMutableDictionary dictionary]; 44 | } 45 | return _stateDurations; 46 | } 47 | 48 | #pragma mark - 公共方法 49 | - (void)setImages:(NSArray *)images duration:(NSTimeInterval)duration forState:(MJRefreshState)state 50 | { 51 | if (images == nil) return; 52 | 53 | self.stateImages[@(state)] = images; 54 | self.stateDurations[@(state)] = @(duration); 55 | 56 | /* 根据图片设置控件的高度 */ 57 | UIImage *image = [images firstObject]; 58 | if (image.size.height > self.mj_h) { 59 | self.mj_h = image.size.height; 60 | } 61 | } 62 | 63 | - (void)setImages:(NSArray *)images forState:(MJRefreshState)state 64 | { 65 | [self setImages:images duration:images.count * 0.1 forState:state]; 66 | } 67 | 68 | #pragma mark - 实现父类的方法 69 | - (void)prepare 70 | { 71 | [super prepare]; 72 | 73 | // 初始化间距 74 | self.labelLeftInset = 20; 75 | } 76 | 77 | - (void)setPullingPercent:(CGFloat)pullingPercent 78 | { 79 | [super setPullingPercent:pullingPercent]; 80 | NSArray *images = self.stateImages[@(MJRefreshStateIdle)]; 81 | if (self.state != MJRefreshStateIdle || images.count == 0) return; 82 | [self.gifView stopAnimating]; 83 | NSUInteger index = images.count * pullingPercent; 84 | if (index >= images.count) index = images.count - 1; 85 | self.gifView.image = images[index]; 86 | } 87 | 88 | - (void)placeSubviews 89 | { 90 | [super placeSubviews]; 91 | 92 | if (self.gifView.constraints.count) return; 93 | 94 | self.gifView.frame = self.bounds; 95 | if (self.stateLabel.hidden) { 96 | self.gifView.contentMode = UIViewContentModeCenter; 97 | } else { 98 | self.gifView.contentMode = UIViewContentModeRight; 99 | self.gifView.mj_w = self.mj_w * 0.5 - self.labelLeftInset - self.stateLabel.mj_textWith * 0.5; 100 | } 101 | } 102 | 103 | - (void)setState:(MJRefreshState)state 104 | { 105 | MJRefreshCheckState 106 | 107 | // 根据状态做事情 108 | if (state == MJRefreshStatePulling || state == MJRefreshStateRefreshing) { 109 | NSArray *images = self.stateImages[@(state)]; 110 | if (images.count == 0) return; 111 | 112 | self.gifView.hidden = NO; 113 | [self.gifView stopAnimating]; 114 | if (images.count == 1) { // 单张图片 115 | self.gifView.image = [images lastObject]; 116 | } else { // 多张图片 117 | self.gifView.animationImages = images; 118 | self.gifView.animationDuration = [self.stateDurations[@(state)] doubleValue]; 119 | [self.gifView startAnimating]; 120 | } 121 | } else if (state == MJRefreshStateIdle) { 122 | self.gifView.hidden = NO; 123 | } else if (state == MJRefreshStateNoMoreData) { 124 | self.gifView.hidden = YES; 125 | } 126 | } 127 | @end 128 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/Base/MJRefreshComponent.h: -------------------------------------------------------------------------------- 1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh 2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 3 | // MJRefreshComponent.h 4 | // MJRefreshExample 5 | // 6 | // Created by MJ Lee on 15/3/4. 7 | // Copyright (c) 2015年 小码哥. All rights reserved. 8 | // 刷新控件的基类 9 | 10 | #import 11 | #import "MJRefreshConst.h" 12 | #import "UIView+MJExtension.h" 13 | #import "UIScrollView+MJExtension.h" 14 | #import "UIScrollView+MJRefresh.h" 15 | #import "NSBundle+MJRefresh.h" 16 | 17 | /** 刷新控件的状态 */ 18 | typedef NS_ENUM(NSInteger, MJRefreshState) { 19 | /** 普通闲置状态 */ 20 | MJRefreshStateIdle = 1, 21 | /** 松开就可以进行刷新的状态 */ 22 | MJRefreshStatePulling, 23 | /** 正在刷新中的状态 */ 24 | MJRefreshStateRefreshing, 25 | /** 即将刷新的状态 */ 26 | MJRefreshStateWillRefresh, 27 | /** 所有数据加载完毕,没有更多的数据了 */ 28 | MJRefreshStateNoMoreData 29 | }; 30 | 31 | /** 进入刷新状态的回调 */ 32 | typedef void (^MJRefreshComponentRefreshingBlock)(void); 33 | /** 开始刷新后的回调(进入刷新状态后的回调) */ 34 | typedef void (^MJRefreshComponentbeginRefreshingCompletionBlock)(void); 35 | /** 结束刷新后的回调 */ 36 | typedef void (^MJRefreshComponentEndRefreshingCompletionBlock)(void); 37 | 38 | /** 刷新控件的基类 */ 39 | @interface MJRefreshComponent : UIView 40 | { 41 | /** 记录scrollView刚开始的inset */ 42 | UIEdgeInsets _scrollViewOriginalInset; 43 | /** 父控件 */ 44 | __weak UIScrollView *_scrollView; 45 | } 46 | #pragma mark - 刷新回调 47 | /** 正在刷新的回调 */ 48 | @property (copy, nonatomic) MJRefreshComponentRefreshingBlock refreshingBlock; 49 | /** 设置回调对象和回调方法 */ 50 | - (void)setRefreshingTarget:(id)target refreshingAction:(SEL)action; 51 | 52 | /** 回调对象 */ 53 | @property (weak, nonatomic) id refreshingTarget; 54 | /** 回调方法 */ 55 | @property (assign, nonatomic) SEL refreshingAction; 56 | /** 触发回调(交给子类去调用) */ 57 | - (void)executeRefreshingCallback; 58 | 59 | #pragma mark - 刷新状态控制 60 | /** 进入刷新状态 */ 61 | - (void)beginRefreshing; 62 | - (void)beginRefreshingWithCompletionBlock:(void (^)(void))completionBlock; 63 | /** 开始刷新后的回调(进入刷新状态后的回调) */ 64 | @property (copy, nonatomic) MJRefreshComponentbeginRefreshingCompletionBlock beginRefreshingCompletionBlock; 65 | /** 结束刷新的回调 */ 66 | @property (copy, nonatomic) MJRefreshComponentEndRefreshingCompletionBlock endRefreshingCompletionBlock; 67 | /** 结束刷新状态 */ 68 | - (void)endRefreshing; 69 | - (void)endRefreshingWithCompletionBlock:(void (^)(void))completionBlock; 70 | /** 是否正在刷新 */ 71 | @property (assign, nonatomic, readonly, getter=isRefreshing) BOOL refreshing; 72 | //- (BOOL)isRefreshing; 73 | /** 刷新状态 一般交给子类内部实现 */ 74 | @property (assign, nonatomic) MJRefreshState state; 75 | 76 | #pragma mark - 交给子类去访问 77 | /** 记录scrollView刚开始的inset */ 78 | @property (assign, nonatomic, readonly) UIEdgeInsets scrollViewOriginalInset; 79 | /** 父控件 */ 80 | @property (weak, nonatomic, readonly) UIScrollView *scrollView; 81 | 82 | #pragma mark - 交给子类们去实现 83 | /** 初始化 */ 84 | - (void)prepare NS_REQUIRES_SUPER; 85 | /** 摆放子控件frame */ 86 | - (void)placeSubviews NS_REQUIRES_SUPER; 87 | /** 当scrollView的contentOffset发生改变的时候调用 */ 88 | - (void)scrollViewContentOffsetDidChange:(NSDictionary *)change NS_REQUIRES_SUPER; 89 | /** 当scrollView的contentSize发生改变的时候调用 */ 90 | - (void)scrollViewContentSizeDidChange:(NSDictionary *)change NS_REQUIRES_SUPER; 91 | /** 当scrollView的拖拽状态发生改变的时候调用 */ 92 | - (void)scrollViewPanStateDidChange:(NSDictionary *)change NS_REQUIRES_SUPER; 93 | 94 | 95 | #pragma mark - 其他 96 | /** 拉拽的百分比(交给子类重写) */ 97 | @property (assign, nonatomic) CGFloat pullingPercent; 98 | /** 根据拖拽比例自动切换透明度 */ 99 | @property (assign, nonatomic, getter=isAutoChangeAlpha) BOOL autoChangeAlpha MJRefreshDeprecated("请使用automaticallyChangeAlpha属性"); 100 | /** 根据拖拽比例自动切换透明度 */ 101 | @property (assign, nonatomic, getter=isAutomaticallyChangeAlpha) BOOL automaticallyChangeAlpha; 102 | @end 103 | 104 | @interface UILabel(MJRefresh) 105 | + (instancetype)mj_label; 106 | - (CGFloat)mj_textWith; 107 | @end 108 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/UIScrollView+MJExtension.m: -------------------------------------------------------------------------------- 1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh 2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 3 | // UIScrollView+Extension.m 4 | // MJRefreshExample 5 | // 6 | // Created by MJ Lee on 14-5-28. 7 | // Copyright (c) 2014年 小码哥. All rights reserved. 8 | // 9 | 10 | #import "UIScrollView+MJExtension.h" 11 | #import 12 | 13 | #pragma clang diagnostic push 14 | #pragma clang diagnostic ignored "-Wunguarded-availability-new" 15 | 16 | @implementation UIScrollView (MJExtension) 17 | 18 | static BOOL respondsToAdjustedContentInset_; 19 | 20 | + (void)initialize 21 | { 22 | static dispatch_once_t onceToken; 23 | dispatch_once(&onceToken, ^{ 24 | respondsToAdjustedContentInset_ = [self instancesRespondToSelector:@selector(adjustedContentInset)]; 25 | }); 26 | } 27 | 28 | - (UIEdgeInsets)mj_inset 29 | { 30 | #ifdef __IPHONE_11_0 31 | if (respondsToAdjustedContentInset_) { 32 | return self.adjustedContentInset; 33 | } 34 | #endif 35 | return self.contentInset; 36 | } 37 | 38 | - (void)setMj_insetT:(CGFloat)mj_insetT 39 | { 40 | UIEdgeInsets inset = self.contentInset; 41 | inset.top = mj_insetT; 42 | #ifdef __IPHONE_11_0 43 | if (respondsToAdjustedContentInset_) { 44 | inset.top -= (self.adjustedContentInset.top - self.contentInset.top); 45 | } 46 | #endif 47 | self.contentInset = inset; 48 | } 49 | 50 | - (CGFloat)mj_insetT 51 | { 52 | return self.mj_inset.top; 53 | } 54 | 55 | - (void)setMj_insetB:(CGFloat)mj_insetB 56 | { 57 | UIEdgeInsets inset = self.contentInset; 58 | inset.bottom = mj_insetB; 59 | #ifdef __IPHONE_11_0 60 | if (respondsToAdjustedContentInset_) { 61 | inset.bottom -= (self.adjustedContentInset.bottom - self.contentInset.bottom); 62 | } 63 | #endif 64 | self.contentInset = inset; 65 | } 66 | 67 | - (CGFloat)mj_insetB 68 | { 69 | return self.mj_inset.bottom; 70 | } 71 | 72 | - (void)setMj_insetL:(CGFloat)mj_insetL 73 | { 74 | UIEdgeInsets inset = self.contentInset; 75 | inset.left = mj_insetL; 76 | #ifdef __IPHONE_11_0 77 | if (respondsToAdjustedContentInset_) { 78 | inset.left -= (self.adjustedContentInset.left - self.contentInset.left); 79 | } 80 | #endif 81 | self.contentInset = inset; 82 | } 83 | 84 | - (CGFloat)mj_insetL 85 | { 86 | return self.mj_inset.left; 87 | } 88 | 89 | - (void)setMj_insetR:(CGFloat)mj_insetR 90 | { 91 | UIEdgeInsets inset = self.contentInset; 92 | inset.right = mj_insetR; 93 | #ifdef __IPHONE_11_0 94 | if (respondsToAdjustedContentInset_) { 95 | inset.right -= (self.adjustedContentInset.right - self.contentInset.right); 96 | } 97 | #endif 98 | self.contentInset = inset; 99 | } 100 | 101 | - (CGFloat)mj_insetR 102 | { 103 | return self.mj_inset.right; 104 | } 105 | 106 | - (void)setMj_offsetX:(CGFloat)mj_offsetX 107 | { 108 | CGPoint offset = self.contentOffset; 109 | offset.x = mj_offsetX; 110 | self.contentOffset = offset; 111 | } 112 | 113 | - (CGFloat)mj_offsetX 114 | { 115 | return self.contentOffset.x; 116 | } 117 | 118 | - (void)setMj_offsetY:(CGFloat)mj_offsetY 119 | { 120 | CGPoint offset = self.contentOffset; 121 | offset.y = mj_offsetY; 122 | self.contentOffset = offset; 123 | } 124 | 125 | - (CGFloat)mj_offsetY 126 | { 127 | return self.contentOffset.y; 128 | } 129 | 130 | - (void)setMj_contentW:(CGFloat)mj_contentW 131 | { 132 | CGSize size = self.contentSize; 133 | size.width = mj_contentW; 134 | self.contentSize = size; 135 | } 136 | 137 | - (CGFloat)mj_contentW 138 | { 139 | return self.contentSize.width; 140 | } 141 | 142 | - (void)setMj_contentH:(CGFloat)mj_contentH 143 | { 144 | CGSize size = self.contentSize; 145 | size.height = mj_contentH; 146 | self.contentSize = size; 147 | } 148 | 149 | - (CGFloat)mj_contentH 150 | { 151 | return self.contentSize.height; 152 | } 153 | @end 154 | #pragma clang diagnostic pop 155 | -------------------------------------------------------------------------------- /ZKTreeTableView/ZKTreeListView/ZKTreeManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZKTreeManager.h 3 | // ZKTreeListViewDemo 4 | // 5 | // Created by bestdew on 2018/9/5. 6 | // Copyright © 2018年 bestdew. All rights reserved. 7 | // 8 | // d*##$. 9 | // zP"""""$e. $" $o 10 | //4$ '$ $" $ 11 | //'$ '$ J$ $F 12 | // 'b $k $> $ 13 | // $k $r J$ d$ 14 | // '$ $ $" $~ 15 | // '$ "$ '$E $ 16 | // $ $L $" $F ... 17 | // $. 4B $ $$$*"""*b 18 | // '$ $. $$ $$ $F 19 | // "$ R$ $F $" $ 20 | // $k ?$ u* dF .$ 21 | // ^$. $$" z$ u$$$$e 22 | // #$b $E.dW@e$" ?$ 23 | // #$ .o$$# d$$$$c ?F 24 | // $ .d$$#" . zo$> #$r .uF 25 | // $L .u$*" $&$$$k .$$d$$F 26 | // $$" ""^"$$$P"$P9$ 27 | // JP .o$$$$u:$P $$ 28 | // $ ..ue$" "" $" 29 | // d$ $F $ 30 | // $$ ....udE 4B 31 | // #$ """"` $r @$ 32 | // ^$L '$ $F 33 | // RN 4N $ 34 | // *$b d$ 35 | // $$k $F 36 | // $$b $F 37 | // $"" $F 38 | // '$ $ 39 | // $L $ 40 | // '$ $ 41 | // $ $ 42 | 43 | #import 44 | #import "ZKTreeNode.h" 45 | 46 | NS_ASSUME_NONNULL_BEGIN 47 | 48 | @interface ZKTreeManager : NSObject 49 | 50 | /** 所有可见节点 */ 51 | @property (nonatomic, readonly, strong) NSMutableArray *showNodes; 52 | /** 所有节点 */ 53 | @property (nonatomic, readonly, strong) NSMutableSet *allNodes; 54 | /** 最小等级 */ 55 | @property (nonatomic, readonly, assign) NSInteger minLevel; 56 | /** 最大等级 */ 57 | @property (nonatomic, readonly, assign) NSInteger maxLevel; 58 | /** 当前展示的最大等级(默认为 minLevel) */ 59 | @property (nonatomic, readonly, assign) NSInteger showLevel; 60 | 61 | /** 62 | 初始化方法 63 | 64 | @param nodes 节点数组 65 | @param minLevel 节点最小等级 66 | @param expandLevel 默认展开的等级 67 | @return manager 实例 68 | */ 69 | - (instancetype)initWithNodes:(NSArray *)nodes 70 | minLevel:(NSInteger)minLevel 71 | expandLevel:(NSInteger)expandLevel; 72 | 73 | + (instancetype)managerWithNodes:(NSArray *)nodes 74 | minLevel:(NSInteger)minLevel 75 | expandLevel:(NSInteger)expandLevel; 76 | 77 | - (instancetype)init NS_UNAVAILABLE; 78 | + (instancetype)new NS_UNAVAILABLE; 79 | 80 | /** 81 | 给父节点增加一组子节点 82 | 83 | @param nodes 子节点数组 84 | @param node 父节点(若 node 为空,则追加在根节点) 85 | @param isTop 是否置顶(若为 YES:追加在头部,为 NO 则追加在末尾) 86 | */ 87 | - (void)addChildNodes:(NSArray *)nodes 88 | forNode:(nullable ZKTreeNode *)node 89 | placedAtTop:(BOOL)isTop; 90 | /** 删除一个节点(包含子节点) */ 91 | - (void)deleteNode:(ZKTreeNode *)node; 92 | 93 | /** 展开/收起 node,返回所改变的 node 的个数 */ 94 | - (NSInteger)expandNode:(ZKTreeNode *)node expand:(BOOL)isExpand; 95 | /** 96 | 展开/折叠到多少层级 97 | 98 | @param expandLevel 等级 99 | @param noExpandCompleted 返回折叠所改变的所有节点 100 | @param expandCompleted 返回展开所改变的所有节点 101 | */ 102 | - (void)expandAllNodesWithLevel:(NSInteger)expandLevel 103 | noExpandCompleted:(void(^)(NSArray *noExpandArray))noExpandCompleted 104 | expandCompleted:(void(^)(NSArray *expandArray))expandCompleted; 105 | 106 | /** 向上查找相差 grades 个等级 的 node 的父节点 */ 107 | - (nullable ZKTreeNode *)parentNodeWithNode:(ZKTreeNode *)node grades:(NSInteger)grades; 108 | /** 获取 node 所有的子节点,包含子节点的子节点 */ 109 | - (NSArray *)childNodesForNode:(ZKTreeNode *)node; 110 | /** 根据节点 ID 获取 节点 */ 111 | - (nullable ZKTreeNode *)nodeForID:(NSString *)ID; 112 | 113 | @end 114 | 115 | NS_ASSUME_NONNULL_END 116 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/Custom/Header/MJRefreshGifHeader.m: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshGifHeader.m 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshGifHeader.h" 10 | 11 | @interface MJRefreshGifHeader() 12 | { 13 | __unsafe_unretained UIImageView *_gifView; 14 | } 15 | /** 所有状态对应的动画图片 */ 16 | @property (strong, nonatomic) NSMutableDictionary *stateImages; 17 | /** 所有状态对应的动画时间 */ 18 | @property (strong, nonatomic) NSMutableDictionary *stateDurations; 19 | @end 20 | 21 | @implementation MJRefreshGifHeader 22 | #pragma mark - 懒加载 23 | - (UIImageView *)gifView 24 | { 25 | if (!_gifView) { 26 | UIImageView *gifView = [[UIImageView alloc] init]; 27 | [self addSubview:_gifView = gifView]; 28 | } 29 | return _gifView; 30 | } 31 | 32 | - (NSMutableDictionary *)stateImages 33 | { 34 | if (!_stateImages) { 35 | self.stateImages = [NSMutableDictionary dictionary]; 36 | } 37 | return _stateImages; 38 | } 39 | 40 | - (NSMutableDictionary *)stateDurations 41 | { 42 | if (!_stateDurations) { 43 | self.stateDurations = [NSMutableDictionary dictionary]; 44 | } 45 | return _stateDurations; 46 | } 47 | 48 | #pragma mark - 公共方法 49 | - (void)setImages:(NSArray *)images duration:(NSTimeInterval)duration forState:(MJRefreshState)state 50 | { 51 | if (images == nil) return; 52 | 53 | self.stateImages[@(state)] = images; 54 | self.stateDurations[@(state)] = @(duration); 55 | 56 | /* 根据图片设置控件的高度 */ 57 | UIImage *image = [images firstObject]; 58 | if (image.size.height > self.mj_h) { 59 | self.mj_h = image.size.height; 60 | } 61 | } 62 | 63 | - (void)setImages:(NSArray *)images forState:(MJRefreshState)state 64 | { 65 | [self setImages:images duration:images.count * 0.1 forState:state]; 66 | } 67 | 68 | #pragma mark - 实现父类的方法 69 | - (void)prepare 70 | { 71 | [super prepare]; 72 | 73 | // 初始化间距 74 | self.labelLeftInset = 20; 75 | } 76 | 77 | - (void)setPullingPercent:(CGFloat)pullingPercent 78 | { 79 | [super setPullingPercent:pullingPercent]; 80 | NSArray *images = self.stateImages[@(MJRefreshStateIdle)]; 81 | if (self.state != MJRefreshStateIdle || images.count == 0) return; 82 | // 停止动画 83 | [self.gifView stopAnimating]; 84 | // 设置当前需要显示的图片 85 | NSUInteger index = images.count * pullingPercent; 86 | if (index >= images.count) index = images.count - 1; 87 | self.gifView.image = images[index]; 88 | } 89 | 90 | - (void)placeSubviews 91 | { 92 | [super placeSubviews]; 93 | 94 | if (self.gifView.constraints.count) return; 95 | 96 | self.gifView.frame = self.bounds; 97 | if (self.stateLabel.hidden && self.lastUpdatedTimeLabel.hidden) { 98 | self.gifView.contentMode = UIViewContentModeCenter; 99 | } else { 100 | self.gifView.contentMode = UIViewContentModeRight; 101 | 102 | CGFloat stateWidth = self.stateLabel.mj_textWith; 103 | CGFloat timeWidth = 0.0; 104 | if (!self.lastUpdatedTimeLabel.hidden) { 105 | timeWidth = self.lastUpdatedTimeLabel.mj_textWith; 106 | } 107 | CGFloat textWidth = MAX(stateWidth, timeWidth); 108 | self.gifView.mj_w = self.mj_w * 0.5 - textWidth * 0.5 - self.labelLeftInset; 109 | } 110 | } 111 | 112 | - (void)setState:(MJRefreshState)state 113 | { 114 | MJRefreshCheckState 115 | 116 | // 根据状态做事情 117 | if (state == MJRefreshStatePulling || state == MJRefreshStateRefreshing) { 118 | NSArray *images = self.stateImages[@(state)]; 119 | if (images.count == 0) return; 120 | 121 | [self.gifView stopAnimating]; 122 | if (images.count == 1) { // 单张图片 123 | self.gifView.image = [images lastObject]; 124 | } else { // 多张图片 125 | self.gifView.animationImages = images; 126 | self.gifView.animationDuration = [self.stateDurations[@(state)] doubleValue]; 127 | [self.gifView startAnimating]; 128 | } 129 | } else if (state == MJRefreshStateIdle) { 130 | [self.gifView stopAnimating]; 131 | } 132 | } 133 | @end 134 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/Custom/Footer/Back/MJRefreshBackNormalFooter.m: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshBackNormalFooter.m 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshBackNormalFooter.h" 10 | #import "NSBundle+MJRefresh.h" 11 | 12 | @interface MJRefreshBackNormalFooter() 13 | { 14 | __unsafe_unretained UIImageView *_arrowView; 15 | } 16 | @property (weak, nonatomic) UIActivityIndicatorView *loadingView; 17 | @end 18 | 19 | @implementation MJRefreshBackNormalFooter 20 | #pragma mark - 懒加载子控件 21 | - (UIImageView *)arrowView 22 | { 23 | if (!_arrowView) { 24 | UIImageView *arrowView = [[UIImageView alloc] initWithImage:[NSBundle mj_arrowImage]]; 25 | [self addSubview:_arrowView = arrowView]; 26 | } 27 | return _arrowView; 28 | } 29 | 30 | 31 | - (UIActivityIndicatorView *)loadingView 32 | { 33 | if (!_loadingView) { 34 | UIActivityIndicatorView *loadingView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:self.activityIndicatorViewStyle]; 35 | loadingView.hidesWhenStopped = YES; 36 | [self addSubview:_loadingView = loadingView]; 37 | } 38 | return _loadingView; 39 | } 40 | 41 | - (void)setActivityIndicatorViewStyle:(UIActivityIndicatorViewStyle)activityIndicatorViewStyle 42 | { 43 | _activityIndicatorViewStyle = activityIndicatorViewStyle; 44 | 45 | self.loadingView = nil; 46 | [self setNeedsLayout]; 47 | } 48 | #pragma mark - 重写父类的方法 49 | - (void)prepare 50 | { 51 | [super prepare]; 52 | 53 | self.activityIndicatorViewStyle = UIActivityIndicatorViewStyleGray; 54 | } 55 | 56 | - (void)placeSubviews 57 | { 58 | [super placeSubviews]; 59 | 60 | // 箭头的中心点 61 | CGFloat arrowCenterX = self.mj_w * 0.5; 62 | if (!self.stateLabel.hidden) { 63 | arrowCenterX -= self.labelLeftInset + self.stateLabel.mj_textWith * 0.5; 64 | } 65 | CGFloat arrowCenterY = self.mj_h * 0.5; 66 | CGPoint arrowCenter = CGPointMake(arrowCenterX, arrowCenterY); 67 | 68 | // 箭头 69 | if (self.arrowView.constraints.count == 0) { 70 | self.arrowView.mj_size = self.arrowView.image.size; 71 | self.arrowView.center = arrowCenter; 72 | } 73 | 74 | // 圈圈 75 | if (self.loadingView.constraints.count == 0) { 76 | self.loadingView.center = arrowCenter; 77 | } 78 | 79 | self.arrowView.tintColor = self.stateLabel.textColor; 80 | } 81 | 82 | - (void)setState:(MJRefreshState)state 83 | { 84 | MJRefreshCheckState 85 | 86 | // 根据状态做事情 87 | if (state == MJRefreshStateIdle) { 88 | if (oldState == MJRefreshStateRefreshing) { 89 | self.arrowView.transform = CGAffineTransformMakeRotation(0.000001 - M_PI); 90 | [UIView animateWithDuration:MJRefreshSlowAnimationDuration animations:^{ 91 | self.loadingView.alpha = 0.0; 92 | } completion:^(BOOL finished) { 93 | // 防止动画结束后,状态已经不是MJRefreshStateIdle 94 | if (state != MJRefreshStateIdle) return; 95 | 96 | self.loadingView.alpha = 1.0; 97 | [self.loadingView stopAnimating]; 98 | 99 | self.arrowView.hidden = NO; 100 | }]; 101 | } else { 102 | self.arrowView.hidden = NO; 103 | [self.loadingView stopAnimating]; 104 | [UIView animateWithDuration:MJRefreshFastAnimationDuration animations:^{ 105 | self.arrowView.transform = CGAffineTransformMakeRotation(0.000001 - M_PI); 106 | }]; 107 | } 108 | } else if (state == MJRefreshStatePulling) { 109 | self.arrowView.hidden = NO; 110 | [self.loadingView stopAnimating]; 111 | [UIView animateWithDuration:MJRefreshFastAnimationDuration animations:^{ 112 | self.arrowView.transform = CGAffineTransformIdentity; 113 | }]; 114 | } else if (state == MJRefreshStateRefreshing) { 115 | self.arrowView.hidden = YES; 116 | [self.loadingView startAnimating]; 117 | } else if (state == MJRefreshStateNoMoreData) { 118 | self.arrowView.hidden = YES; 119 | [self.loadingView stopAnimating]; 120 | } 121 | } 122 | 123 | @end 124 | -------------------------------------------------------------------------------- /ZKTreeTableView/RequestHepler.m: -------------------------------------------------------------------------------- 1 | // 2 | // RequestHepler.m 3 | // ZKTreeTableView 4 | // 5 | // Created by bestdew on 2018/9/23. 6 | // Copyright © 2018年 bestdew. All rights reserved. 7 | // 8 | 9 | #import "RequestHepler.h" 10 | 11 | @implementation RequestHepler 12 | 13 | + (void)mockRequestNodesDataWithParams:(id)params success:(ResponseSuccess)success failure:(ResponseFailure)failure 14 | { 15 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 16 | NSError *error = nil; 17 | NSData *JSONData = [NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"Resource" ofType:@"json"]]; 18 | NSArray *dataArray = [NSJSONSerialization JSONObjectWithData:JSONData options:NSJSONReadingAllowFragments error:&error]; 19 | if (!error) { 20 | NSMutableArray *mutArray = [NSMutableArray arrayWithCapacity:dataArray.count]; 21 | for (NSDictionary *dict in dataArray) { 22 | NSMutableDictionary *mutDict = dict.mutableCopy; 23 | NSString *ID = [NSString stringWithFormat:@"%@_%@", mutDict[@"id"], params[@"pageIndex"]]; 24 | NSString *pID = [NSString stringWithFormat:@"%@_%@", mutDict[@"pid"], params[@"pageIndex"]]; 25 | [mutDict setObject:ID forKey:@"id"]; 26 | [mutDict setObject:pID forKey:@"pid"]; 27 | 28 | [mutArray addObject:mutDict]; 29 | } 30 | success(mutArray); 31 | } else { 32 | failure(error); 33 | } 34 | }); 35 | } 36 | 37 | + (void)mackRequestMoreChildNodeDataWithParams:(id)params success:(ResponseSuccess)success failure:(ResponseFailure)failure; 38 | { 39 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 40 | NSDictionary *tempDict = (NSDictionary *)params; 41 | NSError *error = [NSError errorWithDomain:@"com.ParamsError.Domain" code:429 userInfo:@{NSLocalizedDescriptionKey:@"传参错误"}]; 42 | if ((tempDict[@"level"] == nil) || (tempDict[@"order"] == nil) || (tempDict[@"pid"] == nil)) { 43 | if (failure) failure(error); 44 | return; 45 | } 46 | 47 | static NSInteger count = 30; count ++; 48 | NSArray *tempArray = [params[@"pid"] componentsSeparatedByString:@"_"]; 49 | if (tempArray.count != 2) { 50 | if (failure) failure(error); 51 | return; 52 | } 53 | NSString *ID = [NSString stringWithFormat:@"%zd_%@", count, [tempArray lastObject]]; 54 | NSDictionary *dict = @{@"id":ID, 55 | @"level":params[@"level"], 56 | @"image_name":@"touxiang_nan", 57 | @"nick_name":@"自是不复欲--见汝", 58 | @"content":@"每条评论都要认真的写,因为你不会知道在某个夜深人静的时候,有人会认真的逐条翻阅,他可能不会评论甚至也不会点赞,他只是在你熟睡的时候把你的悲欢喜乐都当成自己的,就像一只松鼠,在月光下的雪地里小心翼翼地捡起,散落在树下的一枚枚松子。", 59 | @"order_no":params[@"order"], 60 | @"childs_count":@(0), 61 | @"pid":params[@"pid"]}; 62 | 63 | if (success) success(dict); 64 | }); 65 | } 66 | 67 | + (void)submitCommentsWithParams:(id)params success:(ResponseSuccess)success failure:(ResponseFailure)failure 68 | { 69 | NSDictionary *tempDict = (NSDictionary *)params; 70 | NSError *error = [NSError errorWithDomain:@"com.ParamsError.Domain" code:429 userInfo:@{NSLocalizedDescriptionKey:@"传参错误"}]; 71 | if ((tempDict[@"level"] == nil) || (tempDict[@"order"] == nil) || (tempDict[@"pid"] == nil) || (tempDict[@"content"] == nil)) { 72 | if (failure) failure(error); 73 | return; 74 | } 75 | static NSInteger count = 429; count ++; 76 | NSString *ID = [NSString stringWithFormat:@"回复_%zd", count]; 77 | NSDictionary *dict = @{@"id":ID, 78 | @"level":tempDict[@"level"], 79 | @"image_name":@"touxiang_nv", 80 | @"nick_name":@"我是用来测试的", 81 | @"content":tempDict[@"content"], 82 | @"order_no":tempDict[@"order"], 83 | @"pid":tempDict[@"pid"], 84 | @"childsCount": @(0)}; 85 | if (success) success(dict); 86 | } 87 | 88 | @end 89 | -------------------------------------------------------------------------------- /ZKTreeTableView/ZKToolBar.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZKToolBar.m 3 | // ZKTreeTableView 4 | // 5 | // Created by bestdew on 2018/9/23. 6 | // Copyright © 2018年 bestdew. All rights reserved. 7 | // 8 | 9 | #import "ZKToolBar.h" 10 | 11 | @interface ZKToolBar () 12 | 13 | @property (nonatomic, weak) UILabel *brigeLabel; 14 | 15 | @end 16 | 17 | @implementation ZKToolBar 18 | 19 | - (instancetype)initWithFrame:(CGRect)frame 20 | { 21 | if (self = [super initWithFrame:frame]) { 22 | 23 | [self addSubviews]; 24 | } 25 | return self; 26 | } 27 | 28 | - (void)buttonAction:(UIButton *)button 29 | { 30 | if ([self.delegate respondsToSelector:@selector(toolBar:didCilckAtIndex:)]) { 31 | NSInteger index = button.tag - 200; 32 | [self.delegate toolBar:self didCilckAtIndex:index]; 33 | } 34 | } 35 | 36 | - (void)setBrigeCount:(NSInteger)brigeCount 37 | { 38 | _brigeCount = brigeCount; 39 | 40 | if (brigeCount == 0) { 41 | _brigeLabel.text = nil; 42 | } else if (brigeCount > 1000) { 43 | _brigeLabel.text = @"1k+"; 44 | } else { 45 | _brigeLabel.text = @(brigeCount).stringValue; 46 | } 47 | _brigeLabel.hidden = (brigeCount == 0); 48 | CGSize textSize = [_brigeLabel sizeThatFits:CGSizeMake(MAXFLOAT, 15.f)]; 49 | CGRect rect = _brigeLabel.frame; 50 | rect.size.width = (textSize.width < 15.f) ? 15.f : (textSize.width + 4.f); 51 | _brigeLabel.frame = rect; 52 | } 53 | 54 | - (void)addSubviews 55 | { 56 | CALayer *lineLayer = [CALayer layer]; 57 | lineLayer.frame = CGRectMake(0, 0, self.frame.size.width, 1.f); 58 | lineLayer.backgroundColor = [UIColor colorWithRed:0.90 green:0.90 blue:0.90 alpha:1.00].CGColor; 59 | [self.layer addSublayer:lineLayer]; 60 | 61 | UIButton *inputButton = [UIButton buttonWithType:UIButtonTypeCustom]; 62 | inputButton.frame = CGRectMake(16.f, 7.f, self.frame.size.width - 128.f, 32.f); 63 | inputButton.tag = 200; 64 | inputButton.layer.backgroundColor = [UIColor colorWithRed:0.96 green:0.96 blue:0.96 alpha:1.00].CGColor; 65 | inputButton.layer.masksToBounds = YES; 66 | inputButton.layer.cornerRadius = 8.f; 67 | inputButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft; 68 | inputButton.titleEdgeInsets = UIEdgeInsetsMake(5.f, 8.f, 5.f, 0); 69 | inputButton.titleLabel.font = [UIFont systemFontOfSize:16.f]; 70 | [inputButton setTitle:@"我来说两句" forState:UIControlStateNormal]; 71 | [inputButton setTitleColor:[UIColor colorWithRed:0.72 green:0.73 blue:0.75 alpha:1.00] forState:UIControlStateNormal]; 72 | [inputButton addTarget:self action:@selector(buttonAction:) forControlEvents:UIControlEventTouchUpInside]; 73 | [self addSubview:inputButton]; 74 | 75 | UIButton *viewcButton = [UIButton buttonWithType:UIButtonTypeCustom]; 76 | viewcButton.frame = CGRectMake(CGRectGetMaxX(inputButton.frame) + 20.f, 13.f, 24.f, 21.f); 77 | viewcButton.tag = 201; 78 | [viewcButton setImage:[UIImage imageNamed:@"ic_comment_new"] forState:UIControlStateNormal]; 79 | [viewcButton addTarget:self action:@selector(buttonAction:) forControlEvents:UIControlEventTouchUpInside]; 80 | [self addSubview:viewcButton]; 81 | 82 | UIButton *shareButton = [UIButton buttonWithType:UIButtonTypeCustom]; 83 | shareButton.frame = CGRectMake(CGRectGetMaxX(viewcButton.frame) + 25.f, 10.f, 25.f, 25.f); 84 | shareButton.tag = 202; 85 | [shareButton setImage:[UIImage imageNamed:@"share_normal"] forState:UIControlStateNormal]; 86 | [shareButton addTarget:self action:@selector(buttonAction:) forControlEvents:UIControlEventTouchUpInside]; 87 | [self addSubview:shareButton]; 88 | 89 | UILabel *brigeLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(viewcButton.frame) - 10.f, viewcButton.frame.origin.y - 4.f, 15.f, 13.f)]; 90 | brigeLabel.font = [UIFont systemFontOfSize:9.f]; 91 | brigeLabel.textColor = [UIColor whiteColor]; 92 | brigeLabel.hidden = YES; 93 | brigeLabel.textAlignment = NSTextAlignmentCenter; 94 | brigeLabel.layer.backgroundColor = [UIColor redColor].CGColor; 95 | brigeLabel.layer.masksToBounds = YES; 96 | brigeLabel.layer.cornerRadius = 2.f; 97 | [self addSubview:brigeLabel]; 98 | _brigeLabel = brigeLabel; 99 | } 100 | 101 | - (void)dealloc 102 | { 103 | NSLog(@"%s", __func__); 104 | } 105 | 106 | @end 107 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/Custom/Header/MJRefreshNormalHeader.m: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshNormalHeader.m 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshNormalHeader.h" 10 | #import "NSBundle+MJRefresh.h" 11 | 12 | @interface MJRefreshNormalHeader() 13 | { 14 | __unsafe_unretained UIImageView *_arrowView; 15 | } 16 | @property (weak, nonatomic) UIActivityIndicatorView *loadingView; 17 | @end 18 | 19 | @implementation MJRefreshNormalHeader 20 | #pragma mark - 懒加载子控件 21 | - (UIImageView *)arrowView 22 | { 23 | if (!_arrowView) { 24 | UIImageView *arrowView = [[UIImageView alloc] initWithImage:[NSBundle mj_arrowImage]]; 25 | [self addSubview:_arrowView = arrowView]; 26 | } 27 | return _arrowView; 28 | } 29 | 30 | - (UIActivityIndicatorView *)loadingView 31 | { 32 | if (!_loadingView) { 33 | UIActivityIndicatorView *loadingView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:self.activityIndicatorViewStyle]; 34 | loadingView.hidesWhenStopped = YES; 35 | [self addSubview:_loadingView = loadingView]; 36 | } 37 | return _loadingView; 38 | } 39 | 40 | #pragma mark - 公共方法 41 | - (void)setActivityIndicatorViewStyle:(UIActivityIndicatorViewStyle)activityIndicatorViewStyle 42 | { 43 | _activityIndicatorViewStyle = activityIndicatorViewStyle; 44 | 45 | self.loadingView = nil; 46 | [self setNeedsLayout]; 47 | } 48 | 49 | #pragma mark - 重写父类的方法 50 | - (void)prepare 51 | { 52 | [super prepare]; 53 | 54 | self.activityIndicatorViewStyle = UIActivityIndicatorViewStyleGray; 55 | } 56 | 57 | - (void)placeSubviews 58 | { 59 | [super placeSubviews]; 60 | 61 | // 箭头的中心点 62 | CGFloat arrowCenterX = self.mj_w * 0.5; 63 | if (!self.stateLabel.hidden) { 64 | CGFloat stateWidth = self.stateLabel.mj_textWith; 65 | CGFloat timeWidth = 0.0; 66 | if (!self.lastUpdatedTimeLabel.hidden) { 67 | timeWidth = self.lastUpdatedTimeLabel.mj_textWith; 68 | } 69 | CGFloat textWidth = MAX(stateWidth, timeWidth); 70 | arrowCenterX -= textWidth / 2 + self.labelLeftInset; 71 | } 72 | CGFloat arrowCenterY = self.mj_h * 0.5; 73 | CGPoint arrowCenter = CGPointMake(arrowCenterX, arrowCenterY); 74 | 75 | // 箭头 76 | if (self.arrowView.constraints.count == 0) { 77 | self.arrowView.mj_size = self.arrowView.image.size; 78 | self.arrowView.center = arrowCenter; 79 | } 80 | 81 | // 圈圈 82 | if (self.loadingView.constraints.count == 0) { 83 | self.loadingView.center = arrowCenter; 84 | } 85 | 86 | self.arrowView.tintColor = self.stateLabel.textColor; 87 | } 88 | 89 | - (void)setState:(MJRefreshState)state 90 | { 91 | MJRefreshCheckState 92 | 93 | // 根据状态做事情 94 | if (state == MJRefreshStateIdle) { 95 | if (oldState == MJRefreshStateRefreshing) { 96 | self.arrowView.transform = CGAffineTransformIdentity; 97 | 98 | [UIView animateWithDuration:MJRefreshSlowAnimationDuration animations:^{ 99 | self.loadingView.alpha = 0.0; 100 | } completion:^(BOOL finished) { 101 | // 如果执行完动画发现不是idle状态,就直接返回,进入其他状态 102 | if (self.state != MJRefreshStateIdle) return; 103 | 104 | self.loadingView.alpha = 1.0; 105 | [self.loadingView stopAnimating]; 106 | self.arrowView.hidden = NO; 107 | }]; 108 | } else { 109 | [self.loadingView stopAnimating]; 110 | self.arrowView.hidden = NO; 111 | [UIView animateWithDuration:MJRefreshFastAnimationDuration animations:^{ 112 | self.arrowView.transform = CGAffineTransformIdentity; 113 | }]; 114 | } 115 | } else if (state == MJRefreshStatePulling) { 116 | [self.loadingView stopAnimating]; 117 | self.arrowView.hidden = NO; 118 | [UIView animateWithDuration:MJRefreshFastAnimationDuration animations:^{ 119 | self.arrowView.transform = CGAffineTransformMakeRotation(0.000001 - M_PI); 120 | }]; 121 | } else if (state == MJRefreshStateRefreshing) { 122 | self.loadingView.alpha = 1.0; // 防止refreshing -> idle的动画完毕动作没有被执行 123 | [self.loadingView startAnimating]; 124 | self.arrowView.hidden = YES; 125 | } 126 | } 127 | @end 128 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/UIScrollView+MJRefresh.m: -------------------------------------------------------------------------------- 1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh 2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 3 | // UIScrollView+MJRefresh.m 4 | // MJRefreshExample 5 | // 6 | // Created by MJ Lee on 15/3/4. 7 | // Copyright (c) 2015年 小码哥. All rights reserved. 8 | // 9 | 10 | #import "UIScrollView+MJRefresh.h" 11 | #import "MJRefreshHeader.h" 12 | #import "MJRefreshFooter.h" 13 | #import 14 | 15 | @implementation NSObject (MJRefresh) 16 | 17 | + (void)exchangeInstanceMethod1:(SEL)method1 method2:(SEL)method2 18 | { 19 | method_exchangeImplementations(class_getInstanceMethod(self, method1), class_getInstanceMethod(self, method2)); 20 | } 21 | 22 | + (void)exchangeClassMethod1:(SEL)method1 method2:(SEL)method2 23 | { 24 | method_exchangeImplementations(class_getClassMethod(self, method1), class_getClassMethod(self, method2)); 25 | } 26 | 27 | @end 28 | 29 | @implementation UIScrollView (MJRefresh) 30 | 31 | #pragma mark - header 32 | static const char MJRefreshHeaderKey = '\0'; 33 | - (void)setMj_header:(MJRefreshHeader *)mj_header 34 | { 35 | if (mj_header != self.mj_header) { 36 | // 删除旧的,添加新的 37 | [self.mj_header removeFromSuperview]; 38 | [self insertSubview:mj_header atIndex:0]; 39 | 40 | // 存储新的 41 | objc_setAssociatedObject(self, &MJRefreshHeaderKey, 42 | mj_header, OBJC_ASSOCIATION_RETAIN); 43 | } 44 | } 45 | 46 | - (MJRefreshHeader *)mj_header 47 | { 48 | return objc_getAssociatedObject(self, &MJRefreshHeaderKey); 49 | } 50 | 51 | #pragma mark - footer 52 | static const char MJRefreshFooterKey = '\0'; 53 | - (void)setMj_footer:(MJRefreshFooter *)mj_footer 54 | { 55 | if (mj_footer != self.mj_footer) { 56 | // 删除旧的,添加新的 57 | [self.mj_footer removeFromSuperview]; 58 | [self insertSubview:mj_footer atIndex:0]; 59 | 60 | // 存储新的 61 | objc_setAssociatedObject(self, &MJRefreshFooterKey, 62 | mj_footer, OBJC_ASSOCIATION_RETAIN); 63 | } 64 | } 65 | 66 | - (MJRefreshFooter *)mj_footer 67 | { 68 | return objc_getAssociatedObject(self, &MJRefreshFooterKey); 69 | } 70 | 71 | #pragma mark - 过期 72 | - (void)setFooter:(MJRefreshFooter *)footer 73 | { 74 | self.mj_footer = footer; 75 | } 76 | 77 | - (MJRefreshFooter *)footer 78 | { 79 | return self.mj_footer; 80 | } 81 | 82 | - (void)setHeader:(MJRefreshHeader *)header 83 | { 84 | self.mj_header = header; 85 | } 86 | 87 | - (MJRefreshHeader *)header 88 | { 89 | return self.mj_header; 90 | } 91 | 92 | #pragma mark - other 93 | - (NSInteger)mj_totalDataCount 94 | { 95 | NSInteger totalCount = 0; 96 | if ([self isKindOfClass:[UITableView class]]) { 97 | UITableView *tableView = (UITableView *)self; 98 | 99 | for (NSInteger section = 0; section _scrollView.mj_h) { // 内容超过一个屏幕 78 | // 这里的_scrollView.mj_contentH替换掉self.mj_y更为合理 79 | if (_scrollView.mj_offsetY >= _scrollView.mj_contentH - _scrollView.mj_h + self.mj_h * self.triggerAutomaticallyRefreshPercent + _scrollView.mj_insetB - self.mj_h) { 80 | // 防止手松开时连续调用 81 | CGPoint old = [change[@"old"] CGPointValue]; 82 | CGPoint new = [change[@"new"] CGPointValue]; 83 | if (new.y <= old.y) return; 84 | 85 | // 当底部刷新控件完全出现时,才刷新 86 | [self beginRefreshing]; 87 | } 88 | } 89 | } 90 | 91 | - (void)scrollViewPanStateDidChange:(NSDictionary *)change 92 | { 93 | [super scrollViewPanStateDidChange:change]; 94 | 95 | if (self.state != MJRefreshStateIdle) return; 96 | 97 | UIGestureRecognizerState panState = _scrollView.panGestureRecognizer.state; 98 | if (panState == UIGestureRecognizerStateEnded) {// 手松开 99 | if (_scrollView.mj_insetT + _scrollView.mj_contentH <= _scrollView.mj_h) { // 不够一个屏幕 100 | if (_scrollView.mj_offsetY >= - _scrollView.mj_insetT) { // 向上拽 101 | [self beginRefreshing]; 102 | } 103 | } else { // 超出一个屏幕 104 | if (_scrollView.mj_offsetY >= _scrollView.mj_contentH + _scrollView.mj_insetB - _scrollView.mj_h) { 105 | [self beginRefreshing]; 106 | } 107 | } 108 | } else if (panState == UIGestureRecognizerStateBegan) { 109 | self.oneNewPan = YES; 110 | } 111 | } 112 | 113 | - (void)beginRefreshing 114 | { 115 | if (!self.isOneNewPan && self.isOnlyRefreshPerDrag) return; 116 | 117 | [super beginRefreshing]; 118 | 119 | self.oneNewPan = NO; 120 | } 121 | 122 | - (void)setState:(MJRefreshState)state 123 | { 124 | MJRefreshCheckState 125 | 126 | if (state == MJRefreshStateRefreshing) { 127 | [self executeRefreshingCallback]; 128 | } else if (state == MJRefreshStateNoMoreData || state == MJRefreshStateIdle) { 129 | if (MJRefreshStateRefreshing == oldState) { 130 | if (self.endRefreshingCompletionBlock) { 131 | self.endRefreshingCompletionBlock(); 132 | } 133 | } 134 | } 135 | } 136 | 137 | - (void)setHidden:(BOOL)hidden 138 | { 139 | BOOL lastHidden = self.isHidden; 140 | 141 | [super setHidden:hidden]; 142 | 143 | if (!lastHidden && hidden) { 144 | self.state = MJRefreshStateIdle; 145 | 146 | self.scrollView.mj_insetB -= self.mj_h; 147 | } else if (lastHidden && !hidden) { 148 | self.scrollView.mj_insetB += self.mj_h; 149 | 150 | // 设置位置 151 | self.mj_y = _scrollView.mj_contentH; 152 | } 153 | } 154 | @end 155 | -------------------------------------------------------------------------------- /ZKTreeTableView/CommentCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // CommentCell.m 3 | // ZKTreeTableView 4 | // 5 | // Created by bestdew on 2018/8/30. 6 | // Copyright © 2018年 bestdew. All rights reserved. 7 | // 8 | 9 | #import "CommentCell.h" 10 | #import "CommentModel.h" 11 | 12 | @interface CommentCell () 13 | 14 | @property (nonatomic, strong) UIImageView *imgView; 15 | @property (nonatomic, strong) UILabel *nickNameLabel; 16 | @property (nonatomic, strong) UILabel *contentLabel; 17 | @property (nonatomic, strong) UIButton *expandButton; 18 | 19 | @end 20 | 21 | @implementation CommentCell 22 | 23 | - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier 24 | { 25 | if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) { 26 | 27 | [self.view addSubview:self.imgView]; 28 | [self.view addSubview:self.nickNameLabel]; 29 | [self.view addSubview:self.expandButton]; 30 | [self.view addSubview:self.contentLabel]; 31 | } 32 | return self; 33 | } 34 | 35 | #pragma mark -- Action 36 | - (void)expand:(UIButton *)button 37 | { 38 | if (self.block) { 39 | self.block(self.node); 40 | } 41 | } 42 | 43 | - (void)layoutSubviews 44 | { 45 | [super layoutSubviews]; 46 | 47 | CGFloat imgX = 0.f, imgY = 0.f, imgSize = 0.f; 48 | if (self.node.level == 0) { 49 | imgX = 16.f; 50 | imgY = 18.f; 51 | imgSize = 40.f; 52 | } else if (self.node.level == 1) { 53 | imgX = 12.f; 54 | imgY = 12.f; 55 | imgSize = 24.f; 56 | } else { 57 | imgX = 8.f; 58 | imgY = 12.f; 59 | imgSize = 24.f; 60 | } 61 | 62 | _imgView.frame = CGRectMake(imgX, imgY, imgSize, imgSize); 63 | _imgView.layer.cornerRadius = imgSize / 2; 64 | _nickNameLabel.frame = CGRectMake(imgX + imgSize + 12.f, imgY, self.view.frame.size.width - imgX - imgSize - 50.f, 24.f); 65 | _expandButton.frame = CGRectMake(CGRectGetMaxX(_nickNameLabel.frame) + 2.f, _nickNameLabel.frame.origin.y, 20.f, 20.f); 66 | _contentLabel.frame = CGRectMake(imgX + imgSize + 4.f, CGRectGetMaxY(_nickNameLabel.frame) + 4.f, self.view.frame.size.width - imgX - imgSize - 20.f, self.view.frame.size.height - CGRectGetMaxY(_nickNameLabel.frame) - 4.f); 67 | _contentLabel.layer.cornerRadius = 8.f; 68 | } 69 | 70 | - (void)setNode:(ZKTreeNode *)node 71 | { 72 | [super setNode:node]; // 必须调用父类方法 73 | 74 | CommentModel *model = (CommentModel *)node.data; 75 | 76 | _nickNameLabel.text = model.nick_name; 77 | _expandButton.selected = node.isExpand; 78 | _expandButton.hidden = (node.childNodes.count == 0); 79 | _imgView.image = [UIImage imageNamed:model.image_name]; 80 | _contentLabel.attributedText = [self attributedTextWithString:model.content]; 81 | } 82 | 83 | - (NSAttributedString *)attributedTextWithString:(NSString *)string 84 | { 85 | NSMutableParagraphStyle *paraStyle = [[NSMutableParagraphStyle alloc] init]; 86 | paraStyle.alignment = NSTextAlignmentLeft; 87 | paraStyle.firstLineHeadIndent = 10.f; 88 | paraStyle.headIndent = 10.f; 89 | //paraStyle.lineSpacing = 2.f; 90 | paraStyle.tailIndent = -5.f; 91 | paraStyle.minimumLineHeight = 24.f; 92 | 93 | NSDictionary *dic = @{NSFontAttributeName:[UIFont systemFontOfSize:17.f], 94 | NSParagraphStyleAttributeName:paraStyle}; 95 | NSAttributedString *attributeText = [[NSAttributedString alloc] initWithString:string attributes:dic]; 96 | 97 | return attributeText; 98 | } 99 | 100 | - (UILabel *)nickNameLabel 101 | { 102 | if (_nickNameLabel == nil) { 103 | 104 | _nickNameLabel = [[UILabel alloc] init]; 105 | _nickNameLabel.font = [UIFont systemFontOfSize:14.f]; 106 | } 107 | return _nickNameLabel; 108 | } 109 | 110 | - (UIImageView *)imgView 111 | { 112 | if (_imgView == nil) { 113 | 114 | _imgView = [[UIImageView alloc] init]; 115 | } 116 | return _imgView; 117 | } 118 | 119 | - (UILabel *)contentLabel 120 | { 121 | if (_contentLabel == nil) { 122 | 123 | _contentLabel = [[UILabel alloc] init]; 124 | _contentLabel.layer.backgroundColor = [UIColor colorWithRed:0.94 green:0.95 blue:0.95 alpha:1.00].CGColor; 125 | _contentLabel.numberOfLines = 0; 126 | } 127 | return _contentLabel; 128 | } 129 | 130 | - (UIButton *)expandButton 131 | { 132 | if (_expandButton == nil) { 133 | 134 | _expandButton = [UIButton buttonWithType:UIButtonTypeCustom]; 135 | [_expandButton setImage:[UIImage imageNamed:@"select_top_icon"] forState:UIControlStateNormal]; 136 | [_expandButton setImage:[UIImage imageNamed:@"select_down_icon"] forState:UIControlStateSelected]; 137 | [_expandButton addTarget:self action:@selector(expand:) forControlEvents:UIControlEventTouchUpInside]; 138 | } 139 | return _expandButton; 140 | } 141 | 142 | @end 143 | -------------------------------------------------------------------------------- /ZKTreeTableView/ZKTreeListView/ZKTreeListView.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZKTreeListView.h 3 | // ZKTreeListViewDemo 4 | // 5 | // Created by bestdew on 2018/9/5. 6 | // Copyright © 2018年 bestdew. All rights reserved. 7 | // 8 | // d*##$. 9 | // zP"""""$e. $" $o 10 | //4$ '$ $" $ 11 | //'$ '$ J$ $F 12 | // 'b $k $> $ 13 | // $k $r J$ d$ 14 | // '$ $ $" $~ 15 | // '$ "$ '$E $ 16 | // $ $L $" $F ... 17 | // $. 4B $ $$$*"""*b 18 | // '$ $. $$ $$ $F 19 | // "$ R$ $F $" $ 20 | // $k ?$ u* dF .$ 21 | // ^$. $$" z$ u$$$$e 22 | // #$b $E.dW@e$" ?$ 23 | // #$ .o$$# d$$$$c ?F 24 | // $ .d$$#" . zo$> #$r .uF 25 | // $L .u$*" $&$$$k .$$d$$F 26 | // $$" ""^"$$$P"$P9$ 27 | // JP .o$$$$u:$P $$ 28 | // $ ..ue$" "" $" 29 | // d$ $F $ 30 | // $$ ....udE 4B 31 | // #$ """"` $r @$ 32 | // ^$L '$ $F 33 | // RN 4N $ 34 | // *$b d$ 35 | // $$k $F 36 | // $$b $F 37 | // $"" $F 38 | // '$ $ 39 | // $L $ 40 | // '$ $ 41 | // $ $ 42 | 43 | #import 44 | #import "ZKTreeListViewCell.h" 45 | 46 | NS_ASSUME_NONNULL_BEGIN 47 | 48 | @class ZKTreeListView; 49 | 50 | typedef NS_ENUM(NSInteger, ZKTreeListViewStyle) { 51 | ZKTreeListViewStyleNormal, // 默认 52 | ZKTreeListViewStyleStructureLine, // 带有结构线 53 | }; 54 | 55 | @protocol ZKTreeListViewDelegate 56 | 57 | /** 返回节点所在的 cell,必须实现 */ 58 | - (ZKTreeListViewCell *)treeListView:(ZKTreeListView *)listView cellForNode:(ZKTreeNode *)node atIndexPath:(NSIndexPath *)indexPath; 59 | 60 | @optional 61 | /** 点击回调 */ 62 | - (void)treeListView:(ZKTreeListView *)listView didSelectNode:(ZKTreeNode *)node atIndexPath:(NSIndexPath *)indexPath; 63 | /** 64 | 若设置了 node.rowHeight,优先读取 node.rowHeight; 65 | 若未设置,则回调此代理方法,并赋值 node.rowHeight ,避免重复计算带来的性能消耗 66 | */ 67 | - (CGFloat)treeListView:(ZKTreeListView *)listView rowHeightForNode:(ZKTreeNode *)node atIndexPath:(NSIndexPath *)indexPath; 68 | 69 | /** 滚动回调(实际上就是 scrollView 的部分代理方法) */ 70 | - (void)treeListView:(ZKTreeListView *)listView didScroll:(CGPoint)offset; 71 | - (void)treeListView:(ZKTreeListView *)listView willBeginDragging:(CGPoint)offset; 72 | - (void)treeListView:(ZKTreeListView *)listView didEndDragging:(CGPoint)offset willDecelerate:(BOOL)decelerate; 73 | 74 | @end 75 | 76 | @interface ZKTreeListView : UIView 77 | 78 | /** 样式 */ 79 | @property (nonatomic, readonly, assign) ZKTreeListViewStyle style; 80 | /** 全部数据,包含已展示的数据和未展示的数据 */ 81 | @property (nonatomic, readonly, strong) NSSet *allNodes; 82 | /** 已展示的数据 */ 83 | @property (nonatomic, readonly, strong) NSArray *showNodes; 84 | /** 默认展开的等级 */ 85 | @property (nonatomic, assign) NSInteger defaultExpandLevel; 86 | /** 代理 */ 87 | @property (nonatomic, weak) id delegate; 88 | /** 当点击 cell 的时候是否自动展开/折叠(默认为YES) */ 89 | @property (nonatomic, assign) BOOL autoExpand; 90 | /** 是否显示折叠动画(默认为YES) */ 91 | @property (nonatomic, assign) BOOL showAnimation; 92 | /** 内部 tableView,请勿设置其代理 */ 93 | @property (nonatomic, readonly, strong) UITableView *tableView; 94 | 95 | /** 初始化 */ 96 | - (instancetype)initWithFrame:(CGRect)frame style:(ZKTreeListViewStyle)style NS_DESIGNATED_INITIALIZER; 97 | - (nullable instancetype)initWithCoder:(NSCoder *)aDecoder NS_DESIGNATED_INITIALIZER; 98 | 99 | /** 加载全部数据 */ 100 | - (void)loadNodes:(NSArray *)nodes; 101 | /** 重新加载一组节点 */ 102 | - (void)reloadNodes:(NSArray *)nodes; 103 | /** 追加根节点(会创建新的分组) */ 104 | - (void)appendRootNodes:(NSArray *)nodes; 105 | /** 106 | 在 node 子节点的末尾追加子节点 107 | 108 | @param nodes 需要添加的节点数组 109 | @param node 需要添加子节点的目标节点,当 node == nil 时,添加根节点,但不会创建新的分组,在根节点追加数据时,建议使用 -appendNodes: 110 | @param isTop 若为 YES,则在 头部添加,若为 NO,则在末尾添加 111 | */ 112 | - (void)addChildNodes:(NSArray *)nodes 113 | forNode:(nullable ZKTreeNode *)node 114 | placedAtTop:(BOOL)isTop; 115 | /** 删除一个节点(包含子节点) */ 116 | - (void)deleteNode:(ZKTreeNode *)node; 117 | 118 | /** 全部展开/折叠到多少层级 */ 119 | - (void)expandAllNodesWithLevel:(NSInteger)expandLevel; 120 | /** 展开/折叠一组 nodes */ 121 | - (void)expandNodes:(NSArray *)nodes withExpand:(BOOL)isExpand; 122 | 123 | /** 注册自定义cell,必须继承自 */ 124 | - (void)registerClass:(nullable Class)cellClass forCellReuseIdentifier:(NSString *)identifier; 125 | - (__kindof ZKTreeListViewCell *)dequeueReusableCellWithIdentifier:(NSString *)identifier forIndexPath:(NSIndexPath *)indexPath; 126 | /** 根据 node 获取其所在的 cell */ 127 | - (nullable __kindof ZKTreeListViewCell *)cellForNode:(ZKTreeNode *)node; 128 | - (nullable __kindof ZKTreeListViewCell *)cellForRowAtIndexPath:(NSIndexPath *)indexPath; 129 | /** 根据等级返回相应的缩进宽度 */ 130 | - (CGFloat)indentationWidthWithLevel:(NSInteger)level; 131 | 132 | @end 133 | 134 | NS_ASSUME_NONNULL_END 135 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/Base/MJRefreshBackFooter.m: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshBackFooter.m 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshBackFooter.h" 10 | 11 | @interface MJRefreshBackFooter() 12 | @property (assign, nonatomic) NSInteger lastRefreshCount; 13 | @property (assign, nonatomic) CGFloat lastBottomDelta; 14 | @end 15 | 16 | @implementation MJRefreshBackFooter 17 | 18 | #pragma mark - 初始化 19 | - (void)willMoveToSuperview:(UIView *)newSuperview 20 | { 21 | [super willMoveToSuperview:newSuperview]; 22 | 23 | [self scrollViewContentSizeDidChange:nil]; 24 | } 25 | 26 | #pragma mark - 实现父类的方法 27 | - (void)scrollViewContentOffsetDidChange:(NSDictionary *)change 28 | { 29 | [super scrollViewContentOffsetDidChange:change]; 30 | 31 | // 如果正在刷新,直接返回 32 | if (self.state == MJRefreshStateRefreshing) return; 33 | 34 | _scrollViewOriginalInset = self.scrollView.mj_inset; 35 | 36 | // 当前的contentOffset 37 | CGFloat currentOffsetY = self.scrollView.mj_offsetY; 38 | // 尾部控件刚好出现的offsetY 39 | CGFloat happenOffsetY = [self happenOffsetY]; 40 | // 如果是向下滚动到看不见尾部控件,直接返回 41 | if (currentOffsetY <= happenOffsetY) return; 42 | 43 | CGFloat pullingPercent = (currentOffsetY - happenOffsetY) / self.mj_h; 44 | 45 | // 如果已全部加载,仅设置pullingPercent,然后返回 46 | if (self.state == MJRefreshStateNoMoreData) { 47 | self.pullingPercent = pullingPercent; 48 | return; 49 | } 50 | 51 | if (self.scrollView.isDragging) { 52 | self.pullingPercent = pullingPercent; 53 | // 普通 和 即将刷新 的临界点 54 | CGFloat normal2pullingOffsetY = happenOffsetY + self.mj_h; 55 | 56 | if (self.state == MJRefreshStateIdle && currentOffsetY > normal2pullingOffsetY) { 57 | // 转为即将刷新状态 58 | self.state = MJRefreshStatePulling; 59 | } else if (self.state == MJRefreshStatePulling && currentOffsetY <= normal2pullingOffsetY) { 60 | // 转为普通状态 61 | self.state = MJRefreshStateIdle; 62 | } 63 | } else if (self.state == MJRefreshStatePulling) {// 即将刷新 && 手松开 64 | // 开始刷新 65 | [self beginRefreshing]; 66 | } else if (pullingPercent < 1) { 67 | self.pullingPercent = pullingPercent; 68 | } 69 | } 70 | 71 | - (void)scrollViewContentSizeDidChange:(NSDictionary *)change 72 | { 73 | [super scrollViewContentSizeDidChange:change]; 74 | 75 | // 内容的高度 76 | CGFloat contentHeight = self.scrollView.mj_contentH + self.ignoredScrollViewContentInsetBottom; 77 | // 表格的高度 78 | CGFloat scrollHeight = self.scrollView.mj_h - self.scrollViewOriginalInset.top - self.scrollViewOriginalInset.bottom + self.ignoredScrollViewContentInsetBottom; 79 | // 设置位置和尺寸 80 | self.mj_y = MAX(contentHeight, scrollHeight); 81 | } 82 | 83 | - (void)setState:(MJRefreshState)state 84 | { 85 | MJRefreshCheckState 86 | 87 | // 根据状态来设置属性 88 | if (state == MJRefreshStateNoMoreData || state == MJRefreshStateIdle) { 89 | // 刷新完毕 90 | if (MJRefreshStateRefreshing == oldState) { 91 | [UIView animateWithDuration:MJRefreshSlowAnimationDuration animations:^{ 92 | self.scrollView.mj_insetB -= self.lastBottomDelta; 93 | 94 | // 自动调整透明度 95 | if (self.isAutomaticallyChangeAlpha) self.alpha = 0.0; 96 | } completion:^(BOOL finished) { 97 | self.pullingPercent = 0.0; 98 | 99 | if (self.endRefreshingCompletionBlock) { 100 | self.endRefreshingCompletionBlock(); 101 | } 102 | }]; 103 | } 104 | 105 | CGFloat deltaH = [self heightForContentBreakView]; 106 | // 刚刷新完毕 107 | if (MJRefreshStateRefreshing == oldState && deltaH > 0 && self.scrollView.mj_totalDataCount != self.lastRefreshCount) { 108 | self.scrollView.mj_offsetY = self.scrollView.mj_offsetY; 109 | } 110 | } else if (state == MJRefreshStateRefreshing) { 111 | // 记录刷新前的数量 112 | self.lastRefreshCount = self.scrollView.mj_totalDataCount; 113 | 114 | [UIView animateWithDuration:MJRefreshFastAnimationDuration animations:^{ 115 | CGFloat bottom = self.mj_h + self.scrollViewOriginalInset.bottom; 116 | CGFloat deltaH = [self heightForContentBreakView]; 117 | if (deltaH < 0) { // 如果内容高度小于view的高度 118 | bottom -= deltaH; 119 | } 120 | self.lastBottomDelta = bottom - self.scrollView.mj_insetB; 121 | self.scrollView.mj_insetB = bottom; 122 | self.scrollView.mj_offsetY = [self happenOffsetY] + self.mj_h; 123 | } completion:^(BOOL finished) { 124 | [self executeRefreshingCallback]; 125 | }]; 126 | } 127 | } 128 | #pragma mark - 私有方法 129 | #pragma mark 获得scrollView的内容 超出 view 的高度 130 | - (CGFloat)heightForContentBreakView 131 | { 132 | CGFloat h = self.scrollView.frame.size.height - self.scrollViewOriginalInset.bottom - self.scrollViewOriginalInset.top; 133 | return self.scrollView.contentSize.height - h; 134 | } 135 | 136 | #pragma mark 刚好看到上拉刷新控件时的contentOffset.y 137 | - (CGFloat)happenOffsetY 138 | { 139 | CGFloat deltaH = [self heightForContentBreakView]; 140 | if (deltaH > 0) { 141 | return deltaH - self.scrollViewOriginalInset.top; 142 | } else { 143 | return - self.scrollViewOriginalInset.top; 144 | } 145 | } 146 | @end 147 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/Base/MJRefreshHeader.m: -------------------------------------------------------------------------------- 1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh 2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 3 | // MJRefreshHeader.m 4 | // MJRefreshExample 5 | // 6 | // Created by MJ Lee on 15/3/4. 7 | // Copyright (c) 2015年 小码哥. All rights reserved. 8 | // 9 | 10 | #import "MJRefreshHeader.h" 11 | 12 | @interface MJRefreshHeader() 13 | @property (assign, nonatomic) CGFloat insetTDelta; 14 | @end 15 | 16 | @implementation MJRefreshHeader 17 | #pragma mark - 构造方法 18 | + (instancetype)headerWithRefreshingBlock:(MJRefreshComponentRefreshingBlock)refreshingBlock 19 | { 20 | MJRefreshHeader *cmp = [[self alloc] init]; 21 | cmp.refreshingBlock = refreshingBlock; 22 | return cmp; 23 | } 24 | + (instancetype)headerWithRefreshingTarget:(id)target refreshingAction:(SEL)action 25 | { 26 | MJRefreshHeader *cmp = [[self alloc] init]; 27 | [cmp setRefreshingTarget:target refreshingAction:action]; 28 | return cmp; 29 | } 30 | 31 | #pragma mark - 覆盖父类的方法 32 | - (void)prepare 33 | { 34 | [super prepare]; 35 | 36 | // 设置key 37 | self.lastUpdatedTimeKey = MJRefreshHeaderLastUpdatedTimeKey; 38 | 39 | // 设置高度 40 | self.mj_h = MJRefreshHeaderHeight; 41 | } 42 | 43 | - (void)placeSubviews 44 | { 45 | [super placeSubviews]; 46 | 47 | // 设置y值(当自己的高度发生改变了,肯定要重新调整Y值,所以放到placeSubviews方法中设置y值) 48 | self.mj_y = - self.mj_h - self.ignoredScrollViewContentInsetTop; 49 | } 50 | 51 | - (void)scrollViewContentOffsetDidChange:(NSDictionary *)change 52 | { 53 | [super scrollViewContentOffsetDidChange:change]; 54 | 55 | // 在刷新的refreshing状态 56 | if (self.state == MJRefreshStateRefreshing) { 57 | // 暂时保留 58 | if (self.window == nil) return; 59 | 60 | // sectionheader停留解决 61 | CGFloat insetT = - self.scrollView.mj_offsetY > _scrollViewOriginalInset.top ? - self.scrollView.mj_offsetY : _scrollViewOriginalInset.top; 62 | insetT = insetT > self.mj_h + _scrollViewOriginalInset.top ? self.mj_h + _scrollViewOriginalInset.top : insetT; 63 | self.scrollView.mj_insetT = insetT; 64 | 65 | self.insetTDelta = _scrollViewOriginalInset.top - insetT; 66 | return; 67 | } 68 | 69 | // 跳转到下一个控制器时,contentInset可能会变 70 | _scrollViewOriginalInset = self.scrollView.mj_inset; 71 | 72 | // 当前的contentOffset 73 | CGFloat offsetY = self.scrollView.mj_offsetY; 74 | // 头部控件刚好出现的offsetY 75 | CGFloat happenOffsetY = - self.scrollViewOriginalInset.top; 76 | 77 | // 如果是向上滚动到看不见头部控件,直接返回 78 | // >= -> > 79 | if (offsetY > happenOffsetY) return; 80 | 81 | // 普通 和 即将刷新 的临界点 82 | CGFloat normal2pullingOffsetY = happenOffsetY - self.mj_h; 83 | CGFloat pullingPercent = (happenOffsetY - offsetY) / self.mj_h; 84 | 85 | if (self.scrollView.isDragging) { // 如果正在拖拽 86 | self.pullingPercent = pullingPercent; 87 | if (self.state == MJRefreshStateIdle && offsetY < normal2pullingOffsetY) { 88 | // 转为即将刷新状态 89 | self.state = MJRefreshStatePulling; 90 | } else if (self.state == MJRefreshStatePulling && offsetY >= normal2pullingOffsetY) { 91 | // 转为普通状态 92 | self.state = MJRefreshStateIdle; 93 | } 94 | } else if (self.state == MJRefreshStatePulling) {// 即将刷新 && 手松开 95 | // 开始刷新 96 | [self beginRefreshing]; 97 | } else if (pullingPercent < 1) { 98 | self.pullingPercent = pullingPercent; 99 | } 100 | } 101 | 102 | - (void)setState:(MJRefreshState)state 103 | { 104 | MJRefreshCheckState 105 | 106 | // 根据状态做事情 107 | if (state == MJRefreshStateIdle) { 108 | if (oldState != MJRefreshStateRefreshing) return; 109 | 110 | // 保存刷新时间 111 | [[NSUserDefaults standardUserDefaults] setObject:[NSDate date] forKey:self.lastUpdatedTimeKey]; 112 | [[NSUserDefaults standardUserDefaults] synchronize]; 113 | 114 | // 恢复inset和offset 115 | [UIView animateWithDuration:MJRefreshSlowAnimationDuration animations:^{ 116 | self.scrollView.mj_insetT += self.insetTDelta; 117 | 118 | // 自动调整透明度 119 | if (self.isAutomaticallyChangeAlpha) self.alpha = 0.0; 120 | } completion:^(BOOL finished) { 121 | self.pullingPercent = 0.0; 122 | 123 | if (self.endRefreshingCompletionBlock) { 124 | self.endRefreshingCompletionBlock(); 125 | } 126 | }]; 127 | } else if (state == MJRefreshStateRefreshing) { 128 | MJRefreshDispatchAsyncOnMainQueue({ 129 | [UIView animateWithDuration:MJRefreshFastAnimationDuration animations:^{ 130 | CGFloat top = self.scrollViewOriginalInset.top + self.mj_h; 131 | // 增加滚动区域top 132 | self.scrollView.mj_insetT = top; 133 | // 设置滚动位置 134 | CGPoint offset = self.scrollView.contentOffset; 135 | offset.y = -top; 136 | [self.scrollView setContentOffset:offset animated:NO]; 137 | } completion:^(BOOL finished) { 138 | [self executeRefreshingCallback]; 139 | }]; 140 | }) 141 | } 142 | } 143 | 144 | #pragma mark - 公共方法 145 | - (NSDate *)lastUpdatedTime 146 | { 147 | return [[NSUserDefaults standardUserDefaults] objectForKey:self.lastUpdatedTimeKey]; 148 | } 149 | 150 | - (void)setIgnoredScrollViewContentInsetTop:(CGFloat)ignoredScrollViewContentInsetTop { 151 | _ignoredScrollViewContentInsetTop = ignoredScrollViewContentInsetTop; 152 | 153 | self.mj_y = - self.mj_h - _ignoredScrollViewContentInsetTop; 154 | } 155 | 156 | @end 157 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/Custom/Header/MJRefreshStateHeader.m: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshStateHeader.m 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshStateHeader.h" 10 | 11 | @interface MJRefreshStateHeader() 12 | { 13 | /** 显示上一次刷新时间的label */ 14 | __unsafe_unretained UILabel *_lastUpdatedTimeLabel; 15 | /** 显示刷新状态的label */ 16 | __unsafe_unretained UILabel *_stateLabel; 17 | } 18 | /** 所有状态对应的文字 */ 19 | @property (strong, nonatomic) NSMutableDictionary *stateTitles; 20 | @end 21 | 22 | @implementation MJRefreshStateHeader 23 | #pragma mark - 懒加载 24 | - (NSMutableDictionary *)stateTitles 25 | { 26 | if (!_stateTitles) { 27 | self.stateTitles = [NSMutableDictionary dictionary]; 28 | } 29 | return _stateTitles; 30 | } 31 | 32 | - (UILabel *)stateLabel 33 | { 34 | if (!_stateLabel) { 35 | [self addSubview:_stateLabel = [UILabel mj_label]]; 36 | } 37 | return _stateLabel; 38 | } 39 | 40 | - (UILabel *)lastUpdatedTimeLabel 41 | { 42 | if (!_lastUpdatedTimeLabel) { 43 | [self addSubview:_lastUpdatedTimeLabel = [UILabel mj_label]]; 44 | } 45 | return _lastUpdatedTimeLabel; 46 | } 47 | 48 | #pragma mark - 公共方法 49 | - (void)setTitle:(NSString *)title forState:(MJRefreshState)state 50 | { 51 | if (title == nil) return; 52 | self.stateTitles[@(state)] = title; 53 | self.stateLabel.text = self.stateTitles[@(self.state)]; 54 | } 55 | 56 | #pragma mark - 日历获取在9.x之后的系统使用currentCalendar会出异常。在8.0之后使用系统新API。 57 | - (NSCalendar *)currentCalendar { 58 | if ([NSCalendar respondsToSelector:@selector(calendarWithIdentifier:)]) { 59 | return [NSCalendar calendarWithIdentifier:NSCalendarIdentifierGregorian]; 60 | } 61 | return [NSCalendar currentCalendar]; 62 | } 63 | 64 | #pragma mark key的处理 65 | - (void)setLastUpdatedTimeKey:(NSString *)lastUpdatedTimeKey 66 | { 67 | [super setLastUpdatedTimeKey:lastUpdatedTimeKey]; 68 | 69 | // 如果label隐藏了,就不用再处理 70 | if (self.lastUpdatedTimeLabel.hidden) return; 71 | 72 | NSDate *lastUpdatedTime = [[NSUserDefaults standardUserDefaults] objectForKey:lastUpdatedTimeKey]; 73 | 74 | // 如果有block 75 | if (self.lastUpdatedTimeText) { 76 | self.lastUpdatedTimeLabel.text = self.lastUpdatedTimeText(lastUpdatedTime); 77 | return; 78 | } 79 | 80 | if (lastUpdatedTime) { 81 | // 1.获得年月日 82 | NSCalendar *calendar = [self currentCalendar]; 83 | NSUInteger unitFlags = NSCalendarUnitYear| NSCalendarUnitMonth | NSCalendarUnitDay |NSCalendarUnitHour |NSCalendarUnitMinute; 84 | NSDateComponents *cmp1 = [calendar components:unitFlags fromDate:lastUpdatedTime]; 85 | NSDateComponents *cmp2 = [calendar components:unitFlags fromDate:[NSDate date]]; 86 | 87 | // 2.格式化日期 88 | NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; 89 | BOOL isToday = NO; 90 | if ([cmp1 day] == [cmp2 day]) { // 今天 91 | formatter.dateFormat = @" HH:mm"; 92 | isToday = YES; 93 | } else if ([cmp1 year] == [cmp2 year]) { // 今年 94 | formatter.dateFormat = @"MM-dd HH:mm"; 95 | } else { 96 | formatter.dateFormat = @"yyyy-MM-dd HH:mm"; 97 | } 98 | NSString *time = [formatter stringFromDate:lastUpdatedTime]; 99 | 100 | // 3.显示日期 101 | self.lastUpdatedTimeLabel.text = [NSString stringWithFormat:@"%@%@%@", 102 | [NSBundle mj_localizedStringForKey:MJRefreshHeaderLastTimeText], 103 | isToday ? [NSBundle mj_localizedStringForKey:MJRefreshHeaderDateTodayText] : @"", 104 | time]; 105 | } else { 106 | self.lastUpdatedTimeLabel.text = [NSString stringWithFormat:@"%@%@", 107 | [NSBundle mj_localizedStringForKey:MJRefreshHeaderLastTimeText], 108 | [NSBundle mj_localizedStringForKey:MJRefreshHeaderNoneLastDateText]]; 109 | } 110 | } 111 | 112 | #pragma mark - 覆盖父类的方法 113 | - (void)prepare 114 | { 115 | [super prepare]; 116 | 117 | // 初始化间距 118 | self.labelLeftInset = MJRefreshLabelLeftInset; 119 | 120 | // 初始化文字 121 | [self setTitle:[NSBundle mj_localizedStringForKey:MJRefreshHeaderIdleText] forState:MJRefreshStateIdle]; 122 | [self setTitle:[NSBundle mj_localizedStringForKey:MJRefreshHeaderPullingText] forState:MJRefreshStatePulling]; 123 | [self setTitle:[NSBundle mj_localizedStringForKey:MJRefreshHeaderRefreshingText] forState:MJRefreshStateRefreshing]; 124 | } 125 | 126 | - (void)placeSubviews 127 | { 128 | [super placeSubviews]; 129 | 130 | if (self.stateLabel.hidden) return; 131 | 132 | BOOL noConstrainsOnStatusLabel = self.stateLabel.constraints.count == 0; 133 | 134 | if (self.lastUpdatedTimeLabel.hidden) { 135 | // 状态 136 | if (noConstrainsOnStatusLabel) self.stateLabel.frame = self.bounds; 137 | } else { 138 | CGFloat stateLabelH = self.mj_h * 0.5; 139 | // 状态 140 | if (noConstrainsOnStatusLabel) { 141 | self.stateLabel.mj_x = 0; 142 | self.stateLabel.mj_y = 0; 143 | self.stateLabel.mj_w = self.mj_w; 144 | self.stateLabel.mj_h = stateLabelH; 145 | } 146 | 147 | // 更新时间 148 | if (self.lastUpdatedTimeLabel.constraints.count == 0) { 149 | self.lastUpdatedTimeLabel.mj_x = 0; 150 | self.lastUpdatedTimeLabel.mj_y = stateLabelH; 151 | self.lastUpdatedTimeLabel.mj_w = self.mj_w; 152 | self.lastUpdatedTimeLabel.mj_h = self.mj_h - self.lastUpdatedTimeLabel.mj_y; 153 | } 154 | } 155 | } 156 | 157 | - (void)setState:(MJRefreshState)state 158 | { 159 | MJRefreshCheckState 160 | 161 | // 设置状态文字 162 | self.stateLabel.text = self.stateTitles[@(state)]; 163 | 164 | // 重新设置key(重新显示时间) 165 | self.lastUpdatedTimeKey = self.lastUpdatedTimeKey; 166 | } 167 | @end 168 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ZKTreeTableView/Pods-ZKTreeTableView-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | set -u 4 | set -o pipefail 5 | 6 | if [ -z ${UNLOCALIZED_RESOURCES_FOLDER_PATH+x} ]; then 7 | # If UNLOCALIZED_RESOURCES_FOLDER_PATH is not set, then there's nowhere for us to copy 8 | # resources to, so exit 0 (signalling the script phase was successful). 9 | exit 0 10 | fi 11 | 12 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 13 | 14 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 15 | > "$RESOURCES_TO_COPY" 16 | 17 | XCASSET_FILES=() 18 | 19 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 20 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 21 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 22 | 23 | case "${TARGETED_DEVICE_FAMILY:-}" in 24 | 1,2) 25 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 26 | ;; 27 | 1) 28 | TARGET_DEVICE_ARGS="--target-device iphone" 29 | ;; 30 | 2) 31 | TARGET_DEVICE_ARGS="--target-device ipad" 32 | ;; 33 | 3) 34 | TARGET_DEVICE_ARGS="--target-device tv" 35 | ;; 36 | 4) 37 | TARGET_DEVICE_ARGS="--target-device watch" 38 | ;; 39 | *) 40 | TARGET_DEVICE_ARGS="--target-device mac" 41 | ;; 42 | esac 43 | 44 | install_resource() 45 | { 46 | if [[ "$1" = /* ]] ; then 47 | RESOURCE_PATH="$1" 48 | else 49 | RESOURCE_PATH="${PODS_ROOT}/$1" 50 | fi 51 | if [[ ! -e "$RESOURCE_PATH" ]] ; then 52 | cat << EOM 53 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. 54 | EOM 55 | exit 1 56 | fi 57 | case $RESOURCE_PATH in 58 | *.storyboard) 59 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 60 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 61 | ;; 62 | *.xib) 63 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 64 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 65 | ;; 66 | *.framework) 67 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 68 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 69 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 70 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 71 | ;; 72 | *.xcdatamodel) 73 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true 74 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" 75 | ;; 76 | *.xcdatamodeld) 77 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true 78 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" 79 | ;; 80 | *.xcmappingmodel) 81 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true 82 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" 83 | ;; 84 | *.xcassets) 85 | ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" 86 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 87 | ;; 88 | *) 89 | echo "$RESOURCE_PATH" || true 90 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" 91 | ;; 92 | esac 93 | } 94 | if [[ "$CONFIGURATION" == "Debug" ]]; then 95 | install_resource "${PODS_ROOT}/MJRefresh/MJRefresh/MJRefresh.bundle" 96 | fi 97 | if [[ "$CONFIGURATION" == "Release" ]]; then 98 | install_resource "${PODS_ROOT}/MJRefresh/MJRefresh/MJRefresh.bundle" 99 | fi 100 | 101 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 102 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 103 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then 104 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 105 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 106 | fi 107 | rm -f "$RESOURCES_TO_COPY" 108 | 109 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "${XCASSET_FILES:-}" ] 110 | then 111 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 112 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 113 | while read line; do 114 | if [[ $line != "${PODS_ROOT}*" ]]; then 115 | XCASSET_FILES+=("$line") 116 | fi 117 | done <<<"$OTHER_XCASSETS" 118 | 119 | if [ -z ${ASSETCATALOG_COMPILER_APPICON_NAME+x} ]; then 120 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 121 | else 122 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${TARGET_TEMP_DIR}/assetcatalog_generated_info_cocoapods.plist" 123 | fi 124 | fi 125 | -------------------------------------------------------------------------------- /ZKTreeTableView/CheckViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // CheckViewController.m 3 | // ZKTreeTableView 4 | // 5 | // Created by bestdew on 2018/9/23. 6 | // Copyright © 2018年 bestdew. All rights reserved. 7 | // 8 | 9 | #import "CheckViewController.h" 10 | #import "CheckCell.h" 11 | #import "CommentModel.h" 12 | #import "ZKTreeListView.h" 13 | #import "YYFPSLabel.h" 14 | #import "RequestHepler.h" 15 | #import "CheckNode.h" 16 | 17 | @interface CheckViewController () 18 | 19 | @property (nonatomic, strong) ZKTreeListView *listView; 20 | @property (nonatomic, strong) UIActivityIndicatorView *indicatorView; 21 | 22 | @end 23 | 24 | static NSString *identifier = @"CheckCell"; 25 | 26 | @implementation CheckViewController 27 | 28 | #pragma mark -- Life Cycle 29 | - (void)viewDidLoad { 30 | [super viewDidLoad]; 31 | 32 | UIBarButtonItem *expandAllItem = [[UIBarButtonItem alloc] initWithTitle:@"全部展开" style:UIBarButtonItemStylePlain target:self action:@selector(expandAllNodes)]; 33 | UIBarButtonItem *checkAllItem = [[UIBarButtonItem alloc] initWithTitle:@"全部勾选" style:UIBarButtonItemStylePlain target:self action:@selector(checkAllNodes)]; 34 | self.navigationItem.rightBarButtonItems = @[expandAllItem, checkAllItem]; 35 | 36 | [self.view addSubview:self.listView]; 37 | [self.view addSubview:self.indicatorView]; 38 | 39 | YYFPSLabel *fpsLabel = [[YYFPSLabel alloc] initWithFrame:CGRectMake(self.view.bounds.size.width - 150, 100, 60, 30)]; 40 | [fpsLabel sizeToFit]; 41 | [self.view addSubview:fpsLabel]; 42 | 43 | [self requestData]; 44 | } 45 | 46 | #pragma mark -- Action 47 | - (void)requestData 48 | { 49 | // 模拟请求数据 50 | [RequestHepler mockRequestNodesDataWithParams:@{@"pageIndex":@"1"} success:^(id response) { 51 | NSArray *dataArray = (NSArray *)response; 52 | NSMutableArray *nodes = [NSMutableArray arrayWithCapacity:dataArray.count]; 53 | for (NSDictionary *dataDict in dataArray) { 54 | // 1.字典转模型 55 | CommentModel *model = [CommentModel modelWithDict:dataDict]; 56 | // 2.创建 node 57 | NSInteger sortOrder = [model.order_no integerValue]; 58 | CheckNode *node = [CheckNode nodeWithID:model.ID 59 | parentID:model.pid 60 | sortOrder:sortOrder 61 | data:model]; 62 | node.checked = NO; 63 | node.rowHeight = 44.f; 64 | 65 | [nodes addObject:node]; 66 | } 67 | // 4.加载数据 68 | [_indicatorView stopAnimating]; 69 | [_listView loadNodes:nodes]; 70 | } failure:^(NSError *error) { 71 | NSLog(@"请求失败:%@", error); 72 | }]; 73 | } 74 | 75 | - (void)expandAllNodes 76 | { 77 | static NSInteger expandLevel = NSIntegerMax; 78 | [_listView expandAllNodesWithLevel:expandLevel]; 79 | expandLevel = (expandLevel == 0) ? NSIntegerMax : 0; 80 | 81 | for (CheckNode *node in _listView.showNodes) { 82 | CheckCell *cell = [_listView cellForNode:node]; 83 | CGFloat angle = (node.isExpand && node.childNodes.count > 0) ? M_PI_2 : 0.f; 84 | [cell refreshArrowDirection:angle animated:YES]; 85 | } 86 | } 87 | 88 | - (void)checkAllNodes 89 | { 90 | for (CheckNode *node in _listView.allNodes) { 91 | node.checked = !node.isChecked; 92 | } 93 | [_listView reloadNodes:_listView.allNodes.allObjects]; 94 | } 95 | 96 | - (void)checkNode:(CheckNode *)node withCheck:(BOOL)isCheck mutableArray:(NSMutableArray *)mutArray 97 | { 98 | if ((node == nil) || (mutArray == nil) || (node.isChecked == isCheck)) return; 99 | 100 | node.checked = isCheck; 101 | [mutArray addObject:node]; 102 | 103 | CheckNode *pNode = (CheckNode *)(node.parentNode); 104 | NSArray *nodes = (NSArray *)(node.childNodes); 105 | 106 | [self checkParentNode:pNode withCheck:isCheck mutableArray:mutArray]; 107 | [self checkChildNodes:nodes withCheck:isCheck mutableArray:mutArray]; 108 | } 109 | 110 | // 向上寻找叶节点并勾选或取消勾选 111 | - (void)checkParentNode:(CheckNode *)pNode withCheck:(BOOL)isCheck mutableArray:(NSMutableArray *)mutArray 112 | { 113 | if (pNode.childNodes.count != 1) return; 114 | 115 | pNode.checked = isCheck; 116 | [mutArray addObject:pNode]; 117 | pNode = (CheckNode *)(pNode.parentNode); 118 | [self checkParentNode:pNode withCheck:isCheck mutableArray:mutArray]; 119 | } 120 | 121 | // 向下寻找子节点并勾选或取消勾选 122 | - (void)checkChildNodes:(NSArray *)nodes withCheck:(BOOL)isCheck mutableArray:(NSMutableArray *)mutArray 123 | { 124 | if (nodes.count == 0) return; 125 | 126 | for (CheckNode *node in nodes) { 127 | node.checked = isCheck; 128 | [mutArray addObject:node]; 129 | NSArray *childNodes = (NSArray *)(node.childNodes); 130 | [self checkChildNodes:childNodes withCheck:isCheck mutableArray:mutArray]; 131 | } 132 | } 133 | 134 | #pragma mark -- ZKTreeListView Delgate 135 | - (void)treeListView:(ZKTreeListView *)listView didSelectNode:(ZKTreeNode *)node atIndexPath:(NSIndexPath *)indexPath 136 | { 137 | CGFloat angle = (node.isExpand && node.childNodes.count > 0) ? M_PI_2 : 0.f; 138 | CheckCell *cell = [listView cellForRowAtIndexPath:indexPath]; 139 | [cell refreshArrowDirection:angle animated:YES]; 140 | } 141 | 142 | - (ZKTreeListViewCell *)treeListView:(ZKTreeListView *)listView cellForNode:(ZKTreeNode *)node atIndexPath:(NSIndexPath *)indexPath 143 | { 144 | __weak typeof(self) weakSelf = self; 145 | CheckCell *cell = [listView dequeueReusableCellWithIdentifier:identifier forIndexPath:indexPath]; 146 | cell.block = ^(ZKTreeNode *node, BOOL isCheck) { 147 | __strong typeof(weakSelf) strongSelf = weakSelf; 148 | NSMutableArray *mutArray = [NSMutableArray array]; 149 | [strongSelf checkNode:(CheckNode *)node withCheck:isCheck mutableArray:mutArray]; 150 | [strongSelf.listView reloadNodes:mutArray]; 151 | }; 152 | return cell; 153 | } 154 | 155 | #pragma mark -- Lazy Load 156 | - (ZKTreeListView *)listView 157 | { 158 | if (_listView == nil) { 159 | _listView = [[ZKTreeListView alloc] initWithFrame:self.view.bounds style:ZKTreeListViewStyleNormal]; 160 | _listView.delegate = self; 161 | _listView.tableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine; 162 | _listView.tableView.tableFooterView = [UIView new]; 163 | [_listView registerClass:[CheckCell class] forCellReuseIdentifier:identifier]; 164 | } 165 | return _listView; 166 | } 167 | 168 | - (UIActivityIndicatorView *)indicatorView 169 | { 170 | if (_indicatorView == nil) { 171 | 172 | _indicatorView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge]; 173 | _indicatorView.color = [UIColor grayColor]; 174 | _indicatorView.center = self.view.center; 175 | _indicatorView.hidesWhenStopped = YES; 176 | [_indicatorView startAnimating]; 177 | } 178 | return _indicatorView; 179 | } 180 | 181 | @end 182 | --------------------------------------------------------------------------------