├── YNPageViewController ├── YNPageViewController │ ├── Assets.xcassets │ │ ├── Contents.json │ │ ├── small_icon.imageset │ │ │ ├── vip@2x.png │ │ │ ├── vip@3x.png │ │ │ └── Contents.json │ │ ├── AppIcon.appiconset │ │ │ ├── icon-1024.png │ │ │ ├── icon-29@2x-1.png │ │ │ ├── icon-29@2x.png │ │ │ ├── icon-29@3x-1.png │ │ │ ├── icon-29@3x.png │ │ │ ├── icon-40@2x.png │ │ │ ├── icon-40@3x.png │ │ │ ├── icon-60@2x.png │ │ │ ├── icon-60@3x.png │ │ │ └── Contents.json │ │ ├── mine_header_bg.imageset │ │ │ ├── mine_header_bg@2x.png │ │ │ ├── mine_header_bg@3x.png │ │ │ └── Contents.json │ │ └── icon_back_small_black.imageset │ │ │ ├── icon_back_small_black@2x.png │ │ │ ├── icon_back_small_black@3x.png │ │ │ └── Contents.json │ ├── Libs │ │ ├── ThirdParty │ │ │ ├── MJRefresh │ │ │ │ ├── MJRefresh.bundle │ │ │ │ │ ├── arrow@2x.png │ │ │ │ │ ├── en.lproj │ │ │ │ │ │ └── Localizable.strings │ │ │ │ │ ├── zh-Hans.lproj │ │ │ │ │ │ └── Localizable.strings │ │ │ │ │ └── zh-Hant.lproj │ │ │ │ │ │ └── Localizable.strings │ │ │ │ ├── Base │ │ │ │ │ ├── MJRefreshBackFooter.h │ │ │ │ │ ├── MJRefreshAutoFooter.h │ │ │ │ │ ├── MJRefreshHeader.h │ │ │ │ │ ├── MJRefreshFooter.h │ │ │ │ │ ├── MJRefreshFooter.m │ │ │ │ │ └── MJRefreshComponent.h │ │ │ │ ├── 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 │ │ │ │ ├── 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 │ │ │ ├── SDCycleScrollView │ │ │ │ └── Lib │ │ │ │ │ └── SDCycleScrollView │ │ │ │ │ ├── PageControl │ │ │ │ │ ├── TADotView.h │ │ │ │ │ ├── TAAnimatedDotView.h │ │ │ │ │ ├── TAAbstractDotView.h │ │ │ │ │ ├── TAAbstractDotView.m │ │ │ │ │ ├── TADotView.m │ │ │ │ │ ├── TAAnimatedDotView.m │ │ │ │ │ └── TAPageControl.h │ │ │ │ │ ├── UIView+SDExtension.h │ │ │ │ │ ├── SDCollectionViewCell.h │ │ │ │ │ ├── UIView+SDExtension.m │ │ │ │ │ └── SDCollectionViewCell.m │ │ │ ├── SDWebImage │ │ │ │ ├── UIImage+MultiFormat.h │ │ │ │ ├── SDWebImageOperation.h │ │ │ │ ├── UIImage+GIF.h │ │ │ │ ├── SDWebImageDecoder.h │ │ │ │ ├── NSData+ImageContentType.h │ │ │ │ ├── UIView+WebCacheOperation.h │ │ │ │ ├── NSData+ImageContentType.m │ │ │ │ ├── SDWebImageCompat.m │ │ │ │ ├── SDWebImageCompat.h │ │ │ │ ├── UIView+WebCacheOperation.m │ │ │ │ ├── SDWebImageDownloaderOperation.h │ │ │ │ ├── UIImage+MultiFormat.m │ │ │ │ ├── SDWebImageDecoder.m │ │ │ │ └── SDWebImagePrefetcher.h │ │ │ └── MLeaksFinder │ │ │ │ ├── UIView+MemoryLeak.h │ │ │ │ ├── UITouch+MemoryLeak.h │ │ │ │ ├── UIApplication+MemoryLeak.h │ │ │ │ ├── UIViewController+MemoryLeak.h │ │ │ │ ├── UITabBarController+MemoryLeak.h │ │ │ │ ├── UIPageViewController+MemoryLeak.h │ │ │ │ ├── UISplitViewController+MemoryLeak.h │ │ │ │ ├── MLeakedObjectProxy.h │ │ │ │ ├── UINavigationController+MemoryLeak.h │ │ │ │ ├── UIView+MemoryLeak.m │ │ │ │ ├── MLeaksMessenger.h │ │ │ │ ├── UITabBarController+MemoryLeak.m │ │ │ │ ├── UIPageViewController+MemoryLeak.m │ │ │ │ ├── UISplitViewController+MemoryLeak.m │ │ │ │ ├── MLeaksFinder.h │ │ │ │ ├── NSObject+MemoryLeak.h │ │ │ │ ├── UITouch+MemoryLeak.m │ │ │ │ ├── UIApplication+MemoryLeak.m │ │ │ │ ├── MLeaksMessenger.m │ │ │ │ ├── UIViewController+MemoryLeak.m │ │ │ │ └── UINavigationController+MemoryLeak.m │ │ └── YNPageViewController │ │ │ ├── View │ │ │ ├── YNPageTableView.h │ │ │ ├── YNPageScrollView.h │ │ │ ├── YNPageCollectionView.h │ │ │ ├── YNPageHeaderScrollView.h │ │ │ ├── YNPageTableView.m │ │ │ ├── YNPageCollectionView.m │ │ │ ├── YNPageHeaderScrollView.m │ │ │ ├── YNPageScrollView.m │ │ │ └── YNPageScrollMenuView.h │ │ │ ├── Category │ │ │ ├── UIViewController+YNPageExtend.h │ │ │ ├── UIScrollView+YNPageExtend.h │ │ │ ├── UIViewController+YNPageExtend.m │ │ │ ├── UIView+YNPageExtend.h │ │ │ ├── UIView+YNPageExtend.m │ │ │ └── UIScrollView+YNPageExtend.m │ │ │ └── YNPageConfigration.m │ ├── Src │ │ └── Demos │ │ │ ├── DemosListVC.h │ │ │ ├── LoadPageVC │ │ │ ├── YNLoadPageVC.h │ │ │ └── YNLoadPageVC.m │ │ │ ├── BaseVC │ │ │ ├── BaseViewController.h │ │ │ ├── BasePageViewController.h │ │ │ ├── BaseCollectionViewVC.h │ │ │ ├── BaseTableViewVC.h │ │ │ ├── BaseViewController.m │ │ │ └── BasePageViewController.m │ │ │ ├── ScrollMenuStyleVC │ │ │ └── YNScrollMenuStyleVC.h │ │ │ ├── NavPageVC │ │ │ ├── YNNavPageVC.h │ │ │ └── YNNavPageVC.m │ │ │ ├── TopPageVC │ │ │ ├── YNTopPageVC.h │ │ │ └── YNTopPageVC.m │ │ │ ├── SuspendTopPageVC │ │ │ ├── YNSuspendTopBaseTableViewVC.h │ │ │ ├── YNSuspendTopPageVC.h │ │ │ ├── YNSuspendTopBaseTableViewVC.m │ │ │ └── YNSuspendTopPageVC.m │ │ │ ├── TestPageVC │ │ │ ├── YNTestBaseVC.h │ │ │ ├── YNTestPageVC.h │ │ │ └── YNTestBaseVC.m │ │ │ ├── SuspendTopPausePageVC │ │ │ ├── YNSuspendTopPausePageVC.h │ │ │ └── YNSuspendTopPauseBaseTableViewVC.h │ │ │ ├── SuspendCustomNavOrSuspendPositionVC │ │ │ └── YNSuspendCustomNavOrSuspendPositionVC.h │ │ │ └── SuspendCenterPageVC │ │ │ └── YNSuspendCenterPageVC.h │ ├── YNNavigationController.h │ ├── AppDelegate.h │ ├── main.m │ ├── AppDelegate.m │ ├── YNPreHeader.h │ ├── Info.plist │ ├── YNNavigationController.m │ └── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard └── YNPageViewController.xcodeproj │ └── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ └── IDEWorkspaceChecks.plist ├── LICENSE ├── .gitignore └── README.md /YNPageViewController/YNPageViewController/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Assets.xcassets/small_icon.imageset/vip@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongyuandouneng/YNPageViewController/HEAD/YNPageViewController/YNPageViewController/Assets.xcassets/small_icon.imageset/vip@2x.png -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Assets.xcassets/small_icon.imageset/vip@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongyuandouneng/YNPageViewController/HEAD/YNPageViewController/YNPageViewController/Assets.xcassets/small_icon.imageset/vip@3x.png -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Assets.xcassets/AppIcon.appiconset/icon-1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongyuandouneng/YNPageViewController/HEAD/YNPageViewController/YNPageViewController/Assets.xcassets/AppIcon.appiconset/icon-1024.png -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Assets.xcassets/AppIcon.appiconset/icon-29@2x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongyuandouneng/YNPageViewController/HEAD/YNPageViewController/YNPageViewController/Assets.xcassets/AppIcon.appiconset/icon-29@2x-1.png -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongyuandouneng/YNPageViewController/HEAD/YNPageViewController/YNPageViewController/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Assets.xcassets/AppIcon.appiconset/icon-29@3x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongyuandouneng/YNPageViewController/HEAD/YNPageViewController/YNPageViewController/Assets.xcassets/AppIcon.appiconset/icon-29@3x-1.png -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongyuandouneng/YNPageViewController/HEAD/YNPageViewController/YNPageViewController/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongyuandouneng/YNPageViewController/HEAD/YNPageViewController/YNPageViewController/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongyuandouneng/YNPageViewController/HEAD/YNPageViewController/YNPageViewController/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongyuandouneng/YNPageViewController/HEAD/YNPageViewController/YNPageViewController/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongyuandouneng/YNPageViewController/HEAD/YNPageViewController/YNPageViewController/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/MJRefresh/MJRefresh.bundle/arrow@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongyuandouneng/YNPageViewController/HEAD/YNPageViewController/YNPageViewController/Libs/ThirdParty/MJRefresh/MJRefresh.bundle/arrow@2x.png -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Assets.xcassets/mine_header_bg.imageset/mine_header_bg@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongyuandouneng/YNPageViewController/HEAD/YNPageViewController/YNPageViewController/Assets.xcassets/mine_header_bg.imageset/mine_header_bg@2x.png -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Assets.xcassets/mine_header_bg.imageset/mine_header_bg@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongyuandouneng/YNPageViewController/HEAD/YNPageViewController/YNPageViewController/Assets.xcassets/mine_header_bg.imageset/mine_header_bg@3x.png -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/MJRefresh/MJRefresh.bundle/en.lproj/Localizable.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongyuandouneng/YNPageViewController/HEAD/YNPageViewController/YNPageViewController/Libs/ThirdParty/MJRefresh/MJRefresh.bundle/en.lproj/Localizable.strings -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Assets.xcassets/icon_back_small_black.imageset/icon_back_small_black@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongyuandouneng/YNPageViewController/HEAD/YNPageViewController/YNPageViewController/Assets.xcassets/icon_back_small_black.imageset/icon_back_small_black@2x.png -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Assets.xcassets/icon_back_small_black.imageset/icon_back_small_black@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongyuandouneng/YNPageViewController/HEAD/YNPageViewController/YNPageViewController/Assets.xcassets/icon_back_small_black.imageset/icon_back_small_black@3x.png -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/MJRefresh/MJRefresh.bundle/zh-Hans.lproj/Localizable.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongyuandouneng/YNPageViewController/HEAD/YNPageViewController/YNPageViewController/Libs/ThirdParty/MJRefresh/MJRefresh.bundle/zh-Hans.lproj/Localizable.strings -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Src/Demos/DemosListVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // DemosListVC.h 3 | // YNPageViewController 4 | // 5 | // Created by ZYN on 2018/6/22. 6 | // Copyright © 2018年 yongneng. All rights reserved. 7 | // 8 | 9 | #import "BaseViewController.h" 10 | 11 | @interface DemosListVC : BaseViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Src/Demos/LoadPageVC/YNLoadPageVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // LoadPageVC.h 3 | // YNPageViewController 4 | // 5 | // Created by ZYN on 2018/6/26. 6 | // Copyright © 2018年 yongneng. All rights reserved. 7 | // 8 | 9 | #import "BaseViewController.h" 10 | 11 | @interface YNLoadPageVC : BaseViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/YNPageViewController/View/YNPageTableView.h: -------------------------------------------------------------------------------- 1 | // 2 | // YNPageTableView.h 3 | // YNPageViewController 4 | // 5 | // Created by ZYN on 2018/7/14. 6 | // Copyright © 2018年 yongneng. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface YNPageTableView : UITableView 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Src/Demos/BaseVC/BaseViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BaseViewController.h 3 | // YNPageViewController 4 | // 5 | // Created by ZYN on 2018/6/26. 6 | // Copyright © 2018年 yongneng. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BaseViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/YNNavigationController.h: -------------------------------------------------------------------------------- 1 | // 2 | // YNNavigationController.h 3 | // YNPageViewController 4 | // 5 | // Created by ZYN on 2018/5/8. 6 | // Copyright © 2018年 yongneng. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface YNNavigationController : UINavigationController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/YNPageViewController/View/YNPageScrollView.h: -------------------------------------------------------------------------------- 1 | // 2 | // YNPageScrollView.h 3 | // YNPageViewController 4 | // 5 | // Created by ZYN on 2018/4/22. 6 | // Copyright © 2018年 yongneng. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface YNPageScrollView : UIScrollView 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Src/Demos/ScrollMenuStyleVC/YNScrollMenuStyleVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // ScrollMenuStyleVC.h 3 | // YNPageViewController 4 | // 5 | // Created by ZYN on 2018/6/25. 6 | // Copyright © 2018年 yongneng. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface YNScrollMenuStyleVC : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/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 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/YNPageViewController/View/YNPageCollectionView.h: -------------------------------------------------------------------------------- 1 | // 2 | // YNPageCollectionView.h 3 | // YNPageViewController 4 | // 5 | // Created by ZYN on 2018/7/14. 6 | // Copyright © 2018年 yongneng. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface YNPageCollectionView : UICollectionView 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Src/Demos/NavPageVC/YNNavPageVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // YNNavPageVC.h 3 | // YNPageViewController 4 | // 5 | // Created by ZYN on 2018/6/22. 6 | // Copyright © 2018年 yongneng. All rights reserved. 7 | // 8 | 9 | #import "BasePageViewController.h" 10 | 11 | @interface YNNavPageVC : BasePageViewController 12 | 13 | + (instancetype)navPageVC; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Src/Demos/TopPageVC/YNTopPageVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // YNTopPageVC.h 3 | // YNPageViewController 4 | // 5 | // Created by ZYN on 2018/6/22. 6 | // Copyright © 2018年 yongneng. All rights reserved. 7 | // 8 | 9 | #import "BasePageViewController.h" 10 | 11 | @interface YNTopPageVC : BasePageViewController 12 | 13 | + (instancetype)topPageVC; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Src/Demos/SuspendTopPageVC/YNSuspendTopBaseTableViewVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // YNSuspendTopBaseTableViewVC.h 3 | // YNPageViewController 4 | // 5 | // Created by ZYN on 2018/6/25. 6 | // Copyright © 2018年 yongneng. All rights reserved. 7 | // 8 | 9 | #import "BaseTableViewVC.h" 10 | 11 | @interface YNSuspendTopBaseTableViewVC : BaseTableViewVC 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // YNPageViewController 4 | // 5 | // Created by ZYN on 2018/4/22. 6 | // Copyright © 2018年 yongneng. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | 17 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/SDCycleScrollView/Lib/SDCycleScrollView/PageControl/TADotView.h: -------------------------------------------------------------------------------- 1 | // 2 | // TADotView.h 3 | // TAPageControl 4 | // 5 | // Created by Tanguy Aladenise on 2015-01-22. 6 | // Copyright (c) 2015 Tanguy Aladenise. All rights reserved. 7 | // 8 | 9 | #import "TAAbstractDotView.h" 10 | 11 | @interface TADotView : TAAbstractDotView 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Src/Demos/BaseVC/BasePageViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BasePageViewController.h 3 | // YNPageViewController 4 | // 5 | // Created by ZYN on 2018/7/27. 6 | // Copyright © 2018年 yongneng. All rights reserved. 7 | // 中间层 - 为了演示API功能操作 8 | 9 | #import "YNPageViewController.h" 10 | 11 | @interface BasePageViewController : YNPageViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Src/Demos/TestPageVC/YNTestBaseVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // YNTestBaseVC.h 3 | // YNPageViewController 4 | // 5 | // Created by ZYN on 2018/5/8. 6 | // Copyright © 2018年 yongneng. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface YNTestBaseVC : UIViewController 12 | 13 | @property (nonatomic, strong) UITableView *tableView; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/SDWebImage/UIImage+MultiFormat.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+MultiFormat.h 3 | // SDWebImage 4 | // 5 | // Created by Olivier Poitrey on 07/06/13. 6 | // Copyright (c) 2013 Dailymotion. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIImage (MultiFormat) 12 | 13 | + (UIImage *)sd_imageWithData:(NSData *)data; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/YNPageViewController/View/YNPageHeaderScrollView.h: -------------------------------------------------------------------------------- 1 | // 2 | // YNPageHeaderScrollView.h 3 | // YNPageViewController 4 | // 5 | // Created by ZYN on 2018/5/25. 6 | // Copyright © 2018年 yongneng. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "YNPageScrollView.h" 11 | 12 | @interface YNPageHeaderScrollView : YNPageScrollView 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Src/Demos/TestPageVC/YNTestPageVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // YNTestVC.h 3 | // YNPageViewController 4 | // 5 | // Created by ZYN on 2018/5/8. 6 | // Copyright © 2018年 yongneng. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "YNPageViewController.h" 11 | 12 | @interface YNTestPageVC : YNPageViewController 13 | 14 | + (instancetype)testPageVC; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Src/Demos/SuspendTopPageVC/YNSuspendTopPageVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // YNSuspendTopPageVC.h 3 | // YNPageViewController 4 | // 5 | // Created by ZYN on 2018/6/25. 6 | // Copyright © 2018年 yongneng. All rights reserved. 7 | // 8 | 9 | #import "BasePageViewController.h" 10 | 11 | @interface YNSuspendTopPageVC : BasePageViewController 12 | 13 | + (instancetype)suspendTopPageVC; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Src/Demos/BaseVC/BaseCollectionViewVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // BaseCollectionViewVC.h 3 | // YNPageViewController 4 | // 5 | // Created by ZYN on 2018/6/22. 6 | // Copyright © 2018年 yongneng. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BaseCollectionViewVC : UIViewController 12 | 13 | @property (nonatomic, strong) UICollectionView *collectionView; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Src/Demos/SuspendTopPausePageVC/YNSuspendTopPausePageVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // YNSuspendTopPausePageVC.h 3 | // YNPageViewController 4 | // 5 | // Created by ZYN on 2018/7/14. 6 | // Copyright © 2018年 yongneng. All rights reserved. 7 | // 8 | 9 | #import "BasePageViewController.h" 10 | 11 | @interface YNSuspendTopPausePageVC : BasePageViewController 12 | 13 | + (instancetype)suspendTopPausePageVC; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // YNPageViewController 4 | // 5 | // Created by ZYN on 2018/4/22. 6 | // Copyright © 2018年 yongneng. 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 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Src/Demos/SuspendCustomNavOrSuspendPositionVC/YNSuspendCustomNavOrSuspendPositionVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // YNSuspendCustomNavOrSuspendPositionVC.h 3 | // YNPageViewController 4 | // 5 | // Created by ZYN on 2018/7/19. 6 | // Copyright © 2018年 yongneng. All rights reserved. 7 | // 8 | 9 | #import "BaseViewController.h" 10 | 11 | @interface YNSuspendCustomNavOrSuspendPositionVC : BaseViewController 12 | 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/SDWebImage/SDWebImageOperation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | 11 | @protocol SDWebImageOperation 12 | 13 | - (void)cancel; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/SDCycleScrollView/Lib/SDCycleScrollView/PageControl/TAAnimatedDotView.h: -------------------------------------------------------------------------------- 1 | // 2 | // TAAnimatedDotView.h 3 | // TAPageControl 4 | // 5 | // Created by Tanguy Aladenise on 2015-01-22. 6 | // Copyright (c) 2015 Tanguy Aladenise. All rights reserved. 7 | // 8 | 9 | #import "TAAbstractDotView.h" 10 | 11 | @interface TAAnimatedDotView : TAAbstractDotView 12 | 13 | @property (nonatomic, strong) UIColor *dotColor; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Src/Demos/BaseVC/BaseTableViewVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // BaseVC.h 3 | // YNPageViewController 4 | // 5 | // Created by ZYN on 2018/6/22. 6 | // Copyright © 2018年 yongneng. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BaseTableViewVC : UIViewController 12 | 13 | @property (nonatomic, copy) NSString *cellTitle; 14 | 15 | @property (nonatomic, strong) UITableView *tableView; 16 | 17 | - (void)addTableViewRefresh; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // YNPageViewController 4 | // 5 | // Created by ZYN on 2018/4/22. 6 | // Copyright © 2018年 yongneng. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @implementation AppDelegate 12 | 13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 14 | self.window.backgroundColor = [UIColor whiteColor]; 15 | return YES; 16 | } 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Assets.xcassets/small_icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "vip@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "vip@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/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 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Src/Demos/BaseVC/BaseViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // BaseViewController.m 3 | // YNPageViewController 4 | // 5 | // Created by ZYN on 2018/6/26. 6 | // Copyright © 2018年 yongneng. All rights reserved. 7 | // 8 | 9 | #import "BaseViewController.h" 10 | 11 | @interface BaseViewController () 12 | 13 | @end 14 | 15 | @implementation BaseViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | self.view.backgroundColor = [UIColor whiteColor]; 20 | } 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Src/Demos/SuspendTopPausePageVC/YNSuspendTopPauseBaseTableViewVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // YNSuspendTopPauseBaseTableViewVC.h 3 | // YNPageViewController 4 | // 5 | // Created by ZYN on 2018/7/14. 6 | // Copyright © 2018年 yongneng. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface YNSuspendTopPauseBaseTableViewVC : UIViewController 12 | 13 | @property (nonatomic, copy) NSString *cellTitle; 14 | 15 | @property (nonatomic, strong) UITableView *tableView; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Assets.xcassets/mine_header_bg.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "mine_header_bg@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "mine_header_bg@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/SDWebImage/UIImage+GIF.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+GIF.h 3 | // LBGIFImage 4 | // 5 | // Created by Laurin Brandner on 06.01.12. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIImage (GIF) 12 | 13 | + (UIImage *)sd_animatedGIFNamed:(NSString *)name; 14 | 15 | + (UIImage *)sd_animatedGIFWithData:(NSData *)data; 16 | 17 | - (UIImage *)sd_animatedImageByScalingAndCroppingToSize:(CGSize)size; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/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 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Assets.xcassets/icon_back_small_black.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icon_back_small_black@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "icon_back_small_black@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/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 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Src/Demos/SuspendCenterPageVC/YNSuspendCenterPageVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // SuspendCenterPageVC.h 3 | // YNPageViewController 4 | // 5 | // Created by ZYN on 2018/6/22. 6 | // Copyright © 2018年 yongneng. All rights reserved. 7 | // 8 | 9 | #import "BasePageViewController.h" 10 | #import "YNPageConfigration.h" 11 | 12 | @interface YNSuspendCenterPageVC : BasePageViewController 13 | 14 | + (instancetype)suspendCenterPageVC; 15 | 16 | + (instancetype)suspendCenterPageVCWithConfig:(YNPageConfigration *)config; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/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 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/SDWebImage/SDWebImageDecoder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * Created by james on 9/28/11. 6 | * 7 | * For the full copyright and license information, please view the LICENSE 8 | * file that was distributed with this source code. 9 | */ 10 | 11 | #import 12 | #import "SDWebImageCompat.h" 13 | 14 | @interface UIImage (ForceDecode) 15 | 16 | + (UIImage *)decodedImageWithImage:(UIImage *)image; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/YNPageViewController/View/YNPageTableView.m: -------------------------------------------------------------------------------- 1 | // 2 | // YNPageTableView.m 3 | // YNPageViewController 4 | // 5 | // Created by ZYN on 2018/7/14. 6 | // Copyright © 2018年 yongneng. All rights reserved. 7 | // 8 | 9 | #import "YNPageTableView.h" 10 | 11 | @interface YNPageTableView () 12 | 13 | @end 14 | 15 | @implementation YNPageTableView 16 | 17 | - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer { 18 | return YES; 19 | } 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/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" -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/YNPageViewController/View/YNPageCollectionView.m: -------------------------------------------------------------------------------- 1 | // 2 | // YNPageCollectionView.m 3 | // YNPageViewController 4 | // 5 | // Created by ZYN on 2018/7/14. 6 | // Copyright © 2018年 yongneng. All rights reserved. 7 | // 8 | 9 | #import "YNPageCollectionView.h" 10 | 11 | @interface YNPageCollectionView () 12 | 13 | @end 14 | 15 | @implementation YNPageCollectionView 16 | 17 | - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer { 18 | return YES; 19 | } 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/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 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/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 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/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 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/SDCycleScrollView/Lib/SDCycleScrollView/PageControl/TAAbstractDotView.h: -------------------------------------------------------------------------------- 1 | // 2 | // TAAbstractDotView.h 3 | // TAPageControl 4 | // 5 | // Created by Tanguy Aladenise on 2015-01-22. 6 | // Copyright (c) 2015 Tanguy Aladenise. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface TAAbstractDotView : UIView 13 | 14 | 15 | /** 16 | * A method call let view know which state appearance it should take. Active meaning it's current page. Inactive not the current page. 17 | * 18 | * @param active BOOL to tell if view is active or not 19 | */ 20 | - (void)changeActivityState:(BOOL)active; 21 | 22 | 23 | @end 24 | 25 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/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 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/SDWebImage/NSData+ImageContentType.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Fabrice Aneche on 06/01/14. 3 | // Copyright (c) 2014 Dailymotion. All rights reserved. 4 | // 5 | 6 | #import 7 | 8 | @interface NSData (ImageContentType) 9 | 10 | /** 11 | * Compute the content type for an image data 12 | * 13 | * @param data the input data 14 | * 15 | * @return the content type as string (i.e. image/jpeg, image/gif) 16 | */ 17 | + (NSString *)sd_contentTypeForImageData:(NSData *)data; 18 | 19 | @end 20 | 21 | 22 | @interface NSData (ImageContentTypeDeprecated) 23 | 24 | + (NSString *)contentTypeForImageData:(NSData *)data __deprecated_msg("Use `sd_contentTypeForImageData:`"); 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/YNPageViewController/Category/UIViewController+YNPageExtend.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+YNPageExtend.h 3 | // YNPageViewController 4 | // 5 | // Created by ZYN on 2018/5/25. 6 | // Copyright © 2018年 yongneng. All rights reserved. 7 | // 提供在 子控制器 提供快速取值 8 | 9 | #import 10 | #import "YNPageViewController.h" 11 | 12 | @interface UIViewController (YNPageExtend) 13 | 14 | - (YNPageViewController *)yn_pageViewController; 15 | 16 | - (YNPageConfigration *)config; 17 | 18 | - (YNPageScrollView *)bgScrollView; 19 | 20 | - (YNPageScrollMenuView *)scrollMenuView; 21 | 22 | - (NSMutableArray<__kindof UIViewController *> *)controllersM; 23 | 24 | - (NSMutableArray *)titlesM; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/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 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/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 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/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 | @end 21 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/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 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/YNPreHeader.h: -------------------------------------------------------------------------------- 1 | // 2 | // YNPreHeader.h 3 | // YNPageViewController 4 | // 5 | // Created by ZYN on 2018/5/21. 6 | // Copyright © 2018年 yongneng. All rights reserved. 7 | // 8 | 9 | #ifndef YNPreHeader_h 10 | #define YNPreHeader_h 11 | 12 | #import "FTPopOverMenu.h" 13 | 14 | #define kSCREEN_WIDTH [UIScreen mainScreen].bounds.size.width 15 | 16 | #define kSCREEN_HEIGHT [UIScreen mainScreen].bounds.size.height 17 | 18 | #define RGBA(r, g, b, a) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:a] 19 | 20 | #define random(r, g, b, a) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:(a)/255.0] 21 | 22 | #define randomColor random(arc4random_uniform(256), arc4random_uniform(256), arc4random_uniform(256), arc4random_uniform(256)) 23 | 24 | #endif /* YNPreHeader_h */ 25 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/YNPageViewController/Category/UIScrollView+YNPageExtend.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIScrollView+YNPageExtend.h 3 | // YNPageViewController 4 | // 5 | // Created by ZYN on 2018/5/8. 6 | // Copyright © 2018年 yongneng. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef void(^YNPageScrollViewDidScrollView)(UIScrollView *scrollView); 12 | 13 | typedef void(^YNPageScrollViewBeginDragginScrollView)(UIScrollView *scrollView); 14 | 15 | @interface UIScrollView (YNPageExtend) 16 | 17 | @property (nonatomic, assign) BOOL yn_observerDidScrollView; 18 | 19 | @property (nonatomic, copy) YNPageScrollViewDidScrollView yn_pageScrollViewDidScrollView; 20 | 21 | @property (nonatomic, copy) YNPageScrollViewBeginDragginScrollView yn_pageScrollViewBeginDragginScrollView; 22 | 23 | - (void)yn_setContentOffsetY:(CGFloat)offsetY; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/YNPageViewController/View/YNPageHeaderScrollView.m: -------------------------------------------------------------------------------- 1 | // 2 | // YNPageHeaderScrollView.m 3 | // YNPageViewController 4 | // 5 | // Created by ZYN on 2018/5/25. 6 | // Copyright © 2018年 yongneng. All rights reserved. 7 | // 8 | 9 | #import "YNPageHeaderScrollView.h" 10 | 11 | @interface YNPageHeaderScrollView () 12 | 13 | @end 14 | 15 | @implementation YNPageHeaderScrollView 16 | 17 | - (instancetype)initWithFrame:(CGRect)frame { 18 | self = [super initWithFrame:frame]; 19 | if (self) { 20 | self.delegate = self; 21 | self.showsVerticalScrollIndicator = NO; 22 | self.showsHorizontalScrollIndicator = NO; 23 | } 24 | return self; 25 | } 26 | 27 | - (void)scrollViewDidScroll:(UIScrollView *)scrollView { 28 | [scrollView setContentOffset:CGPointMake(0, 0) animated:NO]; 29 | } 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/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 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/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 (assign, nonatomic) CGFloat mj_insetT; 14 | @property (assign, nonatomic) CGFloat mj_insetB; 15 | @property (assign, nonatomic) CGFloat mj_insetL; 16 | @property (assign, nonatomic) CGFloat mj_insetR; 17 | 18 | @property (assign, nonatomic) CGFloat mj_offsetX; 19 | @property (assign, nonatomic) CGFloat mj_offsetY; 20 | 21 | @property (assign, nonatomic) CGFloat mj_contentW; 22 | @property (assign, nonatomic) CGFloat mj_contentH; 23 | @end 24 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/MLeaksFinder/UIView+MemoryLeak.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Tencent is pleased to support the open source community by making MLeaksFinder available. 3 | * 4 | * Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. 5 | * 6 | * Licensed under the BSD 3-Clause License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 7 | * 8 | * https://opensource.org/licenses/BSD-3-Clause 9 | * 10 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 11 | */ 12 | 13 | #import 14 | #import "MLeaksFinder.h" 15 | 16 | #if _INTERNAL_MLF_ENABLED 17 | 18 | @interface UIView (MemoryLeak) 19 | 20 | @end 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/MLeaksFinder/UITouch+MemoryLeak.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Tencent is pleased to support the open source community by making MLeaksFinder available. 3 | * 4 | * Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. 5 | * 6 | * Licensed under the BSD 3-Clause License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 7 | * 8 | * https://opensource.org/licenses/BSD-3-Clause 9 | * 10 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 11 | */ 12 | 13 | #import 14 | #import "MLeaksFinder.h" 15 | 16 | #if _INTERNAL_MLF_ENABLED 17 | 18 | @interface UITouch (MemoryLeak) 19 | 20 | @end 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/MLeaksFinder/UIApplication+MemoryLeak.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Tencent is pleased to support the open source community by making MLeaksFinder available. 3 | * 4 | * Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. 5 | * 6 | * Licensed under the BSD 3-Clause License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 7 | * 8 | * https://opensource.org/licenses/BSD-3-Clause 9 | * 10 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 11 | */ 12 | 13 | #import 14 | #import "MLeaksFinder.h" 15 | 16 | #if _INTERNAL_MLF_ENABLED 17 | 18 | @interface UIApplication (MemoryLeak) 19 | 20 | @end 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/MLeaksFinder/UIViewController+MemoryLeak.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Tencent is pleased to support the open source community by making MLeaksFinder available. 3 | * 4 | * Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. 5 | * 6 | * Licensed under the BSD 3-Clause License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 7 | * 8 | * https://opensource.org/licenses/BSD-3-Clause 9 | * 10 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 11 | */ 12 | 13 | #import 14 | #import "MLeaksFinder.h" 15 | 16 | #if _INTERNAL_MLF_ENABLED 17 | 18 | @interface UIViewController (MemoryLeak) 19 | 20 | @end 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/MLeaksFinder/UITabBarController+MemoryLeak.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Tencent is pleased to support the open source community by making MLeaksFinder available. 3 | * 4 | * Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. 5 | * 6 | * Licensed under the BSD 3-Clause License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 7 | * 8 | * https://opensource.org/licenses/BSD-3-Clause 9 | * 10 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 11 | */ 12 | 13 | #import 14 | #import "MLeaksFinder.h" 15 | 16 | #if _INTERNAL_MLF_ENABLED 17 | 18 | @interface UITabBarController (MemoryLeak) 19 | 20 | @end 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/MLeaksFinder/UIPageViewController+MemoryLeak.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Tencent is pleased to support the open source community by making MLeaksFinder available. 3 | * 4 | * Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. 5 | * 6 | * Licensed under the BSD 3-Clause License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 7 | * 8 | * https://opensource.org/licenses/BSD-3-Clause 9 | * 10 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 11 | */ 12 | 13 | #import 14 | #import "MLeaksFinder.h" 15 | 16 | #if _INTERNAL_MLF_ENABLED 17 | 18 | @interface UIPageViewController (MemoryLeak) 19 | 20 | @end 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/MLeaksFinder/UISplitViewController+MemoryLeak.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Tencent is pleased to support the open source community by making MLeaksFinder available. 3 | * 4 | * Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. 5 | * 6 | * Licensed under the BSD 3-Clause License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 7 | * 8 | * https://opensource.org/licenses/BSD-3-Clause 9 | * 10 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 11 | */ 12 | 13 | #import 14 | #import "MLeaksFinder.h" 15 | 16 | #if _INTERNAL_MLF_ENABLED 17 | 18 | @interface UISplitViewController (MemoryLeak) 19 | 20 | @end 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/MLeaksFinder/MLeakedObjectProxy.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Tencent is pleased to support the open source community by making MLeaksFinder available. 3 | * 4 | * Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. 5 | * 6 | * Licensed under the BSD 3-Clause License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 7 | * 8 | * https://opensource.org/licenses/BSD-3-Clause 9 | * 10 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 11 | */ 12 | 13 | #import 14 | 15 | @interface MLeakedObjectProxy : NSObject 16 | 17 | + (BOOL)isAnyObjectLeakedAtPtrs:(NSSet *)ptrs; 18 | + (void)addLeakedObject:(id)object; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/MLeaksFinder/UINavigationController+MemoryLeak.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Tencent is pleased to support the open source community by making MLeaksFinder available. 3 | * 4 | * Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. 5 | * 6 | * Licensed under the BSD 3-Clause License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 7 | * 8 | * https://opensource.org/licenses/BSD-3-Clause 9 | * 10 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 11 | */ 12 | 13 | #import 14 | #import "MLeaksFinder.h" 15 | 16 | #if _INTERNAL_MLF_ENABLED 17 | 18 | @interface UINavigationController (MemoryLeak) 19 | 20 | @end 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/SDCycleScrollView/Lib/SDCycleScrollView/PageControl/TAAbstractDotView.m: -------------------------------------------------------------------------------- 1 | // 2 | // TAAbstractDotView.m 3 | // TAPageControl 4 | // 5 | // Created by Tanguy Aladenise on 2015-01-22. 6 | // Copyright (c) 2015 Tanguy Aladenise. All rights reserved. 7 | // 8 | 9 | #import "TAAbstractDotView.h" 10 | 11 | 12 | @implementation TAAbstractDotView 13 | 14 | 15 | - (id)init 16 | { 17 | @throw [NSException exceptionWithName:NSInternalInconsistencyException 18 | reason:[NSString stringWithFormat:@"You must override %@ in %@", NSStringFromSelector(_cmd), self.class] 19 | userInfo:nil]; 20 | } 21 | 22 | 23 | - (void)changeActivityState:(BOOL)active 24 | { 25 | @throw [NSException exceptionWithName:NSInternalInconsistencyException 26 | reason:[NSString stringWithFormat:@"You must override %@ in %@", NSStringFromSelector(_cmd), self.class] 27 | userInfo:nil]; 28 | } 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/YNPageViewController/Category/UIViewController+YNPageExtend.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+YNPageExtend.m 3 | // YNPageViewController 4 | // 5 | // Created by ZYN on 2018/5/25. 6 | // Copyright © 2018年 yongneng. All rights reserved. 7 | // 8 | 9 | #import "UIViewController+YNPageExtend.h" 10 | 11 | @implementation UIViewController (YNPageExtend) 12 | 13 | - (YNPageViewController *)yn_pageViewController { 14 | return (YNPageViewController *)self.parentViewController; 15 | } 16 | 17 | - (YNPageConfigration *)config { 18 | return self.yn_pageViewController.config; 19 | } 20 | 21 | - (YNPageScrollView *)bgScrollView { 22 | return self.yn_pageViewController.bgScrollView; 23 | } 24 | 25 | - (YNPageScrollMenuView *)scrollMenuView { 26 | return self.yn_pageViewController.scrollMenuView; 27 | } 28 | 29 | - (NSMutableArray<__kindof UIViewController *> *)controllersM { 30 | return self.yn_pageViewController.controllersM; 31 | } 32 | 33 | - (NSMutableArray *)titlesM { 34 | return self.yn_pageViewController.titlesM; 35 | } 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/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 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 郑永能 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/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 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/SDWebImage/UIView+WebCacheOperation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageManager.h" 11 | 12 | @interface UIView (WebCacheOperation) 13 | 14 | /** 15 | * Set the image load operation (storage in a UIView based dictionary) 16 | * 17 | * @param operation the operation 18 | * @param key key for storing the operation 19 | */ 20 | - (void)sd_setImageLoadOperation:(id)operation forKey:(NSString *)key; 21 | 22 | /** 23 | * Cancel all operations for the current UIView and key 24 | * 25 | * @param key key for identifying the operations 26 | */ 27 | - (void)sd_cancelImageLoadOperationWithKey:(NSString *)key; 28 | 29 | /** 30 | * Just remove the operations corresponding to the current UIView and key without cancelling them 31 | * 32 | * @param key key for identifying the operations 33 | */ 34 | - (void)sd_removeImageLoadOperationWithKey:(NSString *)key; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/YNPageViewController/Category/UIView+YNPageExtend.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+YNPageExtend.h 3 | // YNPageViewController 4 | // 5 | // Created by ZYN on 2018/4/22. 6 | // Copyright © 2018年 yongneng. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #define kYNPAGE_SCREEN_WIDTH ([UIScreen mainScreen].bounds.size.width) 12 | 13 | #define kYNPAGE_SCREEN_HEIGHT ([UIScreen mainScreen].bounds.size.height) 14 | 15 | #define kYNPAGE_IS_IPHONE_X ((kYNPAGE_SCREEN_WIDTH == 375.f && kYNPAGE_SCREEN_HEIGHT == 812.f) || (kYNPAGE_SCREEN_WIDTH == 414.f && kYNPAGE_SCREEN_HEIGHT == 896.f)) 16 | 17 | #define kYNPAGE_NAVHEIGHT (kYNPAGE_IS_IPHONE_X ? 88 : 64) 18 | 19 | #define kYNPAGE_TABBARHEIGHT (kYNPAGE_IS_IPHONE_X ? 83 : 49) 20 | 21 | #define kLESS_THAN_iOS11 ([[UIDevice currentDevice].systemVersion floatValue] < 11.0 ? YES : NO) 22 | 23 | @interface UIView (YNPageExtend) 24 | 25 | @property (nonatomic, assign) CGFloat yn_x; 26 | 27 | @property (nonatomic, assign) CGFloat yn_y; 28 | 29 | @property (nonatomic, assign) CGFloat yn_width; 30 | 31 | @property (nonatomic, assign) CGFloat yn_height; 32 | 33 | @property (nonatomic, assign) CGFloat yn_bottom; 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/MLeaksFinder/UIView+MemoryLeak.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Tencent is pleased to support the open source community by making MLeaksFinder available. 3 | * 4 | * Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. 5 | * 6 | * Licensed under the BSD 3-Clause License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 7 | * 8 | * https://opensource.org/licenses/BSD-3-Clause 9 | * 10 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 11 | */ 12 | 13 | #import "UIView+MemoryLeak.h" 14 | #import "NSObject+MemoryLeak.h" 15 | 16 | #if _INTERNAL_MLF_ENABLED 17 | 18 | @implementation UIView (MemoryLeak) 19 | 20 | - (BOOL)willDealloc { 21 | if (![super willDealloc]) { 22 | return NO; 23 | } 24 | 25 | [self willReleaseChildren:self.subviews]; 26 | 27 | return YES; 28 | } 29 | 30 | @end 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/MLeaksFinder/MLeaksMessenger.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Tencent is pleased to support the open source community by making MLeaksFinder available. 3 | * 4 | * Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. 5 | * 6 | * Licensed under the BSD 3-Clause License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 7 | * 8 | * https://opensource.org/licenses/BSD-3-Clause 9 | * 10 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 11 | */ 12 | 13 | #import 14 | #import 15 | 16 | @interface MLeaksMessenger : NSObject 17 | 18 | + (void)alertWithTitle:(NSString *)title message:(NSString *)message; 19 | + (void)alertWithTitle:(NSString *)title 20 | message:(NSString *)message 21 | delegate:(id)delegate 22 | additionalButtonTitle:(NSString *)additionalButtonTitle; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/MLeaksFinder/UITabBarController+MemoryLeak.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Tencent is pleased to support the open source community by making MLeaksFinder available. 3 | * 4 | * Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. 5 | * 6 | * Licensed under the BSD 3-Clause License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 7 | * 8 | * https://opensource.org/licenses/BSD-3-Clause 9 | * 10 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 11 | */ 12 | 13 | #import "UITabBarController+MemoryLeak.h" 14 | #import "NSObject+MemoryLeak.h" 15 | 16 | #if _INTERNAL_MLF_ENABLED 17 | 18 | @implementation UITabBarController (MemoryLeak) 19 | 20 | - (BOOL)willDealloc { 21 | if (![super willDealloc]) { 22 | return NO; 23 | } 24 | 25 | [self willReleaseChildren:self.viewControllers]; 26 | 27 | return YES; 28 | } 29 | 30 | @end 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/MLeaksFinder/UIPageViewController+MemoryLeak.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Tencent is pleased to support the open source community by making MLeaksFinder available. 3 | * 4 | * Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. 5 | * 6 | * Licensed under the BSD 3-Clause License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 7 | * 8 | * https://opensource.org/licenses/BSD-3-Clause 9 | * 10 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 11 | */ 12 | 13 | #import "UIPageViewController+MemoryLeak.h" 14 | #import "NSObject+MemoryLeak.h" 15 | 16 | #if _INTERNAL_MLF_ENABLED 17 | 18 | @implementation UIPageViewController (MemoryLeak) 19 | 20 | - (BOOL)willDealloc { 21 | if (![super willDealloc]) { 22 | return NO; 23 | } 24 | 25 | [self willReleaseChildren:self.viewControllers]; 26 | 27 | return YES; 28 | } 29 | 30 | @end 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/MLeaksFinder/UISplitViewController+MemoryLeak.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Tencent is pleased to support the open source community by making MLeaksFinder available. 3 | * 4 | * Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. 5 | * 6 | * Licensed under the BSD 3-Clause License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 7 | * 8 | * https://opensource.org/licenses/BSD-3-Clause 9 | * 10 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 11 | */ 12 | 13 | #import "UISplitViewController+MemoryLeak.h" 14 | #import "NSObject+MemoryLeak.h" 15 | 16 | #if _INTERNAL_MLF_ENABLED 17 | 18 | @implementation UISplitViewController (MemoryLeak) 19 | 20 | - (BOOL)willDealloc { 21 | if (![super willDealloc]) { 22 | return NO; 23 | } 24 | 25 | [self willReleaseChildren:self.viewControllers]; 26 | 27 | return YES; 28 | } 29 | 30 | @end 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/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; 30 | @end 31 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/MLeaksFinder/MLeaksFinder.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Tencent is pleased to support the open source community by making MLeaksFinder available. 3 | * 4 | * Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. 5 | * 6 | * Licensed under the BSD 3-Clause License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 7 | * 8 | * https://opensource.org/licenses/BSD-3-Clause 9 | * 10 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 11 | */ 12 | 13 | #import "NSObject+MemoryLeak.h" 14 | 15 | //#define MEMORY_LEAKS_FINDER_ENABLED 0 16 | 17 | #ifdef MEMORY_LEAKS_FINDER_ENABLED 18 | #define _INTERNAL_MLF_ENABLED MEMORY_LEAKS_FINDER_ENABLED 19 | #else 20 | #define _INTERNAL_MLF_ENABLED DEBUG 21 | #endif 22 | 23 | #define MEMORY_LEAKS_FINDER_RETAIN_CYCLE_ENABLED 0 24 | 25 | #ifdef MEMORY_LEAKS_FINDER_RETAIN_CYCLE_ENABLED 26 | #define _INTERNAL_MLF_RC_ENABLED MEMORY_LEAKS_FINDER_RETAIN_CYCLE_ENABLED 27 | #elif COCOAPODS 28 | #define _INTERNAL_MLF_RC_ENABLED COCOAPODS 29 | #endif 30 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/MLeaksFinder/NSObject+MemoryLeak.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Tencent is pleased to support the open source community by making MLeaksFinder available. 3 | * 4 | * Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. 5 | * 6 | * Licensed under the BSD 3-Clause License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 7 | * 8 | * https://opensource.org/licenses/BSD-3-Clause 9 | * 10 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 11 | */ 12 | 13 | #import 14 | 15 | #define MLCheck(TARGET) [self willReleaseObject:(TARGET) relationship:@#TARGET]; 16 | 17 | @interface NSObject (MemoryLeak) 18 | 19 | - (BOOL)willDealloc; 20 | - (void)willReleaseObject:(id)object relationship:(NSString *)relationship; 21 | 22 | - (void)willReleaseChild:(id)child; 23 | - (void)willReleaseChildren:(NSArray *)children; 24 | 25 | - (NSArray *)viewStack; 26 | 27 | + (void)addClassNamesToWhitelist:(NSArray *)classNames; 28 | 29 | + (void)swizzleSEL:(SEL)originalSEL withSEL:(SEL)swizzledSEL; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/SDCycleScrollView/Lib/SDCycleScrollView/UIView+SDExtension.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+SDExtension.h 3 | // SDRefreshView 4 | // 5 | // Created by aier on 15-2-23. 6 | // Copyright (c) 2015年 GSD. All rights reserved. 7 | // 8 | 9 | /* 10 | 11 | ********************************************************************************* 12 | * 13 | * 🌟🌟🌟 新建SDCycleScrollView交流QQ群:185534916 🌟🌟🌟 14 | * 15 | * 在您使用此自动轮播库的过程中如果出现bug请及时以以下任意一种方式联系我们,我们会及时修复bug并 16 | * 帮您解决问题。 17 | * 新浪微博:GSD_iOS 18 | * Email : gsdios@126.com 19 | * GitHub: https://github.com/gsdios 20 | * 21 | * 另(我的自动布局库SDAutoLayout): 22 | * 一行代码搞定自动布局!支持Cell和Tableview高度自适应,Label和ScrollView内容自适应,致力于 23 | * 做最简单易用的AutoLayout库。 24 | * 视频教程:http://www.letv.com/ptv/vplay/24038772.html 25 | * 用法示例:https://github.com/gsdios/SDAutoLayout/blob/master/README.md 26 | * GitHub:https://github.com/gsdios/SDAutoLayout 27 | ********************************************************************************* 28 | 29 | */ 30 | 31 | #import 32 | 33 | #define SDColorCreater(r, g, b, a) [UIColor colorWithRed:(r / 255.0) green:(g / 255.0) blue:(b / 255.0) alpha:a] 34 | 35 | 36 | @interface UIView (SDExtension) 37 | 38 | @property (nonatomic, assign) CGFloat sd_height; 39 | @property (nonatomic, assign) CGFloat sd_width; 40 | 41 | @property (nonatomic, assign) CGFloat sd_y; 42 | @property (nonatomic, assign) CGFloat sd_x; 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/SDCycleScrollView/Lib/SDCycleScrollView/PageControl/TADotView.m: -------------------------------------------------------------------------------- 1 | // 2 | // TADotView.m 3 | // TAPageControl 4 | // 5 | // Created by Tanguy Aladenise on 2015-01-22. 6 | // Copyright (c) 2015 Tanguy Aladenise. All rights reserved. 7 | // 8 | 9 | #import "TADotView.h" 10 | 11 | @implementation TADotView 12 | 13 | 14 | - (instancetype)init 15 | { 16 | self = [super init]; 17 | if (self) { 18 | [self initialization]; 19 | } 20 | 21 | return self; 22 | } 23 | 24 | 25 | - (id)initWithFrame:(CGRect)frame 26 | { 27 | self = [super initWithFrame:frame]; 28 | if (self) { 29 | [self initialization]; 30 | } 31 | return self; 32 | } 33 | 34 | 35 | - (id)initWithCoder:(NSCoder *)aDecoder 36 | { 37 | self = [super initWithCoder:aDecoder]; 38 | if (self) { 39 | [self initialization]; 40 | } 41 | 42 | return self; 43 | } 44 | 45 | - (void)initialization 46 | { 47 | self.backgroundColor = [UIColor clearColor]; 48 | self.layer.cornerRadius = CGRectGetWidth(self.frame) / 2; 49 | self.layer.borderColor = [UIColor whiteColor].CGColor; 50 | self.layer.borderWidth = 2; 51 | } 52 | 53 | 54 | - (void)changeActivityState:(BOOL)active 55 | { 56 | if (active) { 57 | self.backgroundColor = [UIColor whiteColor]; 58 | } else { 59 | self.backgroundColor = [UIColor clearColor]; 60 | } 61 | } 62 | 63 | @end 64 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/SDWebImage/NSData+ImageContentType.m: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Fabrice Aneche on 06/01/14. 3 | // Copyright (c) 2014 Dailymotion. All rights reserved. 4 | // 5 | 6 | #import "NSData+ImageContentType.h" 7 | 8 | 9 | @implementation NSData (ImageContentType) 10 | 11 | + (NSString *)sd_contentTypeForImageData:(NSData *)data { 12 | uint8_t c; 13 | [data getBytes:&c length:1]; 14 | switch (c) { 15 | case 0xFF: 16 | return @"image/jpeg"; 17 | case 0x89: 18 | return @"image/png"; 19 | case 0x47: 20 | return @"image/gif"; 21 | case 0x49: 22 | case 0x4D: 23 | return @"image/tiff"; 24 | case 0x52: 25 | // R as RIFF for WEBP 26 | if ([data length] < 12) { 27 | return nil; 28 | } 29 | 30 | NSString *testString = [[NSString alloc] initWithData:[data subdataWithRange:NSMakeRange(0, 12)] encoding:NSASCIIStringEncoding]; 31 | if ([testString hasPrefix:@"RIFF"] && [testString hasSuffix:@"WEBP"]) { 32 | return @"image/webp"; 33 | } 34 | 35 | return nil; 36 | } 37 | return nil; 38 | } 39 | 40 | @end 41 | 42 | 43 | @implementation NSData (ImageContentTypeDeprecated) 44 | 45 | + (NSString *)contentTypeForImageData:(NSData *)data { 46 | return [self sd_contentTypeForImageData:data]; 47 | } 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "icon-29@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "icon-29@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "icon-40@2x.png", 19 | "scale" : "2x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "icon-40@3x.png", 25 | "scale" : "3x" 26 | }, 27 | { 28 | "size" : "40x40", 29 | "idiom" : "iphone", 30 | "filename" : "icon-29@2x-1.png", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "icon-29@3x-1.png", 37 | "scale" : "3x" 38 | }, 39 | { 40 | "size" : "60x60", 41 | "idiom" : "iphone", 42 | "filename" : "icon-60@2x.png", 43 | "scale" : "2x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "icon-60@3x.png", 49 | "scale" : "3x" 50 | }, 51 | { 52 | "size" : "1024x1024", 53 | "idiom" : "ios-marketing", 54 | "filename" : "icon-1024.png", 55 | "scale" : "1x" 56 | } 57 | ], 58 | "info" : { 59 | "version" : 1, 60 | "author" : "xcode" 61 | } 62 | } -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/YNPageViewController/Category/UIView+YNPageExtend.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+YNPageExtend.m 3 | // YNPageViewController 4 | // 5 | // Created by ZYN on 2018/4/22. 6 | // Copyright © 2018年 yongneng. All rights reserved. 7 | // 8 | 9 | #import "UIView+YNPageExtend.h" 10 | 11 | @implementation UIView (YNPageExtend) 12 | 13 | - (void)setYn_x:(CGFloat)yn_x { 14 | CGRect frame = self.frame; 15 | frame.origin.x = yn_x; 16 | self.frame = frame; 17 | } 18 | 19 | - (CGFloat)yn_x { 20 | return self.frame.origin.x; 21 | } 22 | 23 | - (void)setYn_y:(CGFloat)yn_y { 24 | CGRect frame = self.frame; 25 | frame.origin.y = yn_y; 26 | self.frame = frame; 27 | } 28 | 29 | - (CGFloat)yn_y { 30 | return self.frame.origin.y; 31 | } 32 | 33 | - (CGFloat)yn_width { 34 | return self.frame.size.width; 35 | } 36 | 37 | - (void)setYn_width:(CGFloat)yn_width { 38 | CGRect frame = self.frame; 39 | frame.size.width = yn_width; 40 | self.frame = frame; 41 | } 42 | 43 | - (CGFloat)yn_height { 44 | return self.frame.size.height; 45 | } 46 | 47 | - (void)setYn_height:(CGFloat)yn_height { 48 | CGRect frame = self.frame; 49 | frame.size.height = yn_height; 50 | self.frame = frame; 51 | } 52 | 53 | - (CGFloat)yn_bottom { 54 | return self.frame.size.height + self.frame.origin.y; 55 | } 56 | 57 | - (void)setYn_bottom:(CGFloat)yn_bottom { 58 | CGRect frame = self.frame; 59 | frame.origin.y = yn_bottom - frame.size.height; 60 | self.frame = frame; 61 | } 62 | 63 | @end 64 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/MLeaksFinder/UITouch+MemoryLeak.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Tencent is pleased to support the open source community by making MLeaksFinder available. 3 | * 4 | * Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. 5 | * 6 | * Licensed under the BSD 3-Clause License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 7 | * 8 | * https://opensource.org/licenses/BSD-3-Clause 9 | * 10 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 11 | */ 12 | 13 | #import "UITouch+MemoryLeak.h" 14 | #import 15 | 16 | #if _INTERNAL_MLF_ENABLED 17 | 18 | extern const void *const kLatestSenderKey; 19 | 20 | @implementation UITouch (MemoryLeak) 21 | 22 | + (void)load { 23 | static dispatch_once_t onceToken; 24 | dispatch_once(&onceToken, ^{ 25 | [self swizzleSEL:@selector(setView:) withSEL:@selector(swizzled_setView:)]; 26 | }); 27 | } 28 | 29 | - (void)swizzled_setView:(UIView *)view { 30 | [self swizzled_setView:view]; 31 | 32 | if (view) { 33 | objc_setAssociatedObject([UIApplication sharedApplication], 34 | kLatestSenderKey, 35 | @((uintptr_t)view), 36 | OBJC_ASSOCIATION_RETAIN); 37 | } 38 | } 39 | 40 | @end 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/SDCycleScrollView/Lib/SDCycleScrollView/SDCollectionViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // SDCollectionViewCell.h 3 | // SDCycleScrollView 4 | // 5 | // Created by aier on 15-3-22. 6 | // Copyright (c) 2015年 GSD. All rights reserved. 7 | // 8 | 9 | /* 10 | 11 | ********************************************************************************* 12 | * 13 | * 🌟🌟🌟 新建SDCycleScrollView交流QQ群:185534916 🌟🌟🌟 14 | * 15 | * 在您使用此自动轮播库的过程中如果出现bug请及时以以下任意一种方式联系我们,我们会及时修复bug并 16 | * 帮您解决问题。 17 | * 新浪微博:GSD_iOS 18 | * Email : gsdios@126.com 19 | * GitHub: https://github.com/gsdios 20 | * 21 | * 另(我的自动布局库SDAutoLayout): 22 | * 一行代码搞定自动布局!支持Cell和Tableview高度自适应,Label和ScrollView内容自适应,致力于 23 | * 做最简单易用的AutoLayout库。 24 | * 视频教程:http://www.letv.com/ptv/vplay/24038772.html 25 | * 用法示例:https://github.com/gsdios/SDAutoLayout/blob/master/README.md 26 | * GitHub:https://github.com/gsdios/SDAutoLayout 27 | ********************************************************************************* 28 | 29 | */ 30 | 31 | 32 | 33 | #import 34 | 35 | @interface SDCollectionViewCell : UICollectionViewCell 36 | 37 | @property (weak, nonatomic) UIImageView *imageView; 38 | @property (copy, nonatomic) NSString *title; 39 | 40 | @property (nonatomic, strong) UIColor *titleLabelTextColor; 41 | @property (nonatomic, strong) UIFont *titleLabelTextFont; 42 | @property (nonatomic, strong) UIColor *titleLabelBackgroundColor; 43 | @property (nonatomic, assign) CGFloat titleLabelHeight; 44 | 45 | @property (nonatomic, assign) BOOL hasConfigured; 46 | 47 | /** 只展示文字轮播 */ 48 | @property (nonatomic, assign) BOOL onlyDisplayText; 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xccheckout 23 | *.xcscmblueprint 24 | 25 | ## Obj-C/Swift specific 26 | *.hmap 27 | *.ipa 28 | *.dSYM.zip 29 | *.dSYM 30 | 31 | # CocoaPods 32 | # 33 | # We recommend against adding the Pods directory to your .gitignore. However 34 | # you should judge for yourself, the pros and cons are mentioned at: 35 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 36 | # 37 | # Pods/ 38 | 39 | # Carthage 40 | # 41 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 42 | # Carthage/Checkouts 43 | 44 | Carthage/Build 45 | 46 | # fastlane 47 | # 48 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 49 | # screenshots whenever they are needed. 50 | # For more information about the recommended setup visit: 51 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 52 | 53 | fastlane/report.xml 54 | fastlane/Preview.html 55 | fastlane/screenshots/**/*.png 56 | fastlane/test_output 57 | 58 | # Code Injection 59 | # 60 | # After new code Injection tools there's a generated folder /iOSInjectionProject 61 | # https://github.com/johnno1962/injectionforxcode 62 | 63 | iOSInjectionProject/ 64 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/MLeaksFinder/UIApplication+MemoryLeak.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Tencent is pleased to support the open source community by making MLeaksFinder available. 3 | * 4 | * Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. 5 | * 6 | * Licensed under the BSD 3-Clause License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 7 | * 8 | * https://opensource.org/licenses/BSD-3-Clause 9 | * 10 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 11 | */ 12 | 13 | #import "UIApplication+MemoryLeak.h" 14 | #import "NSObject+MemoryLeak.h" 15 | #import 16 | 17 | #if _INTERNAL_MLF_ENABLED 18 | 19 | extern const void *const kLatestSenderKey; 20 | 21 | @implementation UIApplication (MemoryLeak) 22 | 23 | + (void)load { 24 | static dispatch_once_t onceToken; 25 | dispatch_once(&onceToken, ^{ 26 | [self swizzleSEL:@selector(sendAction:to:from:forEvent:) withSEL:@selector(swizzled_sendAction:to:from:forEvent:)]; 27 | }); 28 | } 29 | 30 | - (BOOL)swizzled_sendAction:(SEL)action to:(id)target from:(id)sender forEvent:(UIEvent *)event { 31 | objc_setAssociatedObject(self, kLatestSenderKey, @((uintptr_t)sender), OBJC_ASSOCIATION_RETAIN); 32 | 33 | return [self swizzled_sendAction:action to:target from:sender forEvent:event]; 34 | } 35 | 36 | @end 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/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 | NSAppTransportSecurity 24 | 25 | NSAllowsArbitraryLoads 26 | 27 | 28 | UILaunchStoryboardName 29 | LaunchScreen 30 | UIMainStoryboardFile 31 | Main 32 | UIRequiredDeviceCapabilities 33 | 34 | armv7 35 | 36 | UISupportedInterfaceOrientations 37 | 38 | UIInterfaceOrientationPortrait 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UISupportedInterfaceOrientations~ipad 43 | 44 | UIInterfaceOrientationPortrait 45 | UIInterfaceOrientationPortraitUpsideDown 46 | UIInterfaceOrientationLandscapeLeft 47 | UIInterfaceOrientationLandscapeRight 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/SDWebImage/SDWebImageCompat.m: -------------------------------------------------------------------------------- 1 | // 2 | // SDWebImageCompat.m 3 | // SDWebImage 4 | // 5 | // Created by Olivier Poitrey on 11/12/12. 6 | // Copyright (c) 2012 Dailymotion. All rights reserved. 7 | // 8 | 9 | #import "SDWebImageCompat.h" 10 | 11 | #if !__has_feature(objc_arc) 12 | #error SDWebImage is ARC only. Either turn on ARC for the project or use -fobjc-arc flag 13 | #endif 14 | 15 | inline UIImage *SDScaledImageForKey(NSString *key, UIImage *image) { 16 | if (!image) { 17 | return nil; 18 | } 19 | 20 | if ([image.images count] > 0) { 21 | NSMutableArray *scaledImages = [NSMutableArray array]; 22 | 23 | for (UIImage *tempImage in image.images) { 24 | [scaledImages addObject:SDScaledImageForKey(key, tempImage)]; 25 | } 26 | 27 | return [UIImage animatedImageWithImages:scaledImages duration:image.duration]; 28 | } 29 | else { 30 | if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)]) { 31 | CGFloat scale = 1; 32 | if (key.length >= 8) { 33 | NSRange range = [key rangeOfString:@"@2x."]; 34 | if (range.location != NSNotFound) { 35 | scale = 2.0; 36 | } 37 | 38 | range = [key rangeOfString:@"@3x."]; 39 | if (range.location != NSNotFound) { 40 | scale = 3.0; 41 | } 42 | } 43 | 44 | UIImage *scaledImage = [[UIImage alloc] initWithCGImage:image.CGImage scale:scale orientation:image.imageOrientation]; 45 | image = scaledImage; 46 | } 47 | return image; 48 | } 49 | } 50 | 51 | NSString *const SDWebImageErrorDomain = @"SDWebImageErrorDomain"; 52 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/YNPageViewController/View/YNPageScrollView.m: -------------------------------------------------------------------------------- 1 | // 2 | // YNPageScrollView.m 3 | // YNPageViewController 4 | // 5 | // Created by ZYN on 2018/4/22. 6 | // Copyright © 2018年 yongneng. All rights reserved. 7 | // 8 | 9 | #import "YNPageScrollView.h" 10 | #import "UIView+YNPageExtend.h" 11 | #import 12 | 13 | @interface YNPageScrollView () 14 | 15 | @end 16 | 17 | @implementation YNPageScrollView 18 | 19 | - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer { 20 | 21 | if ([self panBack:gestureRecognizer]) { 22 | return YES; 23 | } 24 | return NO; 25 | } 26 | 27 | - (BOOL)panBack:(UIGestureRecognizer *)gestureRecognizer { 28 | int location_X = 0.15 * kYNPAGE_SCREEN_WIDTH; 29 | 30 | if (gestureRecognizer == self.panGestureRecognizer) { 31 | UIPanGestureRecognizer *pan = (UIPanGestureRecognizer *)gestureRecognizer; 32 | CGPoint point = [pan translationInView:self]; 33 | UIGestureRecognizerState state = gestureRecognizer.state; 34 | if (UIGestureRecognizerStateBegan == state || UIGestureRecognizerStatePossible == state) { 35 | CGPoint location = [gestureRecognizer locationInView:self]; 36 | int temp1 = location.x; 37 | int temp2 = kYNPAGE_SCREEN_WIDTH; 38 | NSInteger XX = temp1 % temp2; 39 | if (point.x >0 && XX < location_X) { 40 | return YES; 41 | } 42 | } 43 | } 44 | return NO; 45 | } 46 | 47 | - (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer { 48 | if ([self panBack:gestureRecognizer]) { 49 | return NO; 50 | } 51 | return YES; 52 | } 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/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 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/MLeaksFinder/MLeaksMessenger.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Tencent is pleased to support the open source community by making MLeaksFinder available. 3 | * 4 | * Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. 5 | * 6 | * Licensed under the BSD 3-Clause License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 7 | * 8 | * https://opensource.org/licenses/BSD-3-Clause 9 | * 10 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 11 | */ 12 | 13 | #import "MLeaksMessenger.h" 14 | 15 | static __weak UIAlertView *alertView; 16 | 17 | @implementation MLeaksMessenger 18 | 19 | + (void)alertWithTitle:(NSString *)title message:(NSString *)message { 20 | [self alertWithTitle:title message:message delegate:nil additionalButtonTitle:nil]; 21 | } 22 | 23 | + (void)alertWithTitle:(NSString *)title 24 | message:(NSString *)message 25 | delegate:(id)delegate 26 | additionalButtonTitle:(NSString *)additionalButtonTitle { 27 | [alertView dismissWithClickedButtonIndex:0 animated:NO]; 28 | UIAlertView *alertViewTemp = [[UIAlertView alloc] initWithTitle:title 29 | message:message 30 | delegate:delegate 31 | cancelButtonTitle:@"OK" 32 | otherButtonTitles:additionalButtonTitle, nil]; 33 | [alertViewTemp show]; 34 | alertView = alertViewTemp; 35 | 36 | NSLog(@"%@: %@", title, message); 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/YNNavigationController.m: -------------------------------------------------------------------------------- 1 | // 2 | // YNNavigationController.m 3 | // YNPageViewController 4 | // 5 | // Created by ZYN on 2018/5/8. 6 | // Copyright © 2018年 yongneng. All rights reserved. 7 | // 8 | 9 | #import "YNNavigationController.h" 10 | 11 | @interface YNNavigationController () 12 | 13 | @end 14 | 15 | @implementation YNNavigationController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | 20 | self.interactivePopGestureRecognizer.delegate = self; 21 | self.navigationBar.translucent = NO; 22 | [self.navigationBar setBarTintColor:[UIColor whiteColor]]; 23 | } 24 | 25 | #pragma mark - --UIGestureRecognizerDelegate 26 | - (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer { 27 | 28 | if ([[self valueForKey:@"_isTransitioning"] boolValue]) { 29 | return NO; 30 | } 31 | 32 | if (self.viewControllers.count == 1) { 33 | return NO; 34 | } 35 | 36 | return YES; 37 | } 38 | 39 | - (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated { 40 | 41 | if (self.childViewControllers.count > 0) { 42 | UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeCustom]; 43 | [backBtn addTarget:self action:@selector(backBtnClick) forControlEvents:UIControlEventTouchUpInside]; 44 | [backBtn setImage:[UIImage imageNamed:@"icon_back_small_black"] forState:UIControlStateNormal]; 45 | backBtn.tag = 9898; 46 | [backBtn sizeToFit]; 47 | UIBarButtonItem *leftItem = [[UIBarButtonItem alloc] initWithCustomView:backBtn]; 48 | viewController.navigationItem.leftBarButtonItem = leftItem; 49 | viewController.hidesBottomBarWhenPushed = YES; 50 | } 51 | 52 | [super pushViewController:viewController animated:animated]; 53 | } 54 | 55 | - (void)backBtnClick { 56 | [self popViewControllerAnimated:YES]; 57 | } 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/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 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/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"; -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/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 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/SDWebImage/SDWebImageCompat.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * (c) Jamie Pinkham 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | #import 11 | 12 | #ifdef __OBJC_GC__ 13 | #error SDWebImage does not support Objective-C Garbage Collection 14 | #endif 15 | 16 | #if __IPHONE_OS_VERSION_MIN_REQUIRED != 20000 && __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_5_0 17 | #error SDWebImage doesn't support Deployment Target version < 5.0 18 | #endif 19 | 20 | #if !TARGET_OS_IPHONE 21 | #import 22 | #ifndef UIImage 23 | #define UIImage NSImage 24 | #endif 25 | #ifndef UIImageView 26 | #define UIImageView NSImageView 27 | #endif 28 | #else 29 | 30 | #import 31 | 32 | #endif 33 | 34 | #ifndef NS_ENUM 35 | #define NS_ENUM(_type, _name) enum _name : _type _name; enum _name : _type 36 | #endif 37 | 38 | #ifndef NS_OPTIONS 39 | #define NS_OPTIONS(_type, _name) enum _name : _type _name; enum _name : _type 40 | #endif 41 | 42 | #if OS_OBJECT_USE_OBJC 43 | #undef SDDispatchQueueRelease 44 | #undef SDDispatchQueueSetterSementics 45 | #define SDDispatchQueueRelease(q) 46 | #define SDDispatchQueueSetterSementics strong 47 | #else 48 | #undef SDDispatchQueueRelease 49 | #undef SDDispatchQueueSetterSementics 50 | #define SDDispatchQueueRelease(q) (dispatch_release(q)) 51 | #define SDDispatchQueueSetterSementics assign 52 | #endif 53 | 54 | extern UIImage *SDScaledImageForKey(NSString *key, UIImage *image); 55 | 56 | typedef void(^SDWebImageNoParamsBlock)(); 57 | 58 | extern NSString *const SDWebImageErrorDomain; 59 | 60 | #define dispatch_main_sync_safe(block)\ 61 | if ([NSThread isMainThread]) {\ 62 | block();\ 63 | } else {\ 64 | dispatch_sync(dispatch_get_main_queue(), block);\ 65 | } 66 | 67 | #define dispatch_main_async_safe(block)\ 68 | if ([NSThread isMainThread]) {\ 69 | block();\ 70 | } else {\ 71 | dispatch_async(dispatch_get_main_queue(), block);\ 72 | } 73 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/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 | 12 | @interface MJRefreshFooter() 13 | 14 | @end 15 | 16 | @implementation MJRefreshFooter 17 | #pragma mark - 构造方法 18 | + (instancetype)footerWithRefreshingBlock:(MJRefreshComponentRefreshingBlock)refreshingBlock 19 | { 20 | MJRefreshFooter *cmp = [[self alloc] init]; 21 | cmp.refreshingBlock = refreshingBlock; 22 | return cmp; 23 | } 24 | + (instancetype)footerWithRefreshingTarget:(id)target refreshingAction:(SEL)action 25 | { 26 | MJRefreshFooter *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 | // 设置自己的高度 37 | self.mj_h = MJRefreshFooterHeight; 38 | 39 | // 默认不会自动隐藏 40 | self.automaticallyHidden = NO; 41 | } 42 | 43 | - (void)willMoveToSuperview:(UIView *)newSuperview 44 | { 45 | [super willMoveToSuperview:newSuperview]; 46 | 47 | if (newSuperview) { 48 | // 监听scrollView数据的变化 49 | if ([self.scrollView isKindOfClass:[UITableView class]] || [self.scrollView isKindOfClass:[UICollectionView class]]) { 50 | [self.scrollView setMj_reloadDataBlock:^(NSInteger totalDataCount) { 51 | if (self.isAutomaticallyHidden) { 52 | self.hidden = (totalDataCount == 0); 53 | } 54 | }]; 55 | } 56 | } 57 | } 58 | 59 | #pragma mark - 公共方法 60 | - (void)endRefreshingWithNoMoreData 61 | { 62 | self.state = MJRefreshStateNoMoreData; 63 | } 64 | 65 | - (void)noticeNoMoreData 66 | { 67 | [self endRefreshingWithNoMoreData]; 68 | } 69 | 70 | - (void)resetNoMoreData 71 | { 72 | self.state = MJRefreshStateIdle; 73 | } 74 | @end 75 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/SDWebImage/UIView+WebCacheOperation.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "UIView+WebCacheOperation.h" 10 | #import "objc/runtime.h" 11 | 12 | static char loadOperationKey; 13 | 14 | @implementation UIView (WebCacheOperation) 15 | 16 | - (NSMutableDictionary *)operationDictionary { 17 | NSMutableDictionary *operations = objc_getAssociatedObject(self, &loadOperationKey); 18 | if (operations) { 19 | return operations; 20 | } 21 | operations = [NSMutableDictionary dictionary]; 22 | objc_setAssociatedObject(self, &loadOperationKey, operations, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 23 | return operations; 24 | } 25 | 26 | - (void)sd_setImageLoadOperation:(id)operation forKey:(NSString *)key { 27 | [self sd_cancelImageLoadOperationWithKey:key]; 28 | NSMutableDictionary *operationDictionary = [self operationDictionary]; 29 | [operationDictionary setObject:operation forKey:key]; 30 | } 31 | 32 | - (void)sd_cancelImageLoadOperationWithKey:(NSString *)key { 33 | // Cancel in progress downloader from queue 34 | NSMutableDictionary *operationDictionary = [self operationDictionary]; 35 | id operations = [operationDictionary objectForKey:key]; 36 | if (operations) { 37 | if ([operations isKindOfClass:[NSArray class]]) { 38 | for (id operation in operations) { 39 | if (operation) { 40 | [operation cancel]; 41 | } 42 | } 43 | } else if ([operations conformsToProtocol:@protocol(SDWebImageOperation)]){ 44 | [(id) operations cancel]; 45 | } 46 | [operationDictionary removeObjectForKey:key]; 47 | } 48 | } 49 | 50 | - (void)sd_removeImageLoadOperationWithKey:(NSString *)key { 51 | NSMutableDictionary *operationDictionary = [self operationDictionary]; 52 | [operationDictionary removeObjectForKey:key]; 53 | } 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/YNPageViewController/View/YNPageScrollMenuView.h: -------------------------------------------------------------------------------- 1 | // 2 | // YNPageScrollMenuView.h 3 | // YNPageViewController 4 | // 5 | // Created by ZYN on 2018/4/22. 6 | // Copyright © 2018年 yongneng. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class YNPageConfigration; 12 | 13 | @protocol YNPageScrollMenuViewDelegate 14 | @optional 15 | /// 点击item 16 | - (void)pagescrollMenuViewItemOnClick:(UIButton *)button index:(NSInteger)index; 17 | 18 | /// 点击Add按钮 19 | - (void)pagescrollMenuViewAddButtonAction:(UIButton *)button; 20 | 21 | @end 22 | 23 | @interface YNPageScrollMenuView : UIView 24 | /// 添加按钮 25 | @property (nonatomic, strong) UIButton *addButton; 26 | 27 | /// 标题数组 28 | @property (nonatomic, strong) NSMutableArray *titles; 29 | 30 | + (instancetype)new UNAVAILABLE_ATTRIBUTE; 31 | 32 | - (instancetype)init UNAVAILABLE_ATTRIBUTE; 33 | 34 | /** 35 | 初始化YNPageScrollMenuView 36 | 37 | @param frame 大小 38 | @param titles 标题 39 | @param configration 配置信息 40 | @param delegate 代理 41 | @param currentIndex 当前选中下标 42 | */ 43 | + (instancetype)pagescrollMenuViewWithFrame:(CGRect)frame 44 | titles:(NSMutableArray *)titles 45 | configration:(YNPageConfigration *)configration 46 | delegate:(id)delegate 47 | currentIndex:(NSInteger)currentIndex; 48 | 49 | /// 根据标题修下标修改标题 50 | - (void)updateTitle:(NSString *)title index:(NSInteger)index; 51 | 52 | /// 根据标题数组刷新标题 53 | - (void)updateTitles:(NSArray *)titles; 54 | 55 | /// 根据下标调整Item位置 56 | - (void)adjustItemPositionWithCurrentIndex:(NSInteger)index; 57 | 58 | /// 根据上个下标和当前点击的下标调整进度 59 | - (void)adjustItemWithProgress:(CGFloat)progress 60 | lastIndex:(NSInteger)lastIndex 61 | currentIndex:(NSInteger)currentIndex; 62 | /// 选中下标 63 | - (void)selectedItemIndex:(NSInteger)index 64 | animated:(BOOL)animated; 65 | /// 调整Item 66 | - (void)adjustItemWithAnimated:(BOOL)animated; 67 | 68 | /// 调整Item 69 | - (void)adjustItemAnimate:(BOOL)animated; 70 | 71 | /// 刷新视图 72 | - (void)reloadView; 73 | 74 | @end 75 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Src/Demos/TopPageVC/YNTopPageVC.m: -------------------------------------------------------------------------------- 1 | // 2 | // YNTopPageVC.m 3 | // YNPageViewController 4 | // 5 | // Created by ZYN on 2018/6/22. 6 | // Copyright © 2018年 yongneng. All rights reserved. 7 | // 8 | 9 | #import "YNTopPageVC.h" 10 | #import "BaseTableViewVC.h" 11 | 12 | @interface YNTopPageVC () 13 | 14 | @end 15 | 16 | @implementation YNTopPageVC 17 | 18 | - (void)viewDidLoad { 19 | [super viewDidLoad]; 20 | } 21 | 22 | + (instancetype)topPageVC { 23 | YNPageConfigration *configration = [YNPageConfigration defaultConfig]; 24 | configration.pageStyle = YNPageStyleTop; 25 | configration.headerViewCouldScale = YES; 26 | configration.headerViewScaleMode = YNPageHeaderViewScaleModeTop; 27 | configration.showTabbar = NO; 28 | configration.showNavigation = YES; 29 | configration.scrollMenu = NO; 30 | configration.aligmentModeCenter = NO; 31 | configration.lineWidthEqualFontWidth = NO; 32 | configration.showBottomLine = YES; 33 | 34 | YNTopPageVC *vc = [YNTopPageVC pageViewControllerWithControllers:[self getArrayVCs] 35 | titles:[self getArrayTitles] 36 | config:configration]; 37 | vc.dataSource = vc; 38 | vc.delegate = vc; 39 | return vc; 40 | } 41 | 42 | + (NSArray *)getArrayVCs { 43 | BaseTableViewVC *firstVC = [[BaseTableViewVC alloc] init]; 44 | firstVC.cellTitle = @"鞋子"; 45 | 46 | BaseTableViewVC *secondVC = [[BaseTableViewVC alloc] init]; 47 | secondVC.cellTitle = @"衣服"; 48 | 49 | BaseTableViewVC *thirdVC = [[BaseTableViewVC alloc] init]; 50 | thirdVC.cellTitle = @"帽子"; 51 | return @[firstVC, secondVC, thirdVC]; 52 | } 53 | 54 | + (NSArray *)getArrayTitles { 55 | return @[@"鞋子", @"衣服", @"帽子"]; 56 | } 57 | 58 | #pragma mark - YNPageViewControllerDataSource 59 | - (UIScrollView *)pageViewController:(YNPageViewController *)pageViewController pageForIndex:(NSInteger)index { 60 | BaseTableViewVC *baseVC = pageViewController.controllersM[index]; 61 | return [baseVC tableView]; 62 | } 63 | 64 | @end 65 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Src/Demos/NavPageVC/YNNavPageVC.m: -------------------------------------------------------------------------------- 1 | // 2 | // YNNavPageVC.m 3 | // YNPageViewController 4 | // 5 | // Created by ZYN on 2018/6/22. 6 | // Copyright © 2018年 yongneng. All rights reserved. 7 | // 8 | 9 | #import "YNNavPageVC.h" 10 | #import "BaseTableViewVC.h" 11 | 12 | @interface YNNavPageVC () 13 | 14 | @end 15 | 16 | @implementation YNNavPageVC 17 | 18 | - (void)viewDidLoad { 19 | [super viewDidLoad]; 20 | } 21 | 22 | + (instancetype)navPageVC { 23 | YNPageConfigration *configration = [YNPageConfigration defaultConfig]; 24 | configration.pageStyle = YNPageStyleNavigation; 25 | configration.headerViewCouldScale = YES; 26 | configration.headerViewScaleMode = YNPageHeaderViewScaleModeTop; 27 | configration.showTabbar = NO; 28 | configration.showNavigation = YES; 29 | configration.scrollMenu = NO; 30 | configration.aligmentModeCenter = NO; 31 | configration.lineWidthEqualFontWidth = NO; 32 | configration.showBottomLine = YES; 33 | /// 设置菜单栏宽度 34 | configration.menuWidth = 150; 35 | 36 | YNNavPageVC *vc = [YNNavPageVC pageViewControllerWithControllers:[self getArrayVCs] 37 | titles:[self getArrayTitles] 38 | config:configration]; 39 | vc.dataSource = vc; 40 | vc.delegate = vc; 41 | 42 | return vc; 43 | } 44 | 45 | + (NSArray *)getArrayVCs { 46 | BaseTableViewVC *firstVC = [[BaseTableViewVC alloc] init]; 47 | firstVC.cellTitle = @"鞋子"; 48 | 49 | BaseTableViewVC *secondVC = [[BaseTableViewVC alloc] init]; 50 | secondVC.cellTitle = @"衣服"; 51 | 52 | BaseTableViewVC *thirdVC = [[BaseTableViewVC alloc] init]; 53 | thirdVC.cellTitle = @"帽子"; 54 | return @[firstVC, secondVC, thirdVC]; 55 | } 56 | 57 | + (NSArray *)getArrayTitles { 58 | return @[@"鞋子", @"衣服", @"帽子"]; 59 | } 60 | 61 | #pragma mark - YNPageViewControllerDataSource 62 | - (UIScrollView *)pageViewController:(YNPageViewController *)pageViewController pageForIndex:(NSInteger)index { 63 | BaseTableViewVC *baseVC = pageViewController.controllersM[index]; 64 | return [baseVC tableView]; 65 | } 66 | 67 | @end 68 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/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 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/SDCycleScrollView/Lib/SDCycleScrollView/PageControl/TAAnimatedDotView.m: -------------------------------------------------------------------------------- 1 | // 2 | // TAAnimatedDotView.m 3 | // TAPageControl 4 | // 5 | // Created by Tanguy Aladenise on 2015-01-22. 6 | // Copyright (c) 2015 Tanguy Aladenise. All rights reserved. 7 | // 8 | 9 | #import "TAAnimatedDotView.h" 10 | 11 | static CGFloat const kAnimateDuration = 1; 12 | 13 | @implementation TAAnimatedDotView 14 | 15 | - (instancetype)init 16 | { 17 | self = [super init]; 18 | if (self) { 19 | [self initialization]; 20 | } 21 | 22 | return self; 23 | } 24 | 25 | 26 | - (id)initWithFrame:(CGRect)frame 27 | { 28 | self = [super initWithFrame:frame]; 29 | if (self) { 30 | [self initialization]; 31 | } 32 | return self; 33 | } 34 | 35 | 36 | - (id)initWithCoder:(NSCoder *)aDecoder 37 | { 38 | self = [super initWithCoder:aDecoder]; 39 | if (self) { 40 | [self initialization]; 41 | } 42 | 43 | return self; 44 | } 45 | 46 | - (void)setDotColor:(UIColor *)dotColor 47 | { 48 | _dotColor = dotColor; 49 | self.layer.borderColor = dotColor.CGColor; 50 | } 51 | 52 | - (void)initialization 53 | { 54 | _dotColor = [UIColor whiteColor]; 55 | self.backgroundColor = [UIColor clearColor]; 56 | self.layer.cornerRadius = CGRectGetWidth(self.frame) / 2; 57 | self.layer.borderColor = [UIColor whiteColor].CGColor; 58 | self.layer.borderWidth = 2; 59 | } 60 | 61 | 62 | - (void)changeActivityState:(BOOL)active 63 | { 64 | if (active) { 65 | [self animateToActiveState]; 66 | } else { 67 | [self animateToDeactiveState]; 68 | } 69 | } 70 | 71 | 72 | - (void)animateToActiveState 73 | { 74 | [UIView animateWithDuration:kAnimateDuration delay:0 usingSpringWithDamping:.5 initialSpringVelocity:-20 options:UIViewAnimationOptionCurveLinear animations:^{ 75 | self.backgroundColor = _dotColor; 76 | self.transform = CGAffineTransformMakeScale(1.4, 1.4); 77 | } completion:nil]; 78 | } 79 | 80 | - (void)animateToDeactiveState 81 | { 82 | [UIView animateWithDuration:kAnimateDuration delay:0 usingSpringWithDamping:.5 initialSpringVelocity:0 options:UIViewAnimationOptionCurveLinear animations:^{ 83 | self.backgroundColor = [UIColor clearColor]; 84 | self.transform = CGAffineTransformIdentity; 85 | } completion:nil]; 86 | } 87 | 88 | @end 89 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/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 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/SDCycleScrollView/Lib/SDCycleScrollView/PageControl/TAPageControl.h: -------------------------------------------------------------------------------- 1 | // 2 | // TAPageControl.h 3 | // TAPageControl 4 | // 5 | // Created by Tanguy Aladenise on 2015-01-21. 6 | // Copyright (c) 2015 Tanguy Aladenise. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol TAPageControlDelegate; 12 | 13 | 14 | @interface TAPageControl : UIControl 15 | 16 | 17 | /** 18 | * Dot view customization properties 19 | */ 20 | 21 | /** 22 | * The Class of your custom UIView, make sure to respect the TAAbstractDotView class. 23 | */ 24 | @property (nonatomic) Class dotViewClass; 25 | 26 | 27 | /** 28 | * UIImage to represent a dot. 29 | */ 30 | @property (nonatomic) UIImage *dotImage; 31 | 32 | 33 | /** 34 | * UIImage to represent current page dot. 35 | */ 36 | @property (nonatomic) UIImage *currentDotImage; 37 | 38 | 39 | /** 40 | * Dot size for dot views. Default is 8 by 8. 41 | */ 42 | @property (nonatomic) CGSize dotSize; 43 | 44 | 45 | @property (nonatomic, strong) UIColor *dotColor; 46 | 47 | /** 48 | * Spacing between two dot views. Default is 8. 49 | */ 50 | @property (nonatomic) NSInteger spacingBetweenDots; 51 | 52 | 53 | /** 54 | * Page control setup properties 55 | */ 56 | 57 | 58 | /** 59 | * Delegate for TAPageControl 60 | */ 61 | @property(nonatomic,assign) id delegate; 62 | 63 | 64 | /** 65 | * Number of pages for control. Default is 0. 66 | */ 67 | @property (nonatomic) NSInteger numberOfPages; 68 | 69 | 70 | /** 71 | * Current page on which control is active. Default is 0. 72 | */ 73 | @property (nonatomic) NSInteger currentPage; 74 | 75 | 76 | /** 77 | * Hide the control if there is only one page. Default is NO. 78 | */ 79 | @property (nonatomic) BOOL hidesForSinglePage; 80 | 81 | 82 | /** 83 | * Let the control know if should grow bigger by keeping center, or just get longer (right side expanding). By default YES. 84 | */ 85 | @property (nonatomic) BOOL shouldResizeFromCenter; 86 | 87 | 88 | /** 89 | * Return the minimum size required to display control properly for the given page count. 90 | * 91 | * @param pageCount Number of dots that will require display 92 | * 93 | * @return The CGSize being the minimum size required. 94 | */ 95 | - (CGSize)sizeForNumberOfPages:(NSInteger)pageCount; 96 | 97 | 98 | @end 99 | 100 | 101 | @protocol TAPageControlDelegate 102 | 103 | @optional 104 | - (void)TAPageControl:(TAPageControl *)pageControl didSelectPageAtIndex:(NSInteger)index; 105 | 106 | @end 107 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Src/Demos/SuspendTopPageVC/YNSuspendTopBaseTableViewVC.m: -------------------------------------------------------------------------------- 1 | // 2 | // YNSuspendTopBaseTableViewVC.m 3 | // YNPageViewController 4 | // 5 | // Created by ZYN on 2018/6/25. 6 | // Copyright © 2018年 yongneng. All rights reserved. 7 | // 8 | 9 | #import "YNSuspendTopBaseTableViewVC.h" 10 | #import "MJRefresh.h" 11 | #import "UIViewController+YNPageExtend.h" 12 | 13 | /// 开启刷新头部高度 14 | #define kOpenRefreshHeaderViewHeight 1 15 | 16 | @interface YNSuspendTopBaseTableViewVC () 17 | 18 | @end 19 | 20 | @implementation YNSuspendTopBaseTableViewVC 21 | 22 | - (void)viewWillAppear:(BOOL)animated { 23 | [super viewWillAppear:animated]; 24 | if (kOpenRefreshHeaderViewHeight) { 25 | if (self.tableView.mj_header.ignoredScrollViewContentInsetTop != self.yn_pageViewController.config.tempTopHeight) { 26 | [self addTableViewRefresh]; 27 | } 28 | } 29 | } 30 | 31 | - (void)viewDidLoad { 32 | [super viewDidLoad]; 33 | } 34 | 35 | /// 重写父类方法 添加 刷新方法 36 | - (void)addTableViewRefresh { 37 | __weak typeof (self) weakSelf = self; 38 | self.tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{ 39 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 40 | if (kOpenRefreshHeaderViewHeight) { 41 | [weakSelf suspendTopReloadHeaderViewHeight]; 42 | } else { 43 | [weakSelf.tableView.mj_header endRefreshing]; 44 | } 45 | }); 46 | }]; 47 | 48 | self.tableView.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{ 49 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 50 | [weakSelf.tableView.mj_footer endRefreshing]; 51 | }); 52 | }]; 53 | 54 | /// 需要设置下拉刷新控件UI的偏移位置 55 | self.tableView.mj_header.ignoredScrollViewContentInsetTop = self.yn_pageViewController.config.tempTopHeight; 56 | } 57 | 58 | #pragma mark - 悬浮Top刷新高度方法 59 | - (void)suspendTopReloadHeaderViewHeight { 60 | /// 布局高度 61 | CGFloat netWorkHeight = 900; 62 | __weak typeof (self) weakSelf = self; 63 | 64 | /// 结束刷新时 刷新 HeaderView高度 65 | [self.tableView.mj_header endRefreshingWithCompletionBlock:^{ 66 | YNPageViewController *VC = weakSelf.yn_pageViewController; 67 | if (VC.headerView.frame.size.height != netWorkHeight) { 68 | VC.headerView.frame = CGRectMake(0, 0, kSCREEN_WIDTH, netWorkHeight); 69 | [VC reloadSuspendHeaderViewFrame]; 70 | [weakSelf addTableViewRefresh]; 71 | } 72 | }]; 73 | } 74 | 75 | @end 76 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/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 -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/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 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/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 | @implementation UIScrollView (MJExtension) 14 | 15 | - (void)setMj_insetT:(CGFloat)mj_insetT 16 | { 17 | UIEdgeInsets inset = self.contentInset; 18 | inset.top = mj_insetT; 19 | self.contentInset = inset; 20 | } 21 | 22 | - (CGFloat)mj_insetT 23 | { 24 | return self.contentInset.top; 25 | } 26 | 27 | - (void)setMj_insetB:(CGFloat)mj_insetB 28 | { 29 | UIEdgeInsets inset = self.contentInset; 30 | inset.bottom = mj_insetB; 31 | self.contentInset = inset; 32 | } 33 | 34 | - (CGFloat)mj_insetB 35 | { 36 | return self.contentInset.bottom; 37 | } 38 | 39 | - (void)setMj_insetL:(CGFloat)mj_insetL 40 | { 41 | UIEdgeInsets inset = self.contentInset; 42 | inset.left = mj_insetL; 43 | self.contentInset = inset; 44 | } 45 | 46 | - (CGFloat)mj_insetL 47 | { 48 | return self.contentInset.left; 49 | } 50 | 51 | - (void)setMj_insetR:(CGFloat)mj_insetR 52 | { 53 | UIEdgeInsets inset = self.contentInset; 54 | inset.right = mj_insetR; 55 | self.contentInset = inset; 56 | } 57 | 58 | - (CGFloat)mj_insetR 59 | { 60 | return self.contentInset.right; 61 | } 62 | 63 | - (void)setMj_offsetX:(CGFloat)mj_offsetX 64 | { 65 | CGPoint offset = self.contentOffset; 66 | offset.x = mj_offsetX; 67 | self.contentOffset = offset; 68 | } 69 | 70 | - (CGFloat)mj_offsetX 71 | { 72 | return self.contentOffset.x; 73 | } 74 | 75 | - (void)setMj_offsetY:(CGFloat)mj_offsetY 76 | { 77 | CGPoint offset = self.contentOffset; 78 | offset.y = mj_offsetY; 79 | self.contentOffset = offset; 80 | } 81 | 82 | - (CGFloat)mj_offsetY 83 | { 84 | return self.contentOffset.y; 85 | } 86 | 87 | - (void)setMj_contentW:(CGFloat)mj_contentW 88 | { 89 | CGSize size = self.contentSize; 90 | size.width = mj_contentW; 91 | self.contentSize = size; 92 | } 93 | 94 | - (CGFloat)mj_contentW 95 | { 96 | return self.contentSize.width; 97 | } 98 | 99 | - (void)setMj_contentH:(CGFloat)mj_contentH 100 | { 101 | CGSize size = self.contentSize; 102 | size.height = mj_contentH; 103 | self.contentSize = size; 104 | } 105 | 106 | - (CGFloat)mj_contentH 107 | { 108 | return self.contentSize.height; 109 | } 110 | @end 111 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/SDCycleScrollView/Lib/SDCycleScrollView/UIView+SDExtension.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+SDExtension.m 3 | // SDRefreshView 4 | // 5 | // Created by aier on 15-2-23. 6 | // Copyright (c) 2015年 GSD. All rights reserved. 7 | // 8 | 9 | /* 10 | 11 | ********************************************************************************* 12 | * 13 | * 🌟🌟🌟 新建SDCycleScrollView交流QQ群:185534916 🌟🌟🌟 14 | * 15 | * 在您使用此自动轮播库的过程中如果出现bug请及时以以下任意一种方式联系我们,我们会及时修复bug并 16 | * 帮您解决问题。 17 | * 新浪微博:GSD_iOS 18 | * Email : gsdios@126.com 19 | * GitHub: https://github.com/gsdios 20 | * 21 | * 另(我的自动布局库SDAutoLayout): 22 | * 一行代码搞定自动布局!支持Cell和Tableview高度自适应,Label和ScrollView内容自适应,致力于 23 | * 做最简单易用的AutoLayout库。 24 | * 视频教程:http://www.letv.com/ptv/vplay/24038772.html 25 | * 用法示例:https://github.com/gsdios/SDAutoLayout/blob/master/README.md 26 | * GitHub:https://github.com/gsdios/SDAutoLayout 27 | ********************************************************************************* 28 | 29 | */ 30 | 31 | /* 32 | 33 | ********************************************************************************* 34 | * 35 | * 在您使用此自动轮播库的过程中如果出现bug请及时以以下任意一种方式联系我们,我们会及时修复bug并 36 | * 帮您解决问题。 37 | * 新浪微博:GSD_iOS 38 | * Email : gsdios@126.com 39 | * GitHub: https://github.com/gsdios 40 | * 41 | * 另(我的自动布局库SDAutoLayout): 42 | * 一行代码搞定自动布局!支持Cell和Tableview高度自适应,Label和ScrollView内容自适应,致力于 43 | * 做最简单易用的AutoLayout库。 44 | * 视频教程:http://www.letv.com/ptv/vplay/24038772.html 45 | * 用法示例:https://github.com/gsdios/SDAutoLayout/blob/master/README.md 46 | * GitHub:https://github.com/gsdios/SDAutoLayout 47 | ********************************************************************************* 48 | 49 | */ 50 | 51 | 52 | #import "UIView+SDExtension.h" 53 | 54 | @implementation UIView (SDExtension) 55 | 56 | - (CGFloat)sd_height 57 | { 58 | return self.frame.size.height; 59 | } 60 | 61 | - (void)setSd_height:(CGFloat)sd_height 62 | { 63 | CGRect temp = self.frame; 64 | temp.size.height = sd_height; 65 | self.frame = temp; 66 | } 67 | 68 | - (CGFloat)sd_width 69 | { 70 | return self.frame.size.width; 71 | } 72 | 73 | - (void)setSd_width:(CGFloat)sd_width 74 | { 75 | CGRect temp = self.frame; 76 | temp.size.width = sd_width; 77 | self.frame = temp; 78 | } 79 | 80 | 81 | - (CGFloat)sd_y 82 | { 83 | return self.frame.origin.y; 84 | } 85 | 86 | - (void)setSd_y:(CGFloat)sd_y 87 | { 88 | CGRect temp = self.frame; 89 | temp.origin.y = sd_y; 90 | self.frame = temp; 91 | } 92 | 93 | - (CGFloat)sd_x 94 | { 95 | return self.frame.origin.x; 96 | } 97 | 98 | - (void)setSd_x:(CGFloat)sd_x 99 | { 100 | CGRect temp = self.frame; 101 | temp.origin.x = sd_x; 102 | self.frame = temp; 103 | } 104 | 105 | 106 | 107 | @end 108 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/MLeaksFinder/UIViewController+MemoryLeak.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Tencent is pleased to support the open source community by making MLeaksFinder available. 3 | * 4 | * Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. 5 | * 6 | * Licensed under the BSD 3-Clause License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 7 | * 8 | * https://opensource.org/licenses/BSD-3-Clause 9 | * 10 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 11 | */ 12 | 13 | #import "UIViewController+MemoryLeak.h" 14 | #import "NSObject+MemoryLeak.h" 15 | #import 16 | 17 | #if _INTERNAL_MLF_ENABLED 18 | 19 | const void *const kHasBeenPoppedKey = &kHasBeenPoppedKey; 20 | 21 | @implementation UIViewController (MemoryLeak) 22 | 23 | + (void)load { 24 | static dispatch_once_t onceToken; 25 | dispatch_once(&onceToken, ^{ 26 | [self swizzleSEL:@selector(viewDidDisappear:) withSEL:@selector(swizzled_viewDidDisappear:)]; 27 | [self swizzleSEL:@selector(viewWillAppear:) withSEL:@selector(swizzled_viewWillAppear:)]; 28 | [self swizzleSEL:@selector(dismissViewControllerAnimated:completion:) withSEL:@selector(swizzled_dismissViewControllerAnimated:completion:)]; 29 | }); 30 | } 31 | 32 | - (void)swizzled_viewDidDisappear:(BOOL)animated { 33 | [self swizzled_viewDidDisappear:animated]; 34 | 35 | if ([objc_getAssociatedObject(self, kHasBeenPoppedKey) boolValue]) { 36 | [self willDealloc]; 37 | } 38 | } 39 | 40 | - (void)swizzled_viewWillAppear:(BOOL)animated { 41 | [self swizzled_viewWillAppear:animated]; 42 | 43 | objc_setAssociatedObject(self, kHasBeenPoppedKey, @(NO), OBJC_ASSOCIATION_RETAIN); 44 | } 45 | 46 | - (void)swizzled_dismissViewControllerAnimated:(BOOL)flag completion:(void (^)(void))completion { 47 | [self swizzled_dismissViewControllerAnimated:flag completion:completion]; 48 | 49 | UIViewController *dismissedViewController = self.presentedViewController; 50 | if (!dismissedViewController && self.presentingViewController) { 51 | dismissedViewController = self; 52 | } 53 | 54 | if (!dismissedViewController) return; 55 | 56 | [dismissedViewController willDealloc]; 57 | } 58 | 59 | - (BOOL)willDealloc { 60 | if (![super willDealloc]) { 61 | return NO; 62 | } 63 | 64 | [self willReleaseChildren:self.childViewControllers]; 65 | [self willReleaseChild:self.presentedViewController]; 66 | 67 | if (self.isViewLoaded) { 68 | [self willReleaseChild:self.view]; 69 | } 70 | 71 | return YES; 72 | } 73 | 74 | @end 75 | 76 | #endif 77 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Src/Demos/LoadPageVC/YNLoadPageVC.m: -------------------------------------------------------------------------------- 1 | // 2 | // LoadPageVC.m 3 | // YNPageViewController 4 | // 5 | // Created by ZYN on 2018/6/26. 6 | // Copyright © 2018年 yongneng. All rights reserved. 7 | // 8 | 9 | #import "YNLoadPageVC.h" 10 | #import "YNPageViewController.h" 11 | #import "YNSuspendCenterPageVC.h" 12 | #import "YNTopPageVC.h" 13 | #import "UIView+YNPageExtend.h" 14 | 15 | /// 是否隐藏导航条 16 | #define kHiddenNavigationBar 1 17 | 18 | @interface YNLoadPageVC () 19 | 20 | @property (nonatomic, strong) UIActivityIndicatorView *indicatorView; 21 | 22 | @end 23 | 24 | @implementation YNLoadPageVC 25 | 26 | - (void)viewWillAppear:(BOOL)animated { 27 | [super viewWillAppear:animated]; 28 | if (kHiddenNavigationBar) { 29 | [self.navigationController setNavigationBarHidden:YES animated:animated]; 30 | } 31 | } 32 | 33 | - (void)viewWillDisappear:(BOOL)animated { 34 | [super viewWillDisappear:animated]; 35 | if (kHiddenNavigationBar) { 36 | [self.navigationController setNavigationBarHidden:NO animated:animated]; 37 | } 38 | } 39 | 40 | - (void)viewDidLoad { 41 | [super viewDidLoad]; 42 | 43 | _indicatorView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray]; 44 | _indicatorView.frame = CGRectMake(0, 0, 80, 80); 45 | _indicatorView.center = self.view.center; 46 | [_indicatorView startAnimating]; 47 | 48 | /// 模拟器请求 49 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 50 | [self setupPageVC]; 51 | [_indicatorView stopAnimating]; 52 | [_indicatorView setHidden:YES]; 53 | }); 54 | [self.view addSubview:_indicatorView]; 55 | } 56 | 57 | - (void)setupPageVC { 58 | YNPageConfigration *configration = [YNPageConfigration defaultConfig]; 59 | configration.pageStyle = YNPageStyleSuspensionCenter; 60 | configration.headerViewCouldScale = YES; 61 | // configration.headerViewScaleMode = YNPageHeaderViewScaleModeCenter; 62 | configration.headerViewScaleMode = YNPageHeaderViewScaleModeTop; 63 | /// 控制tabbar 和 nav 64 | configration.showTabbar = NO; 65 | configration.showNavigation = NO; 66 | configration.scrollMenu = NO; 67 | configration.aligmentModeCenter = NO; 68 | configration.lineWidthEqualFontWidth = NO; 69 | configration.showBottomLine = YES; 70 | configration.suspenOffsetY = 64; 71 | /// 裁剪高度 72 | configration.cutOutHeight = 44; 73 | YNSuspendCenterPageVC *pageVC = [YNSuspendCenterPageVC suspendCenterPageVCWithConfig:configration]; 74 | 75 | /// 作为自控制器加入到当前控制器 76 | [pageVC addSelfToParentViewController:self]; 77 | 78 | /// 如果隐藏了导航条可以 适当改y值 79 | if (kHiddenNavigationBar) { 80 | // pageVC.view.yn_y = kYNPAGE_NAVHEIGHT; 81 | } 82 | 83 | /// 底部控件 84 | UIView *v = [[UIView alloc] initWithFrame:CGRectMake(0, kSCREEN_HEIGHT - 44, kSCREEN_WIDTH, 44)]; 85 | v.backgroundColor = [UIColor redColor]; 86 | [self.view addSubview:v]; 87 | } 88 | 89 | @end 90 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/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 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/SDWebImage/SDWebImageDownloaderOperation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageDownloader.h" 11 | #import "SDWebImageOperation.h" 12 | 13 | extern NSString *const SDWebImageDownloadStartNotification; 14 | extern NSString *const SDWebImageDownloadReceiveResponseNotification; 15 | extern NSString *const SDWebImageDownloadStopNotification; 16 | extern NSString *const SDWebImageDownloadFinishNotification; 17 | 18 | @interface SDWebImageDownloaderOperation : NSOperation 19 | 20 | /** 21 | * The request used by the operation's connection. 22 | */ 23 | @property (strong, nonatomic, readonly) NSURLRequest *request; 24 | 25 | 26 | @property (assign, nonatomic) BOOL shouldDecompressImages; 27 | 28 | /** 29 | * Whether the URL connection should consult the credential storage for authenticating the connection. `YES` by default. 30 | * 31 | * This is the value that is returned in the `NSURLConnectionDelegate` method `-connectionShouldUseCredentialStorage:`. 32 | */ 33 | @property (nonatomic, assign) BOOL shouldUseCredentialStorage; 34 | 35 | /** 36 | * The credential used for authentication challenges in `-connection:didReceiveAuthenticationChallenge:`. 37 | * 38 | * This will be overridden by any shared credentials that exist for the username or password of the request URL, if present. 39 | */ 40 | @property (nonatomic, strong) NSURLCredential *credential; 41 | 42 | /** 43 | * The SDWebImageDownloaderOptions for the receiver. 44 | */ 45 | @property (assign, nonatomic, readonly) SDWebImageDownloaderOptions options; 46 | 47 | /** 48 | * The expected size of data. 49 | */ 50 | @property (assign, nonatomic) NSInteger expectedSize; 51 | 52 | /** 53 | * The response returned by the operation's connection. 54 | */ 55 | @property (strong, nonatomic) NSURLResponse *response; 56 | 57 | /** 58 | * Initializes a `SDWebImageDownloaderOperation` object 59 | * 60 | * @see SDWebImageDownloaderOperation 61 | * 62 | * @param request the URL request 63 | * @param options downloader options 64 | * @param progressBlock the block executed when a new chunk of data arrives. 65 | * @note the progress block is executed on a background queue 66 | * @param completedBlock the block executed when the download is done. 67 | * @note the completed block is executed on the main queue for success. If errors are found, there is a chance the block will be executed on a background queue 68 | * @param cancelBlock the block executed if the download (operation) is cancelled 69 | * 70 | * @return the initialized instance 71 | */ 72 | - (id)initWithRequest:(NSURLRequest *)request 73 | options:(SDWebImageDownloaderOptions)options 74 | progress:(SDWebImageDownloaderProgressBlock)progressBlock 75 | completed:(SDWebImageDownloaderCompletedBlock)completedBlock 76 | cancelled:(SDWebImageNoParamsBlock)cancelBlock; 77 | 78 | @end 79 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![image](http://paxdlrdk7.bkt.clouddn.com/name3.png) 2 | 3 | 4 | ![](https://img.shields.io/badge/platform-iOS-red.svg) ![](https://img.shields.io/badge/language-Objective--C-orange.svg) ![](https://img.shields.io/cocoapods/v/YNPageViewController.svg?style=flat) 5 | ![](https://img.shields.io/badge/license-MIT%20License-brightgreen.svg) 6 | 7 | 8 | ## 集合了多种样式的嵌套页面布局(滑动库): 9 | ```本库是对```[YNPageScrollViewController](https://github.com/yongyuandouneng/YNPageScrollViewController) ```进行重构,优化代码,重写实现原理。其优点如下:``` 10 | 11 | | | 优点 | 12 | ----------|----------------- 13 | ✅ | 易于集成,多种样式以供选择,特斯拉(悬浮)布局等 14 | ✅ | 控制器生命周期完好无损、懒加载控制器 15 | ✅ | 高性能: 用双缓存机制让界面只存在一个控制器 16 | ✅ | 支持UISollView、UITableView、UICollectionView、 17 | ✅ | 支持列表拓展tableFooterView、tableHeaderView、 18 | ✅ | 支持CollectionView的瀑布流、FlowLayout修改的布局 19 | ✅ | 支持头部拉伸放大特效、还有其他部分拓展的API 20 | 21 | 22 | ## Demo效果图 23 | 24 | ![image](http://paxdlrdk7.bkt.clouddn.com/YNPageViewControllerGif.gif) 25 | 26 | 27 | ## Requirements 要求 28 | * iOS 8+ 29 | * Xcode 8+ 30 | 31 | ## Installation 安装 32 | #### 1.手动安装: 33 | - `下载DEMO后,将子文件夹Libs/YNPageViewController拖入到项目中, 导入头文件YNPageViewController.h开始使用.` 34 | 35 | #### 2.CocoaPods安装: 36 | 37 | - `一、可以直接在项目Podfile 文件中 pod 'YNPageViewController'` 38 | 39 | - `二、先pod search YNPageViewController 搜索一下` 40 | - `如果发现pod search YNPageViewController 不是最新版本,在终端执行pod setup命令更新本地spec镜像缓存,重新搜索` 41 | - `搜索不到则执行1.pod repo update 2.rm ~/Library/Caches/CocoaPods/search_index.json` 42 | - `在Podfile文件中用 pod 'YNPageViewController'` 43 | 44 | ## 使用方法 45 | ``` 46 | 1.新建控制器继承YNPageViewController 实现 YNPageViewControllerDataSource, YNPageViewControllerDelegate, delegate可选实现 47 | 2.创建YNPageConfigration类进行配置信息 48 | 3.创建实例方法 49 | + (instancetype)pageViewControllerWithControllers:(NSArray *)controllers 50 | titles:(NSArray *)titles 51 | config:(YNPageConfigration *)config; 52 | 4.具体使用方法可以查看Demos教程。 53 | ``` 54 | ## 使用悬浮样式需要注意: 55 | ``` 56 | • SuspensionTop || SuspensionCenter 需要填充cell占位高度,不支持 [mj_header beginRefresing] 57 | 58 | • headerView高度较小建议使用 SuspensionTop,高度比较大建议使用 SuspensionCenter 59 | 60 | • SuspensionTopPause不需要填充占位cell高度,只是头部上拉时停顿。可实现QQ联系人效果。 61 | 62 | ``` 63 | ## CocoaPods更新日志 64 | 65 | ``` 66 | • 2018-12-13 (tag 0.2.5): 添加数据源获取列表高度,默认是控制器高度 67 | 68 | • 2018-07-27 (tag 0.1.3 ~ 0.1.7): 添加reloadData方法、自定义缓存Key可配置相同title、优化QQ联系人悬浮布局 69 | 70 | • 2018-07-27 (tag 0.1.3): 新增置顶API, 插入、删除、调整顺序控制器的API 71 | 72 | • 2018-07-23 (tag 0.1.2): 新增可以添加 ScrollMenu ButtonItem image 73 | 74 | • 2018-07-14 (tag 0.1.0): 修复头部视图可侧滑返回 75 | 76 | • 2018-07-14 (tag 0.0.9): 新增SuspensionTopPause样式和示例 (QQ联系人Tab布局) 77 | 78 | • 2018-07-12 (tag 0.0.7): 解决 SectionHeader 挡住 ScrollMenu 的问题 79 | 80 | • 2018-07-09 (tag 0.0.5): 新增悬浮Menu 偏移量 81 | 82 | • 2018-07-03 (tag 0.0.3): 新增刷新悬浮头部视图高度API 83 | 84 | • 2018-06-29 (tag 0.0.2): 85 | 1.添加设置菜单栏选择字体大小属性 86 | 2.修复拉倒底部点击菜单栏下掉问题 87 | 88 | • 2018-06-27 (tag 0.0.1): 发布Pods v0.0.1 89 | ``` 90 | ## 联系方式: 91 | 92 | * Email : 1003580893@qq.com 93 | * QQ群 : 538133294 94 | * Blog : https://www.yongyuandouneng.com 95 | 96 | ![YN-iOS-交流群群二维码](http://paxdlrdk7.bkt.clouddn.com/IMG_1052.JPG) 97 | 98 | ## 许可证 99 | YNPageViewController 使用 MIT 许可证,详情见 LICENSE 文件。 100 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/SDCycleScrollView/Lib/SDCycleScrollView/SDCollectionViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // SDCollectionViewCell.m 3 | // SDCycleScrollView 4 | // 5 | // Created by aier on 15-3-22. 6 | // Copyright (c) 2015年 GSD. All rights reserved. 7 | // 8 | 9 | 10 | /* 11 | 12 | ********************************************************************************* 13 | * 14 | * 🌟🌟🌟 新建SDCycleScrollView交流QQ群:185534916 🌟🌟🌟 15 | * 16 | * 在您使用此自动轮播库的过程中如果出现bug请及时以以下任意一种方式联系我们,我们会及时修复bug并 17 | * 帮您解决问题。 18 | * 新浪微博:GSD_iOS 19 | * Email : gsdios@126.com 20 | * GitHub: https://github.com/gsdios 21 | * 22 | * 另(我的自动布局库SDAutoLayout): 23 | * 一行代码搞定自动布局!支持Cell和Tableview高度自适应,Label和ScrollView内容自适应,致力于 24 | * 做最简单易用的AutoLayout库。 25 | * 视频教程:http://www.letv.com/ptv/vplay/24038772.html 26 | * 用法示例:https://github.com/gsdios/SDAutoLayout/blob/master/README.md 27 | * GitHub:https://github.com/gsdios/SDAutoLayout 28 | ********************************************************************************* 29 | 30 | */ 31 | 32 | 33 | #import "SDCollectionViewCell.h" 34 | #import "UIView+SDExtension.h" 35 | 36 | @implementation SDCollectionViewCell 37 | { 38 | __weak UILabel *_titleLabel; 39 | } 40 | 41 | 42 | - (instancetype)initWithFrame:(CGRect)frame 43 | { 44 | if (self = [super initWithFrame:frame]) { 45 | [self setupImageView]; 46 | [self setupTitleLabel]; 47 | } 48 | 49 | return self; 50 | } 51 | 52 | - (void)setTitleLabelBackgroundColor:(UIColor *)titleLabelBackgroundColor 53 | { 54 | _titleLabelBackgroundColor = titleLabelBackgroundColor; 55 | _titleLabel.backgroundColor = titleLabelBackgroundColor; 56 | } 57 | 58 | - (void)setTitleLabelTextColor:(UIColor *)titleLabelTextColor 59 | { 60 | _titleLabelTextColor = titleLabelTextColor; 61 | _titleLabel.textColor = titleLabelTextColor; 62 | } 63 | 64 | - (void)setTitleLabelTextFont:(UIFont *)titleLabelTextFont 65 | { 66 | _titleLabelTextFont = titleLabelTextFont; 67 | _titleLabel.font = titleLabelTextFont; 68 | } 69 | 70 | - (void)setupImageView 71 | { 72 | UIImageView *imageView = [[UIImageView alloc] init]; 73 | _imageView = imageView; 74 | [self.contentView addSubview:imageView]; 75 | } 76 | 77 | - (void)setupTitleLabel 78 | { 79 | UILabel *titleLabel = [[UILabel alloc] init]; 80 | _titleLabel = titleLabel; 81 | _titleLabel.hidden = YES; 82 | [self.contentView addSubview:titleLabel]; 83 | } 84 | 85 | - (void)setTitle:(NSString *)title 86 | { 87 | _title = [title copy]; 88 | _titleLabel.text = [NSString stringWithFormat:@" %@", title]; 89 | if (_titleLabel.hidden) { 90 | _titleLabel.hidden = NO; 91 | } 92 | } 93 | 94 | 95 | - (void)layoutSubviews 96 | { 97 | [super layoutSubviews]; 98 | 99 | if (self.onlyDisplayText) { 100 | _titleLabel.frame = self.bounds; 101 | } else { 102 | _imageView.frame = self.bounds; 103 | CGFloat titleLabelW = self.sd_width; 104 | CGFloat titleLabelH = _titleLabelHeight; 105 | CGFloat titleLabelX = 0; 106 | CGFloat titleLabelY = self.sd_height - titleLabelH; 107 | _titleLabel.frame = CGRectMake(titleLabelX, titleLabelY, titleLabelW, titleLabelH); 108 | } 109 | } 110 | 111 | @end 112 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/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 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Src/Demos/BaseVC/BasePageViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // BasePageViewController.m 3 | // YNPageViewController 4 | // 5 | // Created by ZYN on 2018/7/27. 6 | // Copyright © 2018年 yongneng. All rights reserved. 7 | // 中间层 - 为了演示API功能操作 8 | 9 | #import "BasePageViewController.h" 10 | #import "BaseTableViewVC.h" 11 | #import "UIView+YNPageExtend.h" 12 | 13 | @interface BasePageViewController () 14 | 15 | @end 16 | 17 | @implementation BasePageViewController 18 | 19 | #pragma mark - Life Cycle 20 | - (void)viewDidLoad { 21 | [super viewDidLoad]; 22 | 23 | self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] 24 | initWithTitle:@"功能操作" 25 | style:UIBarButtonItemStylePlain 26 | target:self action:@selector(rightButtonOnClick:event:)]; 27 | } 28 | 29 | - (void)viewWillAppear:(BOOL)animated { 30 | [super viewWillAppear:animated]; 31 | NSLog(@"--%@--%@", [self class], NSStringFromSelector(_cmd)); 32 | } 33 | 34 | - (void)viewDidAppear:(BOOL)animated { 35 | [super viewDidAppear:animated]; 36 | NSLog(@"--%@--%@", [self class], NSStringFromSelector(_cmd)); 37 | } 38 | 39 | - (void)viewWillDisappear:(BOOL)animated { 40 | [super viewWillDisappear:animated]; 41 | NSLog(@"--%@--%@", [self class], NSStringFromSelector(_cmd)); 42 | } 43 | 44 | - (void)viewDidDisappear:(BOOL)animated { 45 | [super viewDidDisappear:animated]; 46 | NSLog(@"--%@--%@", [self class], NSStringFromSelector(_cmd)); 47 | } 48 | 49 | #pragma mark - --Button Event Response 50 | - (void)rightButtonOnClick:(UIBarButtonItem *)item event:(UIEvent *)event { 51 | __weak typeof(self) weakSelf = self; 52 | [FTPopOverMenu showFromEvent:event withMenuArray:@[@"滚动到顶部", 53 | @"更新菜单栏标题", 54 | @"添加页面", 55 | @"删除页面", 56 | @"调整标题顺序", 57 | @"reload", 58 | @"刷新头部高度"] doneBlock:^(NSInteger selectedIndex) { 59 | switch (selectedIndex) { 60 | case 0: { 61 | [weakSelf scrollToTop:YES]; 62 | } 63 | break; 64 | case 1: { 65 | // [self updateMenuItemTitle:@"更新的标题" index:0]; 66 | [weakSelf updateMenuItemTitles:@[@"足球", @"棒球", @"篮球"]]; 67 | } 68 | break; 69 | case 2: { 70 | BaseTableViewVC *vc_1 = [[BaseTableViewVC alloc] init]; 71 | vc_1.cellTitle = @"插入页新面"; 72 | [weakSelf insertPageChildControllersWithTitles:@[@"插入页面"] controllers:@[vc_1] index:100]; 73 | } 74 | break; 75 | case 3: { 76 | // [self removePageControllerWithTitle:@"帽子"]; 77 | [weakSelf removePageControllerWithIndex:0]; 78 | } 79 | break; 80 | case 4: { 81 | [weakSelf replaceTitlesArrayForSort:@[@"帽子", @"衣服", @"鞋子"]]; 82 | } 83 | break; 84 | case 5: { 85 | weakSelf.titlesM = @[@"刷新页面", @"棒球", @"篮球"].mutableCopy; 86 | weakSelf.config.menuHeight = 100; 87 | weakSelf.pageIndex = 0; 88 | [weakSelf reloadData]; 89 | } 90 | break; 91 | case 6: { 92 | weakSelf.headerView.yn_height = 300; 93 | [weakSelf reloadData]; 94 | } 95 | break; 96 | } 97 | } dismissBlock:nil]; 98 | } 99 | 100 | @end 101 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/SDWebImage/UIImage+MultiFormat.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+MultiFormat.m 3 | // SDWebImage 4 | // 5 | // Created by Olivier Poitrey on 07/06/13. 6 | // Copyright (c) 2013 Dailymotion. All rights reserved. 7 | // 8 | 9 | #import "UIImage+MultiFormat.h" 10 | #import "UIImage+GIF.h" 11 | #import "NSData+ImageContentType.h" 12 | #import 13 | 14 | #ifdef SD_WEBP 15 | #import "UIImage+WebP.h" 16 | #endif 17 | 18 | @implementation UIImage (MultiFormat) 19 | 20 | + (UIImage *)sd_imageWithData:(NSData *)data { 21 | if (!data) { 22 | return nil; 23 | } 24 | 25 | UIImage *image; 26 | NSString *imageContentType = [NSData sd_contentTypeForImageData:data]; 27 | if ([imageContentType isEqualToString:@"image/gif"]) { 28 | image = [UIImage sd_animatedGIFWithData:data]; 29 | } 30 | #ifdef SD_WEBP 31 | else if ([imageContentType isEqualToString:@"image/webp"]) 32 | { 33 | image = [UIImage sd_imageWithWebPData:data]; 34 | } 35 | #endif 36 | else { 37 | image = [[UIImage alloc] initWithData:data]; 38 | UIImageOrientation orientation = [self sd_imageOrientationFromImageData:data]; 39 | if (orientation != UIImageOrientationUp) { 40 | image = [UIImage imageWithCGImage:image.CGImage 41 | scale:image.scale 42 | orientation:orientation]; 43 | } 44 | } 45 | 46 | 47 | return image; 48 | } 49 | 50 | 51 | +(UIImageOrientation)sd_imageOrientationFromImageData:(NSData *)imageData { 52 | UIImageOrientation result = UIImageOrientationUp; 53 | CGImageSourceRef imageSource = CGImageSourceCreateWithData((__bridge CFDataRef)imageData, NULL); 54 | if (imageSource) { 55 | CFDictionaryRef properties = CGImageSourceCopyPropertiesAtIndex(imageSource, 0, NULL); 56 | if (properties) { 57 | CFTypeRef val; 58 | int exifOrientation; 59 | val = CFDictionaryGetValue(properties, kCGImagePropertyOrientation); 60 | if (val) { 61 | CFNumberGetValue(val, kCFNumberIntType, &exifOrientation); 62 | result = [self sd_exifOrientationToiOSOrientation:exifOrientation]; 63 | } // else - if it's not set it remains at up 64 | CFRelease((CFTypeRef) properties); 65 | } else { 66 | //NSLog(@"NO PROPERTIES, FAIL"); 67 | } 68 | CFRelease(imageSource); 69 | } 70 | return result; 71 | } 72 | 73 | #pragma mark EXIF orientation tag converter 74 | // Convert an EXIF image orientation to an iOS one. 75 | // reference see here: http://sylvana.net/jpegcrop/exif_orientation.html 76 | + (UIImageOrientation) sd_exifOrientationToiOSOrientation:(int)exifOrientation { 77 | UIImageOrientation orientation = UIImageOrientationUp; 78 | switch (exifOrientation) { 79 | case 1: 80 | orientation = UIImageOrientationUp; 81 | break; 82 | 83 | case 3: 84 | orientation = UIImageOrientationDown; 85 | break; 86 | 87 | case 8: 88 | orientation = UIImageOrientationLeft; 89 | break; 90 | 91 | case 6: 92 | orientation = UIImageOrientationRight; 93 | break; 94 | 95 | case 2: 96 | orientation = UIImageOrientationUpMirrored; 97 | break; 98 | 99 | case 4: 100 | orientation = UIImageOrientationDownMirrored; 101 | break; 102 | 103 | case 5: 104 | orientation = UIImageOrientationLeftMirrored; 105 | break; 106 | 107 | case 7: 108 | orientation = UIImageOrientationRightMirrored; 109 | break; 110 | default: 111 | break; 112 | } 113 | return orientation; 114 | } 115 | 116 | 117 | 118 | @end 119 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/YNPageViewController/Category/UIScrollView+YNPageExtend.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIScrollView+YNPageExtend.m 3 | // YNPageViewController 4 | // 5 | // Created by ZYN on 2018/5/8. 6 | // Copyright © 2018年 yongneng. All rights reserved. 7 | // 8 | 9 | #import "UIScrollView+YNPageExtend.h" 10 | #import 11 | 12 | @implementation UIScrollView (YNPageExtend) 13 | 14 | + (void)load { 15 | static dispatch_once_t onceToken; 16 | dispatch_once(&onceToken, ^{ 17 | [self swizzleInstanceMethod:NSSelectorFromString(@"_notifyDidScroll") withMethod:@selector(yn_scrollViewDidScrollView)]; 18 | [self swizzleInstanceMethod:NSSelectorFromString(@"_scrollViewWillBeginDragging") withMethod:@selector(yn_scrollViewWillBeginDragging)]; 19 | }); 20 | } 21 | 22 | - (void)yn_scrollViewDidScrollView { 23 | [self yn_scrollViewDidScrollView]; 24 | if (self.yn_observerDidScrollView && self.yn_pageScrollViewDidScrollView) { 25 | self.yn_pageScrollViewDidScrollView(self); 26 | } 27 | } 28 | 29 | - (void)yn_scrollViewWillBeginDragging { 30 | [self yn_scrollViewWillBeginDragging]; 31 | if (self.yn_observerDidScrollView && self.yn_pageScrollViewBeginDragginScrollView) { 32 | self.yn_pageScrollViewBeginDragginScrollView(self); 33 | } 34 | } 35 | 36 | #pragma mark - Getter - Setter 37 | 38 | - (BOOL)yn_observerDidScrollView { 39 | return [objc_getAssociatedObject(self, _cmd) boolValue]; 40 | } 41 | 42 | - (void)setYn_observerDidScrollView:(BOOL)yn_observerDidScrollView { 43 | objc_setAssociatedObject(self, @selector(yn_observerDidScrollView), @(yn_observerDidScrollView), OBJC_ASSOCIATION_ASSIGN); 44 | } 45 | 46 | - (YNPageScrollViewDidScrollView)yn_pageScrollViewDidScrollView { 47 | return objc_getAssociatedObject(self, _cmd); 48 | } 49 | 50 | - (void)setYn_pageScrollViewDidScrollView:(YNPageScrollViewDidScrollView)yn_pageScrollViewDidScrollView { 51 | objc_setAssociatedObject(self, @selector(yn_pageScrollViewDidScrollView), yn_pageScrollViewDidScrollView, OBJC_ASSOCIATION_COPY_NONATOMIC); 52 | } 53 | 54 | - (YNPageScrollViewBeginDragginScrollView)yn_pageScrollViewBeginDragginScrollView { 55 | return objc_getAssociatedObject(self, _cmd); 56 | } 57 | 58 | - (void)setYn_pageScrollViewBeginDragginScrollView:(YNPageScrollViewBeginDragginScrollView)yn_pageScrollViewBeginDragginScrollView { 59 | objc_setAssociatedObject(self, @selector(yn_pageScrollViewBeginDragginScrollView), yn_pageScrollViewBeginDragginScrollView, OBJC_ASSOCIATION_COPY_NONATOMIC); 60 | } 61 | 62 | #pragma amrk - Swizzle 63 | + (void)swizzleInstanceMethod:(SEL)origSelector withMethod:(SEL)newSelector { 64 | Class cls = [self class]; 65 | Method originalMethod = class_getInstanceMethod(cls, origSelector); 66 | Method swizzledMethod = class_getInstanceMethod(cls, newSelector); 67 | if (class_addMethod(cls, 68 | origSelector, 69 | method_getImplementation(swizzledMethod), 70 | method_getTypeEncoding(swizzledMethod)) ) { 71 | class_replaceMethod(cls, 72 | newSelector, 73 | method_getImplementation(originalMethod), 74 | method_getTypeEncoding(originalMethod)); 75 | 76 | } else { 77 | class_replaceMethod(cls, 78 | newSelector, 79 | class_replaceMethod(cls, 80 | origSelector, 81 | method_getImplementation(swizzledMethod), 82 | method_getTypeEncoding(swizzledMethod)), 83 | method_getTypeEncoding(originalMethod)); 84 | } 85 | } 86 | 87 | - (void)yn_setContentOffsetY:(CGFloat)offsetY { 88 | if (self.contentOffset.y != offsetY) { 89 | self.contentOffset = CGPointMake(0, offsetY); 90 | } 91 | } 92 | 93 | @end 94 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/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)(); 33 | /** 开始刷新后的回调(进入刷新状态后的回调) */ 34 | typedef void (^MJRefreshComponentbeginRefreshingCompletionBlock)(); 35 | /** 结束刷新后的回调 */ 36 | typedef void (^MJRefreshComponentEndRefreshingCompletionBlock)(); 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 (^)())completionBlock; 63 | /** 开始刷新后的回调(进入刷新状态后的回调) */ 64 | @property (copy, nonatomic) MJRefreshComponentbeginRefreshingCompletionBlock beginRefreshingCompletionBlock; 65 | /** 结束刷新的回调 */ 66 | @property (copy, nonatomic) MJRefreshComponentEndRefreshingCompletionBlock endRefreshingCompletionBlock; 67 | /** 结束刷新状态 */ 68 | - (void)endRefreshing; 69 | - (void)endRefreshingWithCompletionBlock:(void (^)())completionBlock; 70 | /** 是否正在刷新 */ 71 | - (BOOL)isRefreshing; 72 | /** 刷新状态 一般交给子类内部实现 */ 73 | @property (assign, nonatomic) MJRefreshState state; 74 | 75 | #pragma mark - 交给子类去访问 76 | /** 记录scrollView刚开始的inset */ 77 | @property (assign, nonatomic, readonly) UIEdgeInsets scrollViewOriginalInset; 78 | /** 父控件 */ 79 | @property (weak, nonatomic, readonly) UIScrollView *scrollView; 80 | 81 | #pragma mark - 交给子类们去实现 82 | /** 初始化 */ 83 | - (void)prepare NS_REQUIRES_SUPER; 84 | /** 摆放子控件frame */ 85 | - (void)placeSubviews NS_REQUIRES_SUPER; 86 | /** 当scrollView的contentOffset发生改变的时候调用 */ 87 | - (void)scrollViewContentOffsetDidChange:(NSDictionary *)change NS_REQUIRES_SUPER; 88 | /** 当scrollView的contentSize发生改变的时候调用 */ 89 | - (void)scrollViewContentSizeDidChange:(NSDictionary *)change NS_REQUIRES_SUPER; 90 | /** 当scrollView的拖拽状态发生改变的时候调用 */ 91 | - (void)scrollViewPanStateDidChange:(NSDictionary *)change NS_REQUIRES_SUPER; 92 | 93 | 94 | #pragma mark - 其他 95 | /** 拉拽的百分比(交给子类重写) */ 96 | @property (assign, nonatomic) CGFloat pullingPercent; 97 | /** 根据拖拽比例自动切换透明度 */ 98 | @property (assign, nonatomic, getter=isAutoChangeAlpha) BOOL autoChangeAlpha MJRefreshDeprecated("请使用automaticallyChangeAlpha属性"); 99 | /** 根据拖拽比例自动切换透明度 */ 100 | @property (assign, nonatomic, getter=isAutomaticallyChangeAlpha) BOOL automaticallyChangeAlpha; 101 | @end 102 | 103 | @interface UILabel(MJRefresh) 104 | + (instancetype)mj_label; 105 | - (CGFloat)mj_textWith; 106 | @end 107 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/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 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Src/Demos/TestPageVC/YNTestBaseVC.m: -------------------------------------------------------------------------------- 1 | // 2 | // YNTestBaseVC.m 3 | // YNPageViewController 4 | // 5 | // Created by ZYN on 2018/5/8. 6 | // Copyright © 2018年 yongneng. All rights reserved. 7 | // 8 | 9 | #import "YNTestBaseVC.h" 10 | #import "MJRefresh.h" 11 | #import "YNPageTableView.h" 12 | 13 | @interface YNTestBaseVC () 14 | 15 | @end 16 | 17 | @implementation YNTestBaseVC 18 | 19 | - (void)viewDidLoad { 20 | [super viewDidLoad]; 21 | UIView *headerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kSCREEN_WIDTH, 200)]; 22 | headerView.backgroundColor = [UIColor greenColor]; 23 | [self.view addSubview:self.tableView]; 24 | } 25 | 26 | - (void)viewWillAppear:(BOOL)animated { 27 | [super viewWillAppear:animated]; 28 | NSLog(@"--%@--%@", [self class], NSStringFromSelector(_cmd)); 29 | } 30 | 31 | - (void)viewDidAppear:(BOOL)animated { 32 | [super viewDidAppear:animated]; 33 | NSLog(@"--%@--%@", [self class], NSStringFromSelector(_cmd)); 34 | } 35 | 36 | - (void)viewWillDisappear:(BOOL)animated { 37 | [super viewWillDisappear:animated]; 38 | NSLog(@"--%@--%@", [self class], NSStringFromSelector(_cmd)); 39 | } 40 | 41 | - (void)viewDidDisappear:(BOOL)animated { 42 | [super viewDidDisappear:animated]; 43 | NSLog(@"--%@--%@", [self class], NSStringFromSelector(_cmd)); 44 | } 45 | 46 | - (void)addTableViewRefresh { 47 | __weak typeof (self) weakSelf = self; 48 | self.tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{ 49 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 50 | [weakSelf.tableView.mj_header endRefreshing]; 51 | }); 52 | }]; 53 | 54 | self.tableView.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{ 55 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 56 | [weakSelf.tableView.mj_footer endRefreshing]; 57 | }); 58 | }]; 59 | } 60 | 61 | #pragma mark - UITableViewDelegate UITableViewDataSource 62 | - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { 63 | return 0.00001; 64 | } 65 | 66 | - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { 67 | return [UIView new]; 68 | } 69 | 70 | - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section { 71 | return 0.00001; 72 | } 73 | 74 | - (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section { 75 | return [UIView new]; 76 | } 77 | 78 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { 79 | return 1; 80 | } 81 | 82 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 83 | return 5; 84 | } 85 | 86 | - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { 87 | return 44; 88 | } 89 | 90 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 91 | static NSString *identifier = @"identifier"; 92 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier]; 93 | if (!cell) { 94 | cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:identifier]; 95 | } 96 | cell.textLabel.text = [NSString stringWithFormat:@"测试 section: %zd row:%zd", indexPath.section, indexPath.row]; 97 | return cell; 98 | } 99 | 100 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 101 | 102 | } 103 | 104 | - (UITableView *)tableView { 105 | if (!_tableView) { 106 | _tableView = [[YNPageTableView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height) style:UITableViewStylePlain]; 107 | _tableView.delegate = self; 108 | _tableView.dataSource = self; 109 | } 110 | return _tableView; 111 | } 112 | 113 | @end 114 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Src/Demos/SuspendTopPageVC/YNSuspendTopPageVC.m: -------------------------------------------------------------------------------- 1 | // 2 | // SuspendTopPageVC.m 3 | // YNPageViewController 4 | // 5 | // Created by ZYN on 2018/6/22. 6 | // Copyright © 2018年 yongneng. All rights reserved. 7 | // 8 | 9 | #import "YNSuspendTopPageVC.h" 10 | #import "SDCycleScrollView.h" 11 | #import "BaseTableViewVC.h" 12 | #import "YNSuspendTopBaseTableViewVC.h" 13 | 14 | @interface YNSuspendTopPageVC () 15 | 16 | @property (nonatomic, copy) NSArray *imagesURLs; 17 | 18 | @end 19 | 20 | @implementation YNSuspendTopPageVC 21 | 22 | - (void)viewDidLoad { 23 | [super viewDidLoad]; 24 | } 25 | 26 | #pragma mark - Public Function 27 | 28 | + (instancetype)suspendTopPageVC { 29 | YNPageConfigration *configration = [YNPageConfigration defaultConfig]; 30 | configration.pageStyle = YNPageStyleSuspensionTop; 31 | configration.headerViewCouldScale = YES; 32 | configration.showTabbar = NO; 33 | configration.showNavigation = YES; 34 | configration.scrollMenu = NO; 35 | configration.aligmentModeCenter = NO; 36 | configration.lineWidthEqualFontWidth = NO; 37 | configration.showBottomLine = YES; 38 | 39 | YNSuspendTopPageVC *vc = [YNSuspendTopPageVC pageViewControllerWithControllers:[self getArrayVCs] 40 | titles:[self getArrayTitles] 41 | config:configration]; 42 | vc.dataSource = vc; 43 | vc.delegate = vc; 44 | 45 | UIView *headerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kSCREEN_WIDTH, kSCREEN_HEIGHT)]; 46 | headerView.layer.contents = (id)[UIImage imageNamed:@"mine_header_bg"].CGImage; 47 | /// 轮播图 48 | SDCycleScrollView *autoScrollView = [SDCycleScrollView cycleScrollViewWithFrame:CGRectMake(0, 0, kSCREEN_WIDTH, 200) imageURLStringsGroup:vc.imagesURLs]; 49 | autoScrollView.delegate = vc; 50 | 51 | // vc.headerView = autoScrollView; 52 | 53 | vc.headerView = headerView; 54 | // 指定默认选择index 页面 55 | // vc.pageIndex = 0; 56 | return vc; 57 | } 58 | 59 | + (NSArray *)getArrayVCs { 60 | YNSuspendTopBaseTableViewVC *firstVC = [[YNSuspendTopBaseTableViewVC alloc] init]; 61 | firstVC.cellTitle = @"鞋子"; 62 | 63 | YNSuspendTopBaseTableViewVC *secondVC = [[YNSuspendTopBaseTableViewVC alloc] init]; 64 | secondVC.cellTitle = @"衣服"; 65 | 66 | YNSuspendTopBaseTableViewVC *thirdVC = [[YNSuspendTopBaseTableViewVC alloc] init]; 67 | return @[firstVC, secondVC, thirdVC]; 68 | } 69 | 70 | + (NSArray *)getArrayTitles { 71 | return @[@"鞋子", @"衣服", @"帽子"]; 72 | } 73 | 74 | #pragma mark - Getter and Setter 75 | - (NSArray *)imagesURLs { 76 | if (!_imagesURLs) { 77 | _imagesURLs = @[ 78 | @"https://ss2.baidu.com/-vo3dSag_xI4khGko9WTAnF6hhy/super/whfpf%3D425%2C260%2C50/sign=a4b3d7085dee3d6d2293d48b252b5910/0e2442a7d933c89524cd5cd4d51373f0830200ea.jpg", 79 | @"https://ss0.baidu.com/-Po3dSag_xI4khGko9WTAnF6hhy/super/whfpf%3D425%2C260%2C50/sign=a41eb338dd33c895a62bcb3bb72e47c2/5fdf8db1cb134954a2192ccb524e9258d1094a1e.jpg", 80 | @"http://c.hiphotos.baidu.com/image/w%3D400/sign=c2318ff84334970a4773112fa5c8d1c0/b7fd5266d0160924c1fae5ccd60735fae7cd340d.jpg"]; 81 | } 82 | return _imagesURLs; 83 | } 84 | 85 | #pragma mark - YNPageViewControllerDataSource 86 | - (UIScrollView *)pageViewController:(YNPageViewController *)pageViewController pageForIndex:(NSInteger)index { 87 | YNSuspendTopBaseTableViewVC *vc = pageViewController.controllersM[index]; 88 | return [vc tableView]; 89 | } 90 | 91 | #pragma mark - YNPageViewControllerDelegate 92 | - (void)pageViewController:(YNPageViewController *)pageViewController 93 | contentOffsetY:(CGFloat)contentOffset 94 | progress:(CGFloat)progress { 95 | // NSLog(@"--- contentOffset = %f, progress = %f", contentOffset, progress); 96 | } 97 | 98 | @end 99 | 100 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/SDWebImage/SDWebImageDecoder.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * Created by james on 9/28/11. 6 | * 7 | * For the full copyright and license information, please view the LICENSE 8 | * file that was distributed with this source code. 9 | */ 10 | 11 | #import "SDWebImageDecoder.h" 12 | 13 | @implementation UIImage (ForceDecode) 14 | 15 | + (UIImage *)decodedImageWithImage:(UIImage *)image { 16 | // while downloading huge amount of images 17 | // autorelease the bitmap context 18 | // and all vars to help system to free memory 19 | // when there are memory warning. 20 | // on iOS7, do not forget to call 21 | // [[SDImageCache sharedImageCache] clearMemory]; 22 | 23 | if (image == nil) { // Prevent "CGBitmapContextCreateImage: invalid context 0x0" error 24 | return nil; 25 | } 26 | 27 | @autoreleasepool{ 28 | // do not decode animated images 29 | if (image.images != nil) { 30 | return image; 31 | } 32 | 33 | CGImageRef imageRef = image.CGImage; 34 | 35 | CGImageAlphaInfo alpha = CGImageGetAlphaInfo(imageRef); 36 | BOOL anyAlpha = (alpha == kCGImageAlphaFirst || 37 | alpha == kCGImageAlphaLast || 38 | alpha == kCGImageAlphaPremultipliedFirst || 39 | alpha == kCGImageAlphaPremultipliedLast); 40 | if (anyAlpha) { 41 | return image; 42 | } 43 | 44 | // current 45 | CGColorSpaceModel imageColorSpaceModel = CGColorSpaceGetModel(CGImageGetColorSpace(imageRef)); 46 | CGColorSpaceRef colorspaceRef = CGImageGetColorSpace(imageRef); 47 | 48 | BOOL unsupportedColorSpace = (imageColorSpaceModel == kCGColorSpaceModelUnknown || 49 | imageColorSpaceModel == kCGColorSpaceModelMonochrome || 50 | imageColorSpaceModel == kCGColorSpaceModelCMYK || 51 | imageColorSpaceModel == kCGColorSpaceModelIndexed); 52 | if (unsupportedColorSpace) { 53 | colorspaceRef = CGColorSpaceCreateDeviceRGB(); 54 | } 55 | 56 | size_t width = CGImageGetWidth(imageRef); 57 | size_t height = CGImageGetHeight(imageRef); 58 | NSUInteger bytesPerPixel = 4; 59 | NSUInteger bytesPerRow = bytesPerPixel * width; 60 | NSUInteger bitsPerComponent = 8; 61 | 62 | 63 | // kCGImageAlphaNone is not supported in CGBitmapContextCreate. 64 | // Since the original image here has no alpha info, use kCGImageAlphaNoneSkipLast 65 | // to create bitmap graphics contexts without alpha info. 66 | CGContextRef context = CGBitmapContextCreate(NULL, 67 | width, 68 | height, 69 | bitsPerComponent, 70 | bytesPerRow, 71 | colorspaceRef, 72 | kCGBitmapByteOrderDefault|kCGImageAlphaNoneSkipLast); 73 | 74 | // Draw the image into the context and retrieve the new bitmap image without alpha 75 | CGContextDrawImage(context, CGRectMake(0, 0, width, height), imageRef); 76 | CGImageRef imageRefWithoutAlpha = CGBitmapContextCreateImage(context); 77 | UIImage *imageWithoutAlpha = [UIImage imageWithCGImage:imageRefWithoutAlpha 78 | scale:image.scale 79 | orientation:image.imageOrientation]; 80 | 81 | if (unsupportedColorSpace) { 82 | CGColorSpaceRelease(colorspaceRef); 83 | } 84 | 85 | CGContextRelease(context); 86 | CGImageRelease(imageRefWithoutAlpha); 87 | 88 | return imageWithoutAlpha; 89 | } 90 | } 91 | 92 | @end 93 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/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 | self.loadingView.alpha = 1.0; 94 | [self.loadingView stopAnimating]; 95 | 96 | self.arrowView.hidden = NO; 97 | }]; 98 | } else { 99 | self.arrowView.hidden = NO; 100 | [self.loadingView stopAnimating]; 101 | [UIView animateWithDuration:MJRefreshFastAnimationDuration animations:^{ 102 | self.arrowView.transform = CGAffineTransformMakeRotation(0.000001 - M_PI); 103 | }]; 104 | } 105 | } else if (state == MJRefreshStatePulling) { 106 | self.arrowView.hidden = NO; 107 | [self.loadingView stopAnimating]; 108 | [UIView animateWithDuration:MJRefreshFastAnimationDuration animations:^{ 109 | self.arrowView.transform = CGAffineTransformIdentity; 110 | }]; 111 | } else if (state == MJRefreshStateRefreshing) { 112 | self.arrowView.hidden = YES; 113 | [self.loadingView startAnimating]; 114 | } else if (state == MJRefreshStateNoMoreData) { 115 | self.arrowView.hidden = YES; 116 | [self.loadingView stopAnimating]; 117 | } 118 | } 119 | 120 | @end 121 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/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 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/SDWebImage/SDWebImagePrefetcher.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageManager.h" 11 | 12 | @class SDWebImagePrefetcher; 13 | 14 | @protocol SDWebImagePrefetcherDelegate 15 | 16 | @optional 17 | 18 | /** 19 | * Called when an image was prefetched. 20 | * 21 | * @param imagePrefetcher The current image prefetcher 22 | * @param imageURL The image url that was prefetched 23 | * @param finishedCount The total number of images that were prefetched (successful or not) 24 | * @param totalCount The total number of images that were to be prefetched 25 | */ 26 | - (void)imagePrefetcher:(SDWebImagePrefetcher *)imagePrefetcher didPrefetchURL:(NSURL *)imageURL finishedCount:(NSUInteger)finishedCount totalCount:(NSUInteger)totalCount; 27 | 28 | /** 29 | * Called when all images are prefetched. 30 | * @param imagePrefetcher The current image prefetcher 31 | * @param totalCount The total number of images that were prefetched (whether successful or not) 32 | * @param skippedCount The total number of images that were skipped 33 | */ 34 | - (void)imagePrefetcher:(SDWebImagePrefetcher *)imagePrefetcher didFinishWithTotalCount:(NSUInteger)totalCount skippedCount:(NSUInteger)skippedCount; 35 | 36 | @end 37 | 38 | typedef void(^SDWebImagePrefetcherProgressBlock)(NSUInteger noOfFinishedUrls, NSUInteger noOfTotalUrls); 39 | typedef void(^SDWebImagePrefetcherCompletionBlock)(NSUInteger noOfFinishedUrls, NSUInteger noOfSkippedUrls); 40 | 41 | /** 42 | * Prefetch some URLs in the cache for future use. Images are downloaded in low priority. 43 | */ 44 | @interface SDWebImagePrefetcher : NSObject 45 | 46 | /** 47 | * The web image manager 48 | */ 49 | @property (strong, nonatomic, readonly) SDWebImageManager *manager; 50 | 51 | /** 52 | * Maximum number of URLs to prefetch at the same time. Defaults to 3. 53 | */ 54 | @property (nonatomic, assign) NSUInteger maxConcurrentDownloads; 55 | 56 | /** 57 | * SDWebImageOptions for prefetcher. Defaults to SDWebImageLowPriority. 58 | */ 59 | @property (nonatomic, assign) SDWebImageOptions options; 60 | 61 | /** 62 | * Queue options for Prefetcher. Defaults to Main Queue. 63 | */ 64 | @property (nonatomic, assign) dispatch_queue_t prefetcherQueue; 65 | 66 | @property (weak, nonatomic) id delegate; 67 | 68 | /** 69 | * Return the global image prefetcher instance. 70 | */ 71 | + (SDWebImagePrefetcher *)sharedImagePrefetcher; 72 | 73 | /** 74 | * Allows you to instantiate a prefetcher with any arbitrary image manager. 75 | */ 76 | - (id)initWithImageManager:(SDWebImageManager *)manager; 77 | 78 | /** 79 | * Assign list of URLs to let SDWebImagePrefetcher to queue the prefetching, 80 | * currently one image is downloaded at a time, 81 | * and skips images for failed downloads and proceed to the next image in the list 82 | * 83 | * @param urls list of URLs to prefetch 84 | */ 85 | - (void)prefetchURLs:(NSArray *)urls; 86 | 87 | /** 88 | * Assign list of URLs to let SDWebImagePrefetcher to queue the prefetching, 89 | * currently one image is downloaded at a time, 90 | * and skips images for failed downloads and proceed to the next image in the list 91 | * 92 | * @param urls list of URLs to prefetch 93 | * @param progressBlock block to be called when progress updates; 94 | * first parameter is the number of completed (successful or not) requests, 95 | * second parameter is the total number of images originally requested to be prefetched 96 | * @param completionBlock block to be called when prefetching is completed 97 | * first param is the number of completed (successful or not) requests, 98 | * second parameter is the number of skipped requests 99 | */ 100 | - (void)prefetchURLs:(NSArray *)urls progress:(SDWebImagePrefetcherProgressBlock)progressBlock completed:(SDWebImagePrefetcherCompletionBlock)completionBlock; 101 | 102 | /** 103 | * Remove and cancel queued list 104 | */ 105 | - (void)cancelPrefetching; 106 | 107 | 108 | @end 109 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/YNPageViewController/YNPageConfigration.m: -------------------------------------------------------------------------------- 1 | // 2 | // YNPageConfigration.m 3 | // YNPageViewController 4 | // 5 | // Created by ZYN on 2018/4/22. 6 | // Copyright © 2018年 yongneng. All rights reserved. 7 | // 8 | 9 | #import "YNPageConfigration.h" 10 | #import "UIView+YNPageExtend.h" 11 | 12 | @interface YNPageConfigration () 13 | 14 | @property (nonatomic, strong) NSArray *normalColorArrays; 15 | 16 | @property (nonatomic, strong) NSArray *selectedColorArrays; 17 | 18 | @property (nonatomic, strong) NSArray *deltaColorArrays; 19 | 20 | @end 21 | 22 | @implementation YNPageConfigration 23 | 24 | - (instancetype)init { 25 | self = [super init]; 26 | if (self) { 27 | _showNavigation = YES; 28 | _showTabbar = NO; 29 | _pageStyle = YNPageStyleTop; 30 | _showConver = NO; 31 | _showScrollLine = YES; 32 | _showBottomLine = NO; 33 | _showGradientColor =YES; 34 | _showAddButton = NO; 35 | _scrollMenu = YES; 36 | _bounces = YES; 37 | _aligmentModeCenter = YES; 38 | _lineWidthEqualFontWidth = NO; 39 | 40 | _pageScrollEnabled = YES; 41 | 42 | _headerViewCouldScale = NO; 43 | 44 | _lineColor = [UIColor redColor]; 45 | _converColor = [UIColor groupTableViewBackgroundColor]; 46 | _addButtonBackgroundColor = [UIColor whiteColor]; 47 | _bottomLineBgColor = [UIColor greenColor]; 48 | _scrollViewBackgroundColor = [UIColor whiteColor]; 49 | _normalItemColor = [UIColor grayColor]; 50 | _selectedItemColor = [UIColor greenColor]; 51 | _lineHeight = 2; 52 | _converHeight = 28; 53 | 54 | _menuHeight = 44; 55 | _menuWidth = kYNPAGE_SCREEN_WIDTH; 56 | _coverCornerRadius = 14; 57 | _itemMargin = 15; 58 | _itemLeftAndRightMargin = 15; 59 | _itemFont = [UIFont systemFontOfSize:14]; 60 | _selectedItemFont = _itemFont; 61 | _itemMaxScale = 0; 62 | _lineBottomMargin = 0; 63 | _lineLeftAndRightAddWidth = 0; 64 | 65 | _bottomLineHeight = 2; 66 | } 67 | return self; 68 | } 69 | 70 | - (void)setRGBWithProgress:(CGFloat)progress { 71 | _deltaSelR = [self.normalColorArrays[0] floatValue] + [self.deltaColorArrays[0] floatValue] * progress; 72 | _deltaSelG = [self.normalColorArrays[1] floatValue] + [self.deltaColorArrays[1] floatValue] * progress; 73 | _deltaSelB = [self.normalColorArrays[2] floatValue] + [self.deltaColorArrays[2] floatValue] * progress; 74 | _deltaNorR = [self.selectedColorArrays[0] floatValue] - [self.deltaColorArrays[0] floatValue] * progress; 75 | _deltaNorG = [self.selectedColorArrays[1] floatValue] - [self.deltaColorArrays[1] floatValue] * progress; 76 | _deltaNorB = [self.selectedColorArrays[2] floatValue] - [self.deltaColorArrays[2] floatValue] * progress; 77 | } 78 | 79 | - (CGFloat)lineHeight { 80 | return _showScrollLine ? _lineHeight : 0; 81 | } 82 | 83 | - (CGFloat)deltaScale { 84 | return _deltaScale = _itemMaxScale - 1.0; 85 | } 86 | 87 | - (NSArray *)getRGBArrayWithColor:(UIColor *)color { 88 | CGFloat r = 0, g = 0, b = 0, a = 0; 89 | [color getRed:&r green:&g blue:&b alpha:&a]; 90 | return @[@(r),@(g),@(b)]; 91 | } 92 | 93 | - (NSArray *)normalColorArrays { 94 | if (!_normalColorArrays) { 95 | _normalColorArrays = [self getRGBArrayWithColor:_normalItemColor]; 96 | } 97 | return _normalColorArrays; 98 | } 99 | 100 | - (NSArray *)selectedColorArrays { 101 | if (!_selectedColorArrays) { 102 | _selectedColorArrays = [self getRGBArrayWithColor:self.selectedItemColor]; 103 | } 104 | return _selectedColorArrays; 105 | } 106 | 107 | - (NSArray *)deltaColorArrays { 108 | if (!_deltaColorArrays) { 109 | NSMutableArray *arrayM = [[NSMutableArray alloc]initWithCapacity:self.normalColorArrays.count]; 110 | [self.normalColorArrays enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { 111 | [arrayM addObject: @([self.selectedColorArrays[idx] floatValue] - [obj floatValue])]; 112 | }]; 113 | _deltaColorArrays = [arrayM copy]; 114 | } 115 | return _deltaColorArrays; 116 | } 117 | 118 | + (instancetype)defaultConfig { 119 | return [[self alloc] init]; 120 | } 121 | 122 | @end 123 | -------------------------------------------------------------------------------- /YNPageViewController/YNPageViewController/Libs/ThirdParty/MLeaksFinder/UINavigationController+MemoryLeak.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Tencent is pleased to support the open source community by making MLeaksFinder available. 3 | * 4 | * Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. 5 | * 6 | * Licensed under the BSD 3-Clause License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 7 | * 8 | * https://opensource.org/licenses/BSD-3-Clause 9 | * 10 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 11 | */ 12 | 13 | #import "UINavigationController+MemoryLeak.h" 14 | #import "NSObject+MemoryLeak.h" 15 | #import 16 | 17 | #if _INTERNAL_MLF_ENABLED 18 | 19 | static const void *const kPoppedDetailVCKey = &kPoppedDetailVCKey; 20 | 21 | @implementation UINavigationController (MemoryLeak) 22 | 23 | + (void)load { 24 | static dispatch_once_t onceToken; 25 | dispatch_once(&onceToken, ^{ 26 | [self swizzleSEL:@selector(pushViewController:animated:) withSEL:@selector(swizzled_pushViewController:animated:)]; 27 | [self swizzleSEL:@selector(popViewControllerAnimated:) withSEL:@selector(swizzled_popViewControllerAnimated:)]; 28 | [self swizzleSEL:@selector(popToViewController:animated:) withSEL:@selector(swizzled_popToViewController:animated:)]; 29 | [self swizzleSEL:@selector(popToRootViewControllerAnimated:) withSEL:@selector(swizzled_popToRootViewControllerAnimated:)]; 30 | }); 31 | } 32 | 33 | - (void)swizzled_pushViewController:(UIViewController *)viewController animated:(BOOL)animated { 34 | if (self.splitViewController) { 35 | id detailViewController = objc_getAssociatedObject(self, kPoppedDetailVCKey); 36 | if ([detailViewController isKindOfClass:[UIViewController class]]) { 37 | [detailViewController willDealloc]; 38 | objc_setAssociatedObject(self, kPoppedDetailVCKey, nil, OBJC_ASSOCIATION_RETAIN); 39 | } 40 | } 41 | 42 | [self swizzled_pushViewController:viewController animated:animated]; 43 | } 44 | 45 | - (UIViewController *)swizzled_popViewControllerAnimated:(BOOL)animated { 46 | UIViewController *poppedViewController = [self swizzled_popViewControllerAnimated:animated]; 47 | 48 | if (!poppedViewController) { 49 | return nil; 50 | } 51 | 52 | // Detail VC in UISplitViewController is not dealloced until another detail VC is shown 53 | if (self.splitViewController && 54 | self.splitViewController.viewControllers.firstObject == self && 55 | self.splitViewController == poppedViewController.splitViewController) { 56 | objc_setAssociatedObject(self, kPoppedDetailVCKey, poppedViewController, OBJC_ASSOCIATION_RETAIN); 57 | return poppedViewController; 58 | } 59 | 60 | // VC is not dealloced until disappear when popped using a left-edge swipe gesture 61 | extern const void *const kHasBeenPoppedKey; 62 | objc_setAssociatedObject(poppedViewController, kHasBeenPoppedKey, @(YES), OBJC_ASSOCIATION_RETAIN); 63 | 64 | return poppedViewController; 65 | } 66 | 67 | - (NSArray *)swizzled_popToViewController:(UIViewController *)viewController animated:(BOOL)animated { 68 | NSArray *poppedViewControllers = [self swizzled_popToViewController:viewController animated:animated]; 69 | 70 | for (UIViewController *viewController in poppedViewControllers) { 71 | [viewController willDealloc]; 72 | } 73 | 74 | return poppedViewControllers; 75 | } 76 | 77 | - (NSArray *)swizzled_popToRootViewControllerAnimated:(BOOL)animated { 78 | NSArray *poppedViewControllers = [self swizzled_popToRootViewControllerAnimated:animated]; 79 | 80 | for (UIViewController *viewController in poppedViewControllers) { 81 | [viewController willDealloc]; 82 | } 83 | 84 | return poppedViewControllers; 85 | } 86 | 87 | - (BOOL)willDealloc { 88 | if (![super willDealloc]) { 89 | return NO; 90 | } 91 | 92 | [self willReleaseChildren:self.viewControllers]; 93 | 94 | return YES; 95 | } 96 | 97 | @end 98 | 99 | #endif 100 | --------------------------------------------------------------------------------