├── ZYBaseDemo ├── Assets.xcassets │ ├── Contents.json │ ├── scan.imageset │ │ ├── scan@2x.png │ │ ├── scan@3x.png │ │ └── Contents.json │ ├── AppIcon.appiconset │ │ ├── icon20@2x.png │ │ ├── icon20@3x.png │ │ ├── icon27@2x.png │ │ ├── icon27@3x.png │ │ ├── icon40@2x.png │ │ ├── icon40@3x.png │ │ ├── icon60@2x.png │ │ ├── icon60@3x.png │ │ └── Contents.json │ ├── browser.imageset │ │ ├── browser@2x.png │ │ ├── browser@3x.png │ │ └── Contents.json │ ├── moji_logo.imageset │ │ ├── moji_logo@2x.png │ │ ├── moji_logo@3x.png │ │ └── Contents.json │ ├── tab_select_demo.imageset │ │ ├── tab_select_demo@2x.png │ │ ├── tab_select_demo@3x.png │ │ └── Contents.json │ ├── tab_select_set.imageset │ │ ├── tab_select_set@2x.png │ │ ├── tab_select_set@3x.png │ │ └── Contents.json │ ├── tab_unselect_set.imageset │ │ ├── tab_unselect_set@2x.png │ │ ├── tab_unselect_set@3x.png │ │ └── Contents.json │ └── tab_unselect_demo.imageset │ │ ├── tab_unselect_demo@2x.png │ │ ├── tab_unselect_demo@3x.png │ │ └── Contents.json ├── SubVCS │ ├── KINWebBrowser │ │ └── imageResource │ │ │ ├── backbutton.png │ │ │ ├── backbutton@2x.png │ │ │ ├── backbutton@3x.png │ │ │ ├── forwardbutton.png │ │ │ ├── forwardbutton@2x.png │ │ │ └── forwardbutton@3x.png │ ├── BadgeNumberVC.swift │ ├── ScanResultVC.swift │ ├── WebVC.swift │ └── WKWebVC.swift ├── TestModel.swift ├── ZYBaseDemo-Bridging-Header.h ├── ChatModel.swift ├── BaseDemoVC.swift ├── ViewController4.swift ├── ViewController3.swift ├── TestAlertView.swift ├── MyQRCodeViewController.swift ├── Base.lproj │ ├── Main.storyboard │ └── LaunchScreen.storyboard ├── Info.plist ├── ResultViewController.swift ├── BrowserVC.swift ├── index.html └── TestTableViewCell.swift ├── ZYBase ├── ThirdLib │ ├── 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 │ │ ├── Custom │ │ │ ├── Footer │ │ │ │ ├── Auto │ │ │ │ │ ├── MJRefreshAutoNormalFooter.h │ │ │ │ │ ├── MJRefreshAutoGifFooter.h │ │ │ │ │ ├── MJRefreshAutoStateFooter.h │ │ │ │ │ ├── MJRefreshAutoNormalFooter.m │ │ │ │ │ └── MJRefreshAutoStateFooter.m │ │ │ │ └── Back │ │ │ │ │ ├── MJRefreshBackNormalFooter.h │ │ │ │ │ ├── MJRefreshBackGifFooter.h │ │ │ │ │ ├── MJRefreshBackStateFooter.h │ │ │ │ │ └── MJRefreshBackStateFooter.m │ │ │ └── Header │ │ │ │ ├── MJRefreshNormalHeader.h │ │ │ │ ├── MJRefreshGifHeader.h │ │ │ │ └── MJRefreshStateHeader.h │ │ ├── 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 │ ├── LBXScan │ │ ├── CodeScan.bundle │ │ │ ├── device_scan@2x.png │ │ │ ├── qrcode_scan_full_net.png │ │ │ ├── qrcode_scan_part_net.png │ │ │ ├── qrcode_Scan_weixin_Line@2x.png │ │ │ ├── qrcode_scan_btn_scan_off@2x.png │ │ │ ├── qrcode_scan_light_green@2x.png │ │ │ ├── qrcode_scan_btn_flash_down@2x.png │ │ │ ├── qrcode_scan_btn_flash_nor@2x.png │ │ │ ├── qrcode_scan_btn_photo_down@2x.png │ │ │ ├── qrcode_scan_btn_photo_nor@2x.png │ │ │ ├── qrcode_scan_btn_myqrcode_down@2x.png │ │ │ ├── qrcode_scan_btn_myqrcode_nor@2x.png │ │ │ ├── qrcode_scan_titlebar_back_nor@2x.png │ │ │ └── qrcode_scan_titlebar_back_pressed@2x.png │ │ ├── LBXPermissions.swift │ │ ├── LBXScanNetAnimation.swift │ │ ├── LBXScanLineAnimation.swift │ │ └── LBXScanViewStyle.swift │ ├── Alamofire │ │ ├── Alamofire.xcodeproj │ │ │ ├── project.xcworkspace │ │ │ │ ├── contents.xcworkspacedata │ │ │ │ └── xcuserdata │ │ │ │ │ └── mzywx.xcuserdatad │ │ │ │ │ └── UserInterfaceState.xcuserstate │ │ │ └── xcuserdata │ │ │ │ ├── mac.xcuserdatad │ │ │ │ └── xcschemes │ │ │ │ │ └── xcschememanagement.plist │ │ │ │ └── mzywx.xcuserdatad │ │ │ │ └── xcschemes │ │ │ │ └── xcschememanagement.plist │ │ └── Source │ │ │ ├── Info.plist │ │ │ ├── Info-tvOS.plist │ │ │ ├── Alamofire.h │ │ │ ├── DispatchQueue+Alamofire.swift │ │ │ └── Notifications.swift │ ├── Kingfisher │ │ ├── Kingfisher.xcodeproj │ │ │ ├── project.xcworkspace │ │ │ │ └── contents.xcworkspacedata │ │ │ ├── xcuserdata │ │ │ │ ├── mac.xcuserdatad │ │ │ │ │ └── xcschemes │ │ │ │ │ │ └── xcschememanagement.plist │ │ │ │ └── mzywx.xcuserdatad │ │ │ │ │ └── xcschemes │ │ │ │ │ └── xcschememanagement.plist │ │ │ └── xcshareddata │ │ │ │ └── xcbaselines │ │ │ │ └── D1ED2D3E1AD2D09F00CFC3EB.xcbaseline │ │ │ │ ├── 74237B0B-7981-4A24-B6C4-95F4A5E7727F.plist │ │ │ │ └── Info.plist │ │ └── Sources │ │ │ ├── Box.swift │ │ │ ├── Info.plist │ │ │ ├── Kingfisher.h │ │ │ ├── ThreadHelper.swift │ │ │ ├── RequestModifier.swift │ │ │ ├── Kingfisher.swift │ │ │ └── Resource.swift │ └── Snapkit │ │ ├── SnapKit.xcodeproj │ │ └── xcuserdata │ │ │ ├── mac.xcuserdatad │ │ │ └── xcschemes │ │ │ │ └── xcschememanagement.plist │ │ │ └── mzywx.xcuserdatad │ │ │ └── xcschemes │ │ │ └── xcschememanagement.plist │ │ └── Source │ │ ├── Info.plist │ │ ├── SnapKit.h │ │ ├── ConstraintView.swift │ │ ├── ConstraintInsets.swift │ │ ├── ConstraintLayoutSupport.swift │ │ ├── UILayoutSupport+Extensions.swift │ │ ├── ConstraintLayoutGuide+Extensions.swift │ │ ├── ConstraintLayoutGuide.swift │ │ ├── ConstraintConfig.swift │ │ ├── ConstraintRelation.swift │ │ ├── ConstraintMakerFinalizable.swift │ │ ├── ConstraintRelatableTarget.swift │ │ ├── LayoutConstraint.swift │ │ ├── ConstraintLayoutSupportDSL.swift │ │ ├── ConstraintItem.swift │ │ ├── ConstraintMakerEditable.swift │ │ ├── ConstraintPriorityTarget.swift │ │ ├── ConstraintMultiplierTarget.swift │ │ ├── ConstraintOffsetTarget.swift │ │ ├── ConstraintLayoutGuideDSL.swift │ │ ├── ConstraintPriority.swift │ │ ├── ConstraintMakerPriortizable.swift │ │ ├── ConstraintDescription.swift │ │ └── ConstraintInsetTarget.swift ├── Tools │ ├── ZYCustomeAlert │ │ ├── ZYAlertWindow.h │ │ ├── ZYAlertVC.h │ │ ├── UIWindow+ZYUitily.h │ │ ├── ZYAlertWindow.m │ │ ├── UIView+CustomeAlert.swift │ │ ├── UIWindow+ZYUitily.m │ │ ├── ZYAlertView.h │ │ ├── ZYAlertVC.m │ │ └── ExampleAlert │ │ │ └── ZYCustomSelectAlert.swift │ ├── Categories │ │ ├── NSObject+Swizzling.h │ │ ├── UISearchBar+PlaceholderAlignment.h │ │ ├── NSObject+Property.h │ │ ├── NSObject+Swizzling.m │ │ ├── UISearchBar+PlaceholderAlignment.m │ │ ├── UINavigationController+SGProgress.h │ │ └── NSObject+Property.m │ ├── Extensions │ │ └── UITableView+CacheCellHeight.swift │ ├── ZYChineseSort │ │ └── ZYChineseSort.h │ ├── ZYNetModel │ │ └── ZYRootModel.swift │ └── ZYBadgeView │ │ └── ZYBadgeView.h ├── BaseSet │ ├── BaseVC.swift │ └── RootManager.swift ├── Info.plist └── ZYBase.h ├── ZYBase.xcodeproj ├── xcuserdata │ ├── mac.xcuserdatad │ │ ├── xcdebugger │ │ │ └── Breakpoints_v2.xcbkptlist │ │ └── xcschemes │ │ │ └── xcschememanagement.plist │ └── mzywx.xcuserdatad │ │ ├── xcschemes │ │ └── xcschememanagement.plist │ │ └── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist └── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ ├── mac.xcuserdatad │ └── UserInterfaceState.xcuserstate │ └── mzywx.xcuserdatad │ └── UserInterfaceState.xcuserstate ├── README.md ├── LICENSE └── .gitignore /ZYBaseDemo/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /ZYBaseDemo/Assets.xcassets/scan.imageset/scan@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CherishSmile/ZYBase/HEAD/ZYBaseDemo/Assets.xcassets/scan.imageset/scan@2x.png -------------------------------------------------------------------------------- /ZYBaseDemo/Assets.xcassets/scan.imageset/scan@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CherishSmile/ZYBase/HEAD/ZYBaseDemo/Assets.xcassets/scan.imageset/scan@3x.png -------------------------------------------------------------------------------- /ZYBase/ThirdLib/MJRefresh/MJRefresh.bundle/arrow@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CherishSmile/ZYBase/HEAD/ZYBase/ThirdLib/MJRefresh/MJRefresh.bundle/arrow@2x.png -------------------------------------------------------------------------------- /ZYBase/ThirdLib/LBXScan/CodeScan.bundle/device_scan@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CherishSmile/ZYBase/HEAD/ZYBase/ThirdLib/LBXScan/CodeScan.bundle/device_scan@2x.png -------------------------------------------------------------------------------- /ZYBaseDemo/Assets.xcassets/AppIcon.appiconset/icon20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CherishSmile/ZYBase/HEAD/ZYBaseDemo/Assets.xcassets/AppIcon.appiconset/icon20@2x.png -------------------------------------------------------------------------------- /ZYBaseDemo/Assets.xcassets/AppIcon.appiconset/icon20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CherishSmile/ZYBase/HEAD/ZYBaseDemo/Assets.xcassets/AppIcon.appiconset/icon20@3x.png -------------------------------------------------------------------------------- /ZYBaseDemo/Assets.xcassets/AppIcon.appiconset/icon27@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CherishSmile/ZYBase/HEAD/ZYBaseDemo/Assets.xcassets/AppIcon.appiconset/icon27@2x.png -------------------------------------------------------------------------------- /ZYBaseDemo/Assets.xcassets/AppIcon.appiconset/icon27@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CherishSmile/ZYBase/HEAD/ZYBaseDemo/Assets.xcassets/AppIcon.appiconset/icon27@3x.png -------------------------------------------------------------------------------- /ZYBaseDemo/Assets.xcassets/AppIcon.appiconset/icon40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CherishSmile/ZYBase/HEAD/ZYBaseDemo/Assets.xcassets/AppIcon.appiconset/icon40@2x.png -------------------------------------------------------------------------------- /ZYBaseDemo/Assets.xcassets/AppIcon.appiconset/icon40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CherishSmile/ZYBase/HEAD/ZYBaseDemo/Assets.xcassets/AppIcon.appiconset/icon40@3x.png -------------------------------------------------------------------------------- /ZYBaseDemo/Assets.xcassets/AppIcon.appiconset/icon60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CherishSmile/ZYBase/HEAD/ZYBaseDemo/Assets.xcassets/AppIcon.appiconset/icon60@2x.png -------------------------------------------------------------------------------- /ZYBaseDemo/Assets.xcassets/AppIcon.appiconset/icon60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CherishSmile/ZYBase/HEAD/ZYBaseDemo/Assets.xcassets/AppIcon.appiconset/icon60@3x.png -------------------------------------------------------------------------------- /ZYBaseDemo/Assets.xcassets/browser.imageset/browser@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CherishSmile/ZYBase/HEAD/ZYBaseDemo/Assets.xcassets/browser.imageset/browser@2x.png -------------------------------------------------------------------------------- /ZYBaseDemo/Assets.xcassets/browser.imageset/browser@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CherishSmile/ZYBase/HEAD/ZYBaseDemo/Assets.xcassets/browser.imageset/browser@3x.png -------------------------------------------------------------------------------- /ZYBaseDemo/SubVCS/KINWebBrowser/imageResource/backbutton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CherishSmile/ZYBase/HEAD/ZYBaseDemo/SubVCS/KINWebBrowser/imageResource/backbutton.png -------------------------------------------------------------------------------- /ZYBase/ThirdLib/LBXScan/CodeScan.bundle/qrcode_scan_full_net.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CherishSmile/ZYBase/HEAD/ZYBase/ThirdLib/LBXScan/CodeScan.bundle/qrcode_scan_full_net.png -------------------------------------------------------------------------------- /ZYBase/ThirdLib/LBXScan/CodeScan.bundle/qrcode_scan_part_net.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CherishSmile/ZYBase/HEAD/ZYBase/ThirdLib/LBXScan/CodeScan.bundle/qrcode_scan_part_net.png -------------------------------------------------------------------------------- /ZYBaseDemo/Assets.xcassets/moji_logo.imageset/moji_logo@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CherishSmile/ZYBase/HEAD/ZYBaseDemo/Assets.xcassets/moji_logo.imageset/moji_logo@2x.png -------------------------------------------------------------------------------- /ZYBaseDemo/Assets.xcassets/moji_logo.imageset/moji_logo@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CherishSmile/ZYBase/HEAD/ZYBaseDemo/Assets.xcassets/moji_logo.imageset/moji_logo@3x.png -------------------------------------------------------------------------------- /ZYBaseDemo/SubVCS/KINWebBrowser/imageResource/backbutton@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CherishSmile/ZYBase/HEAD/ZYBaseDemo/SubVCS/KINWebBrowser/imageResource/backbutton@2x.png -------------------------------------------------------------------------------- /ZYBaseDemo/SubVCS/KINWebBrowser/imageResource/backbutton@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CherishSmile/ZYBase/HEAD/ZYBaseDemo/SubVCS/KINWebBrowser/imageResource/backbutton@3x.png -------------------------------------------------------------------------------- /ZYBaseDemo/SubVCS/KINWebBrowser/imageResource/forwardbutton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CherishSmile/ZYBase/HEAD/ZYBaseDemo/SubVCS/KINWebBrowser/imageResource/forwardbutton.png -------------------------------------------------------------------------------- /ZYBaseDemo/SubVCS/KINWebBrowser/imageResource/forwardbutton@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CherishSmile/ZYBase/HEAD/ZYBaseDemo/SubVCS/KINWebBrowser/imageResource/forwardbutton@2x.png -------------------------------------------------------------------------------- /ZYBaseDemo/SubVCS/KINWebBrowser/imageResource/forwardbutton@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CherishSmile/ZYBase/HEAD/ZYBaseDemo/SubVCS/KINWebBrowser/imageResource/forwardbutton@3x.png -------------------------------------------------------------------------------- /ZYBase.xcodeproj/xcuserdata/mac.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/LBXScan/CodeScan.bundle/qrcode_Scan_weixin_Line@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CherishSmile/ZYBase/HEAD/ZYBase/ThirdLib/LBXScan/CodeScan.bundle/qrcode_Scan_weixin_Line@2x.png -------------------------------------------------------------------------------- /ZYBase/ThirdLib/LBXScan/CodeScan.bundle/qrcode_scan_btn_scan_off@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CherishSmile/ZYBase/HEAD/ZYBase/ThirdLib/LBXScan/CodeScan.bundle/qrcode_scan_btn_scan_off@2x.png -------------------------------------------------------------------------------- /ZYBase/ThirdLib/LBXScan/CodeScan.bundle/qrcode_scan_light_green@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CherishSmile/ZYBase/HEAD/ZYBase/ThirdLib/LBXScan/CodeScan.bundle/qrcode_scan_light_green@2x.png -------------------------------------------------------------------------------- /ZYBase/ThirdLib/MJRefresh/MJRefresh.bundle/en.lproj/Localizable.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CherishSmile/ZYBase/HEAD/ZYBase/ThirdLib/MJRefresh/MJRefresh.bundle/en.lproj/Localizable.strings -------------------------------------------------------------------------------- /ZYBase/ThirdLib/LBXScan/CodeScan.bundle/qrcode_scan_btn_flash_down@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CherishSmile/ZYBase/HEAD/ZYBase/ThirdLib/LBXScan/CodeScan.bundle/qrcode_scan_btn_flash_down@2x.png -------------------------------------------------------------------------------- /ZYBase/ThirdLib/LBXScan/CodeScan.bundle/qrcode_scan_btn_flash_nor@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CherishSmile/ZYBase/HEAD/ZYBase/ThirdLib/LBXScan/CodeScan.bundle/qrcode_scan_btn_flash_nor@2x.png -------------------------------------------------------------------------------- /ZYBase/ThirdLib/LBXScan/CodeScan.bundle/qrcode_scan_btn_photo_down@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CherishSmile/ZYBase/HEAD/ZYBase/ThirdLib/LBXScan/CodeScan.bundle/qrcode_scan_btn_photo_down@2x.png -------------------------------------------------------------------------------- /ZYBase/ThirdLib/LBXScan/CodeScan.bundle/qrcode_scan_btn_photo_nor@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CherishSmile/ZYBase/HEAD/ZYBase/ThirdLib/LBXScan/CodeScan.bundle/qrcode_scan_btn_photo_nor@2x.png -------------------------------------------------------------------------------- /ZYBaseDemo/Assets.xcassets/tab_select_demo.imageset/tab_select_demo@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CherishSmile/ZYBase/HEAD/ZYBaseDemo/Assets.xcassets/tab_select_demo.imageset/tab_select_demo@2x.png -------------------------------------------------------------------------------- /ZYBaseDemo/Assets.xcassets/tab_select_demo.imageset/tab_select_demo@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CherishSmile/ZYBase/HEAD/ZYBaseDemo/Assets.xcassets/tab_select_demo.imageset/tab_select_demo@3x.png -------------------------------------------------------------------------------- /ZYBaseDemo/Assets.xcassets/tab_select_set.imageset/tab_select_set@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CherishSmile/ZYBase/HEAD/ZYBaseDemo/Assets.xcassets/tab_select_set.imageset/tab_select_set@2x.png -------------------------------------------------------------------------------- /ZYBaseDemo/Assets.xcassets/tab_select_set.imageset/tab_select_set@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CherishSmile/ZYBase/HEAD/ZYBaseDemo/Assets.xcassets/tab_select_set.imageset/tab_select_set@3x.png -------------------------------------------------------------------------------- /ZYBase/ThirdLib/LBXScan/CodeScan.bundle/qrcode_scan_btn_myqrcode_down@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CherishSmile/ZYBase/HEAD/ZYBase/ThirdLib/LBXScan/CodeScan.bundle/qrcode_scan_btn_myqrcode_down@2x.png -------------------------------------------------------------------------------- /ZYBase/ThirdLib/LBXScan/CodeScan.bundle/qrcode_scan_btn_myqrcode_nor@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CherishSmile/ZYBase/HEAD/ZYBase/ThirdLib/LBXScan/CodeScan.bundle/qrcode_scan_btn_myqrcode_nor@2x.png -------------------------------------------------------------------------------- /ZYBase/ThirdLib/LBXScan/CodeScan.bundle/qrcode_scan_titlebar_back_nor@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CherishSmile/ZYBase/HEAD/ZYBase/ThirdLib/LBXScan/CodeScan.bundle/qrcode_scan_titlebar_back_nor@2x.png -------------------------------------------------------------------------------- /ZYBase/ThirdLib/MJRefresh/MJRefresh.bundle/zh-Hans.lproj/Localizable.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CherishSmile/ZYBase/HEAD/ZYBase/ThirdLib/MJRefresh/MJRefresh.bundle/zh-Hans.lproj/Localizable.strings -------------------------------------------------------------------------------- /ZYBaseDemo/Assets.xcassets/tab_unselect_set.imageset/tab_unselect_set@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CherishSmile/ZYBase/HEAD/ZYBaseDemo/Assets.xcassets/tab_unselect_set.imageset/tab_unselect_set@2x.png -------------------------------------------------------------------------------- /ZYBaseDemo/Assets.xcassets/tab_unselect_set.imageset/tab_unselect_set@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CherishSmile/ZYBase/HEAD/ZYBaseDemo/Assets.xcassets/tab_unselect_set.imageset/tab_unselect_set@3x.png -------------------------------------------------------------------------------- /ZYBaseDemo/Assets.xcassets/tab_unselect_demo.imageset/tab_unselect_demo@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CherishSmile/ZYBase/HEAD/ZYBaseDemo/Assets.xcassets/tab_unselect_demo.imageset/tab_unselect_demo@2x.png -------------------------------------------------------------------------------- /ZYBaseDemo/Assets.xcassets/tab_unselect_demo.imageset/tab_unselect_demo@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CherishSmile/ZYBase/HEAD/ZYBaseDemo/Assets.xcassets/tab_unselect_demo.imageset/tab_unselect_demo@3x.png -------------------------------------------------------------------------------- /ZYBase/ThirdLib/LBXScan/CodeScan.bundle/qrcode_scan_titlebar_back_pressed@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CherishSmile/ZYBase/HEAD/ZYBase/ThirdLib/LBXScan/CodeScan.bundle/qrcode_scan_titlebar_back_pressed@2x.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ZYBase 2 | Swift框架 3 | 4 | 手动导入:
5 | 1、把下载的项目copy到自己的项目目录下
6 | 2、add file ZYBase.xcodeproj 工程文件
7 | 3、只留下ZYBase.xcodeproj和ZYBase文件夹里的文件,其他的都删除即可
8 | 注:使用前先把第三方SDK,全部build一下,然后在自己项目中import即可使用。 9 | -------------------------------------------------------------------------------- /ZYBase.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ZYBase.xcodeproj/project.xcworkspace/xcuserdata/mac.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CherishSmile/ZYBase/HEAD/ZYBase.xcodeproj/project.xcworkspace/xcuserdata/mac.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /ZYBase.xcodeproj/project.xcworkspace/xcuserdata/mzywx.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CherishSmile/ZYBase/HEAD/ZYBase.xcodeproj/project.xcworkspace/xcuserdata/mzywx.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /ZYBase/ThirdLib/Alamofire/Alamofire.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/Kingfisher/Kingfisher.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ZYBase/Tools/ZYCustomeAlert/ZYAlertWindow.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZYAlertWindow.h 3 | // ZYAlertView 4 | // 5 | // Created by MZY on 16/3/15. 6 | // Copyright © 2016年 MZY. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ZYAlertWindow : UIWindow 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/Alamofire/Alamofire.xcodeproj/project.xcworkspace/xcuserdata/mzywx.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CherishSmile/ZYBase/HEAD/ZYBase/ThirdLib/Alamofire/Alamofire.xcodeproj/project.xcworkspace/xcuserdata/mzywx.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /ZYBase/Tools/Categories/NSObject+Swizzling.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+Swizzling.h 3 | // ZYBase 4 | // 5 | // Created by MAC on 2017/5/6. 6 | // Copyright © 2017年 Mzywx. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSObject (Swizzling) 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /ZYBaseDemo/TestModel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TestModel.swift 3 | // BaseDemo 4 | // 5 | // Created by Mzywx on 2016/12/23. 6 | // Copyright © 2016年 Mzywx. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class TestModel: NSObject { 12 | var content : String? 13 | var isExpend:Bool? 14 | 15 | } 16 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/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 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/Kingfisher/Sources/Box.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Box.swift 3 | // Kingfisher 4 | // 5 | // Created by WANG WEI on 2016/09/12. 6 | // Copyright © 2016年 Wei Wang. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class Box { 12 | let value: T 13 | init(value: T) { 14 | self.value = value 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /ZYBase/Tools/ZYCustomeAlert/ZYAlertVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZYAlertVC.h 3 | // ZYAlertView 4 | // 5 | // Created by Mzywx on 16/3/15. 6 | // Copyright © 2016年 Mzywx. All rights reserved. 7 | // 8 | 9 | #import 10 | @class ZYAlertView; 11 | @interface ZYAlertVC : UIViewController 12 | @property(nonatomic,strong)ZYAlertView * alertView; 13 | @end 14 | -------------------------------------------------------------------------------- /ZYBase/Tools/Categories/UISearchBar+PlaceholderAlignment.h: -------------------------------------------------------------------------------- 1 | // 2 | // UISearchBar+PlaceholderAlignment.h 3 | // ZYBase 4 | // 5 | // Created by MAC on 2017/5/8. 6 | // Copyright © 2017年 Mzywx. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UISearchBar (PlaceholderAlignment) 12 | 13 | /** 14 | * placeholder的位置:支持居中(true)和靠左(false)显示 15 | */ 16 | @property(nonatomic,assign)BOOL isCenterPlaceholder; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /ZYBaseDemo/ZYBaseDemo-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZYBaseDemo-Bridging-Header.h 3 | // ZYBaseDemo 4 | // 5 | // Created by Mzywx on 2017/2/4. 6 | // Copyright © 2017年 Mzywx. All rights reserved. 7 | // 8 | 9 | #ifndef ZYBaseDemo_Bridging_Header_h 10 | #define ZYBaseDemo_Bridging_Header_h 11 | 12 | @import ZYBase; 13 | @import Kingfisher; 14 | @import SnapKit; 15 | #import "KINWebBrowserViewController.h" 16 | #endif /* ZYBaseDemo_Bridging_Header_h */ 17 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/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 | -------------------------------------------------------------------------------- /ZYBaseDemo/Assets.xcassets/scan.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "scan@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "scan@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ZYBaseDemo/Assets.xcassets/browser.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "browser@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "browser@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ZYBase/Tools/ZYCustomeAlert/UIWindow+ZYUitily.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIWindow+ZYUitily.h 3 | // ZYAlertView 4 | // 5 | // Created by Mzywx on 16/3/15. 6 | // Copyright © 2016年 Mzywx. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIWindow (ZYUitily) 12 | - (UIViewController *)currentViewController; 13 | #ifdef __IPHONE_7_0 14 | - (UIViewController *)viewControllerForStatusBarStyle; 15 | - (UIViewController *)viewControllerForStatusBarHidden; 16 | #endif 17 | @end 18 | -------------------------------------------------------------------------------- /ZYBaseDemo/Assets.xcassets/moji_logo.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "moji_logo@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "moji_logo@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ZYBase/ThirdLib/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 | -------------------------------------------------------------------------------- /ZYBaseDemo/Assets.xcassets/tab_select_set.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "tab_select_set@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "tab_select_set@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ZYBaseDemo/Assets.xcassets/tab_select_demo.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "tab_select_demo@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "tab_select_demo@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ZYBaseDemo/Assets.xcassets/tab_unselect_demo.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "tab_unselect_demo@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "tab_unselect_demo@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ZYBaseDemo/Assets.xcassets/tab_unselect_set.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "tab_unselect_set@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "tab_unselect_set@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ZYBase/ThirdLib/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 | -------------------------------------------------------------------------------- /ZYBase/Tools/ZYCustomeAlert/ZYAlertWindow.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZYAlertWindow.m 3 | // ZYAlertView 4 | // 5 | // Created by MZY on 16/3/15. 6 | // Copyright © 2016年 MZY. All rights reserved. 7 | // 8 | 9 | #import "ZYAlertWindow.h" 10 | 11 | @implementation ZYAlertWindow 12 | -(instancetype)initWithFrame:(CGRect)frame 13 | { 14 | self = [super initWithFrame:frame]; 15 | if (self) { 16 | self.opaque = NO; 17 | self.backgroundColor = [UIColor colorWithWhite:0 alpha:0.7]; 18 | } 19 | return self; 20 | } 21 | @end 22 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/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 | -------------------------------------------------------------------------------- /ZYBase/Tools/Categories/NSObject+Property.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+Property.h 3 | // ZYBase 4 | // 5 | // Created by MAC on 2017/5/8. 6 | // Copyright © 2017年 Mzywx. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSObject (Property) 12 | 13 | /** 14 | 获取某个类里面的全部属性 15 | 16 | @param class 传入的类 17 | @return 属性数组 18 | */ 19 | -(NSArray*)getAllProperty:(Class)class; 20 | 21 | /** 22 | 获取某个类中的全部方法 23 | 24 | @param class 传入的类 25 | @return 方法数组 26 | */ 27 | -(NSArray*)getAllFunction:(Class)class; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/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" -------------------------------------------------------------------------------- /ZYBaseDemo/ChatModel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ChatModel.swift 3 | // ZYBaseDemo 4 | // 5 | // Created by Mzywx on 2017/2/4. 6 | // Copyright © 2017年 Mzywx. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ChatModel: ZYDataModel { 12 | var senderimg : String! 13 | var content : String! 14 | var createdate : Double! 15 | 16 | required init(fromJson json: JSON!) { 17 | super.init(fromJson: json) 18 | senderimg = json["senderimg"].stringValue 19 | content = json["content"].stringValue 20 | createdate = json["createdate"].doubleValue 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/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 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/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 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/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 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/Snapkit/SnapKit.xcodeproj/xcuserdata/mac.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | SnapKit.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 2 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | EEBCC9D719CC627D0083B827 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/Alamofire/Alamofire.xcodeproj/xcuserdata/mac.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Alamofire iOS.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | F8111E3219A95C8B0040E7D1 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/Kingfisher/Kingfisher.xcodeproj/xcuserdata/mac.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Kingfisher.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 1 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | D1ED2D341AD2D09F00CFC3EB 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/Kingfisher/Kingfisher.xcodeproj/xcuserdata/mzywx.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Kingfisher.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 2 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | D1ED2D341AD2D09F00CFC3EB 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/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 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/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 | -------------------------------------------------------------------------------- /ZYBase/BaseSet/BaseVC.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BaseVC.swift 3 | // BaseDemo 4 | // 5 | // Created by Mzywx on 2016/12/21. 6 | // Copyright © 2016年 Mzywx. All rights reserved. 7 | // 8 | 9 | open class BaseVC: UIViewController { 10 | 11 | override open func viewDidLoad() { 12 | super.viewDidLoad() 13 | 14 | view.backgroundColor = .white 15 | 16 | } 17 | override open func didReceiveMemoryWarning() { 18 | super.didReceiveMemoryWarning() 19 | } 20 | 21 | override open func touchesBegan(_ touches: Set, with event: UIEvent?) { 22 | view.endEditing(true) 23 | } 24 | 25 | 26 | deinit { 27 | printLog("\(classForCoder) deinit"); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/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 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/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 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/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 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/Snapkit/SnapKit.xcodeproj/xcuserdata/mzywx.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | SnapKit.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 1 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | EEBCC9D719CC627D0083B827 16 | 17 | primary 18 | 19 | 20 | EEBCC9E119CC627D0083B827 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/Kingfisher/Kingfisher.xcodeproj/xcshareddata/xcbaselines/D1ED2D3E1AD2D09F00CFC3EB.xcbaseline/74237B0B-7981-4A24-B6C4-95F4A5E7727F.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | classNames 6 | 7 | ImageCacheTests 8 | 9 | testRetrivingImagePerformance() 10 | 11 | com.apple.XCTPerformanceMetric_WallClockTime 12 | 13 | baselineAverage 14 | 0.27 15 | baselineIntegrationDisplayName 16 | Local Baseline 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /ZYBase.xcodeproj/xcuserdata/mac.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | ZYBase.xcscheme 8 | 9 | orderHint 10 | 3 11 | 12 | ZYBaseDemo.xcscheme 13 | 14 | orderHint 15 | 4 16 | 17 | 18 | SuppressBuildableAutocreation 19 | 20 | 357553201E4817C5005A0755 21 | 22 | primary 23 | 24 | 25 | 3575542E1E4818B7005A0755 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/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 | -------------------------------------------------------------------------------- /ZYBase.xcodeproj/xcuserdata/mzywx.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | ZYBase.xcscheme 8 | 9 | orderHint 10 | 3 11 | 12 | ZYBaseDemo.xcscheme 13 | 14 | orderHint 15 | 4 16 | 17 | 18 | SuppressBuildableAutocreation 19 | 20 | 357553201E4817C5005A0755 21 | 22 | primary 23 | 24 | 25 | 3575542E1E4818B7005A0755 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /ZYBase/Tools/ZYCustomeAlert/UIView+CustomeAlert.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+CustomeAlert.swift 3 | // ZYBase 4 | // 5 | // Created by MAC on 2017/5/8. 6 | // Copyright © 2017年 Mzywx. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | extension UIView{ 12 | /** 13 | * 显示alert 14 | */ 15 | open func showZYAlert(_ style:ZYAlertViewTransitionStyle,_ isUnDismiss:Bool) { 16 | let aletView = ZYAlertView() 17 | aletView.containerView = self 18 | aletView.isTouchOtherUndissmiss = isUnDismiss 19 | aletView.transitionStyle = style; 20 | aletView.show() 21 | } 22 | 23 | /** 24 | * 隐藏alert 25 | */ 26 | open func dismissZYAlert() { 27 | if self.superview is ZYAlertView { 28 | let alertView = self.superview as! ZYAlertView 29 | alertView.dismiss(animated: true) 30 | } 31 | } 32 | 33 | } 34 | 35 | -------------------------------------------------------------------------------- /ZYBase/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | china 7 | CFBundleDisplayName 8 | ZYBase 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/Kingfisher/Sources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 3.10.3 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1088 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/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 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/Alamofire/Source/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 4.5.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/Snapkit/Source/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | $(CURRENT_PROJECT_VERSION) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /ZYBaseDemo/BaseDemoVC.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BaseDemoVC.swift 3 | // ZYBase 4 | // 5 | // Created by Mzywx on 2017/3/8. 6 | // Copyright © 2017年 Mzywx. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class BaseDemoVC: BaseVC { 12 | 13 | override func viewDidLoad() { 14 | super.viewDidLoad() 15 | 16 | 17 | // Do any additional setup after loading the view. 18 | } 19 | override func didReceiveMemoryWarning() { 20 | super.didReceiveMemoryWarning() 21 | // Dispose of any resources that can be recreated. 22 | } 23 | 24 | 25 | /* 26 | // MARK: - Navigation 27 | 28 | // In a storyboard-based application, you will often want to do a little preparation before navigation 29 | override func prepare(for segue: UIStoryboardSegue, sender: Any?) { 30 | // Get the new view controller using segue.destinationViewController. 31 | // Pass the selected object to the new view controller. 32 | } 33 | */ 34 | 35 | } 36 | -------------------------------------------------------------------------------- /ZYBaseDemo/ViewController4.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController4.swift 3 | // BaseDemo 4 | // 5 | // Created by Mzywx on 2016/12/21. 6 | // Copyright © 2016年 Mzywx. All rights reserved. 7 | // 8 | 9 | import ZYBase 10 | class ViewController4: BaseVC { 11 | 12 | override func viewDidLoad() { 13 | super.viewDidLoad() 14 | 15 | // Do any additional setup after loading the view. 16 | } 17 | 18 | override func didReceiveMemoryWarning() { 19 | super.didReceiveMemoryWarning() 20 | // Dispose of any resources that can be recreated. 21 | } 22 | 23 | 24 | /* 25 | // MARK: - Navigation 26 | 27 | // In a storyboard-based application, you will often want to do a little preparation before navigation 28 | override func prepare(for segue: UIStoryboardSegue, sender: Any?) { 29 | // Get the new view controller using segue.destinationViewController. 30 | // Pass the selected object to the new view controller. 31 | } 32 | */ 33 | 34 | } 35 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/Alamofire/Source/Info-tvOS.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 4.5.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSPrincipalClass 24 | 25 | UIRequiredDeviceCapabilities 26 | 27 | arm64 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/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 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/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 | -------------------------------------------------------------------------------- /ZYBaseDemo/ViewController3.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController3.swift 3 | // BaseDemo 4 | // 5 | // Created by Mzywx on 2016/12/21. 6 | // Copyright © 2016年 Mzywx. All rights reserved. 7 | // 8 | 9 | import ZYBase 10 | class ViewController3: BaseWebVC { 11 | 12 | override func viewDidLoad() { 13 | super.viewDidLoad() 14 | 15 | isShowProgress = true 16 | isUseWebTitle = true 17 | webloadHtml(urlStr: "http://www.baidu.com") 18 | // Do any additional setup after loading the view. 19 | } 20 | override func didReceiveMemoryWarning() { 21 | super.didReceiveMemoryWarning() 22 | // Dispose of any resources that can be recreated. 23 | } 24 | 25 | 26 | /* 27 | // MARK: - Navigation 28 | 29 | // In a storyboard-based application, you will often want to do a little preparation before navigation 30 | override func prepare(for segue: UIStoryboardSegue, sender: Any?) { 31 | // Get the new view controller using segue.destinationViewController. 32 | // Pass the selected object to the new view controller. 33 | } 34 | */ 35 | 36 | } 37 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 CherishSmile 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 | -------------------------------------------------------------------------------- /ZYBase/Tools/Categories/NSObject+Swizzling.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+Swizzling.m 3 | // ZYBase 4 | // 5 | // Created by MAC on 2017/5/6. 6 | // Copyright © 2017年 Mzywx. All rights reserved. 7 | // 8 | 9 | #import "NSObject+Swizzling.h" 10 | #import 11 | @implementation NSObject (Swizzling) 12 | 13 | +(void)load{ 14 | static dispatch_once_t onceToken; 15 | dispatch_once(&onceToken, ^{ 16 | Class class = [self class]; 17 | 18 | SEL originalSelector = @selector(valueForUndefinedKey:); 19 | SEL swizzledSelector = @selector(noCrashValueForUndefinedKey:); 20 | 21 | Method originalMethod = class_getInstanceMethod(class, originalSelector); 22 | Method swizzledMethod = class_getInstanceMethod(class, swizzledSelector); 23 | 24 | method_exchangeImplementations(originalMethod, swizzledMethod); 25 | }); 26 | } 27 | 28 | #pragma mark - Method Swizzling 29 | 30 | /** 31 | kvc防止崩溃处理 32 | 33 | @param key 不存在的key 34 | @return 错误信息 35 | */ 36 | -(id)noCrashValueForUndefinedKey:(NSString *)key{ 37 | NSLog(@"key不存在"); 38 | return @"The key doesn't exist"; 39 | } 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/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 | -------------------------------------------------------------------------------- /ZYBaseDemo/TestAlertView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TestAlertView.swift 3 | // BaseDemo 4 | // 5 | // Created by Mzywx on 2016/12/22. 6 | // Copyright © 2016年 Mzywx. All rights reserved. 7 | // 8 | 9 | import ZYBase 10 | 11 | class TestAlertView: UIView { 12 | 13 | func creatAlertView() { 14 | drawBorder(self, .gray, 3.0) 15 | self.backgroundColor = .white 16 | let marllbl = creatLable(getFont(14), "继承BaseAlertView,创建你想要的alert") 17 | marllbl.frame = .init(x: 0, y: 0, width: VIEW_WIDTH(self), height: VIEW_HEIGHT(self)) 18 | marllbl.center = self.center 19 | marllbl.textAlignment = .center 20 | self.addSubview(marllbl) 21 | } 22 | 23 | override init(frame: CGRect) { 24 | super.init(frame: frame) 25 | creatAlertView() 26 | } 27 | func show() { 28 | showZYAlert(.fade, false) 29 | } 30 | 31 | required init?(coder aDecoder: NSCoder) { 32 | fatalError("init(coder:) has not been implemented") 33 | } 34 | /* 35 | // Only override draw() if you perform custom drawing. 36 | // An empty implementation adversely affects performance during animation. 37 | override func draw(_ rect: CGRect) { 38 | // Drawing code 39 | } 40 | */ 41 | 42 | } 43 | -------------------------------------------------------------------------------- /ZYBase/Tools/Categories/UISearchBar+PlaceholderAlignment.m: -------------------------------------------------------------------------------- 1 | // 2 | // UISearchBar+PlaceholderAlignment.m 3 | // ZYBase 4 | // 5 | // Created by MAC on 2017/5/8. 6 | // Copyright © 2017年 Mzywx. All rights reserved. 7 | // 8 | 9 | #import "UISearchBar+PlaceholderAlignment.h" 10 | #import 11 | 12 | 13 | static char *align = "alignment"; 14 | 15 | @implementation UISearchBar (PlaceholderAlignment) 16 | 17 | -(void)setIsCenterPlaceholder:(BOOL)isCenterPlaceholder{ 18 | objc_setAssociatedObject(self, &align, @(isCenterPlaceholder), OBJC_ASSOCIATION_RETAIN_NONATOMIC); 19 | 20 | SEL centerSelector = NSSelectorFromString(@"setCenterPlaceholder:"); 21 | if ([self respondsToSelector:centerSelector]) 22 | { 23 | NSMethodSignature *signature = [[UISearchBar class] instanceMethodSignatureForSelector:centerSelector]; 24 | NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature]; 25 | [invocation setTarget:self]; 26 | [invocation setSelector:centerSelector]; 27 | [invocation setArgument:&isCenterPlaceholder atIndex:2]; 28 | [invocation invoke]; 29 | } 30 | 31 | } 32 | 33 | -(BOOL)isCenterPlaceholder{ 34 | return [objc_getAssociatedObject(self, &align) boolValue]; 35 | } 36 | 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /ZYBase/Tools/ZYCustomeAlert/UIWindow+ZYUitily.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIWindow+ZYUitily.m 3 | // ZYAlertView 4 | // 5 | // Created by Mzywx on 16/3/15. 6 | // Copyright © 2016年 Mzywx. All rights reserved. 7 | // 8 | 9 | #import "UIWindow+ZYUitily.h" 10 | 11 | @implementation UIWindow (ZYUitily) 12 | -(UIViewController *)currentViewController 13 | { 14 | UIViewController * viewController = self.rootViewController; 15 | while (viewController.presentedViewController) { 16 | viewController = viewController.presentedViewController; 17 | } 18 | return viewController; 19 | } 20 | # ifdef __IPHONE_7_0 21 | -(UIViewController *)viewControllerForStatusBarStyle 22 | { 23 | UIViewController * viewController = [self currentViewController]; 24 | while ([viewController childViewControllerForStatusBarStyle]) { 25 | viewController = [viewController childViewControllerForStatusBarStyle]; 26 | } 27 | return viewController; 28 | } 29 | -(UIViewController *)viewControllerForStatusBarHidden 30 | { 31 | UIViewController * viewController = [self currentViewController]; 32 | while ([viewController childViewControllerForStatusBarHidden]) { 33 | viewController = [viewController childViewControllerForStatusBarHidden]; 34 | } 35 | return viewController; 36 | } 37 | # endif 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /ZYBaseDemo/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "icon20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "icon20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "icon27@2x.png", 19 | "scale" : "2x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "icon27@3x.png", 25 | "scale" : "3x" 26 | }, 27 | { 28 | "size" : "40x40", 29 | "idiom" : "iphone", 30 | "filename" : "icon40@2x.png", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "icon40@3x.png", 37 | "scale" : "3x" 38 | }, 39 | { 40 | "size" : "60x60", 41 | "idiom" : "iphone", 42 | "filename" : "icon60@2x.png", 43 | "scale" : "2x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "icon60@3x.png", 49 | "scale" : "3x" 50 | } 51 | ], 52 | "info" : { 53 | "version" : 1, 54 | "author" : "xcode" 55 | } 56 | } -------------------------------------------------------------------------------- /ZYBase/ZYBase.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZYBase.h 3 | // ZYBase 4 | // 5 | // Created by Mzywx on 2016/12/29. 6 | // Copyright © 2016年 Mzywx. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for ZYBase. 12 | FOUNDATION_EXPORT double ZYBaseVersionNumber; 13 | 14 | //! Project version string for ZYBase. 15 | FOUNDATION_EXPORT const unsigned char ZYBaseVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | #import 19 | #import 20 | #import 21 | #import 22 | #import 23 | #import 24 | #import 25 | #import 26 | #import 27 | #import 28 | #import 29 | #import 30 | #import 31 | #import 32 | 33 | 34 | /* 35 | 若直接把文件拖入swift工程,则需创建桥接头文件并导入以下oc头文件 36 | #import "ZYAlertView.h" 37 | #import "ZYBadgeView.h" 38 | #import "ZYFileManager.h" 39 | #import "TTTAttributedLabel.h" 40 | */ 41 | 42 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/LBXScan/LBXPermissions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LBXPermissions.swift 3 | // swiftScan 4 | // 5 | // Created by xialibing on 15/12/15. 6 | // Copyright © 2015年 xialibing. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import AVFoundation 11 | import Photos 12 | import AssetsLibrary 13 | 14 | 15 | 16 | class LBXPermissions: NSObject { 17 | 18 | //MARK: ---相机权限 19 | static func isGetCameraPermission()->Bool 20 | { 21 | 22 | let authStaus = AVCaptureDevice.authorizationStatus(forMediaType: AVMediaTypeVideo) 23 | 24 | if authStaus != AVAuthorizationStatus.denied 25 | { 26 | return true 27 | } 28 | else 29 | { 30 | return false 31 | } 32 | } 33 | 34 | //MARK: ----获取相册权限 35 | static func isGetPhotoPermission()->Bool 36 | { 37 | var bResult = false 38 | if #available(iOS 8.0, *) { 39 | if ( PHPhotoLibrary.authorizationStatus() != PHAuthorizationStatus.denied ) 40 | { 41 | bResult = true 42 | } 43 | } else { 44 | if( ALAssetsLibrary.authorizationStatus() != ALAuthorizationStatus.denied ) 45 | { 46 | bResult = true 47 | } 48 | } 49 | 50 | return bResult 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/Kingfisher/Kingfisher.xcodeproj/xcshareddata/xcbaselines/D1ED2D3E1AD2D09F00CFC3EB.xcbaseline/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | runDestinationsByUUID 6 | 7 | 74237B0B-7981-4A24-B6C4-95F4A5E7727F 8 | 9 | localComputer 10 | 11 | busSpeedInMHz 12 | 100 13 | cpuCount 14 | 1 15 | cpuKind 16 | Intel Core i7 17 | cpuSpeedInMHz 18 | 3500 19 | logicalCPUCoresPerPackage 20 | 8 21 | modelCode 22 | iMac14,2 23 | physicalCPUCoresPerPackage 24 | 4 25 | platformIdentifier 26 | com.apple.platform.macosx 27 | 28 | targetArchitecture 29 | x86_64 30 | targetDevice 31 | 32 | modelCode 33 | iPhone7,2 34 | platformIdentifier 35 | com.apple.platform.iphonesimulator 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /ZYBaseDemo/MyQRCodeViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MyQRCodeViewController.swift 3 | // BaseDemo 4 | // 5 | // Created by Mzywx on 2016/12/26. 6 | // Copyright © 2016年 Mzywx. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import ZYBase 11 | 12 | class MyQRCodeViewController: BaseDemoVC { 13 | 14 | override func viewDidLoad() { 15 | super.viewDidLoad() 16 | 17 | let bgView = UIImageView(frame: .init(x: 0, y: 0, width:SCREEN_WIDTH-100, height: SCREEN_WIDTH-100)) 18 | bgView.center = self.view.center 19 | bgView.image = creatCode(.qr, "http://www.baidu.com", .init(width: SCREEN_WIDTH-100, height: SCREEN_WIDTH-100), .black, .white, nil,nil) 20 | self.view.addSubview(bgView) 21 | 22 | // Do any additional setup after loading the view. 23 | } 24 | 25 | override func didReceiveMemoryWarning() { 26 | super.didReceiveMemoryWarning() 27 | // Dispose of any resources that can be recreated. 28 | } 29 | 30 | 31 | /* 32 | // MARK: - Navigation 33 | 34 | // In a storyboard-based application, you will often want to do a little preparation before navigation 35 | override func prepare(for segue: UIStoryboardSegue, sender: Any?) { 36 | // Get the new view controller using segue.destinationViewController. 37 | // Pass the selected object to the new view controller. 38 | } 39 | */ 40 | 41 | } 42 | -------------------------------------------------------------------------------- /ZYBaseDemo/SubVCS/BadgeNumberVC.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BadgeNumberVC.swift 3 | // ZYBase 4 | // 5 | // Created by Mzywx on 2017/2/24. 6 | // Copyright © 2017年 Mzywx. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class BadgeNumberVC: BaseDemoVC { 12 | 13 | override func viewDidLoad() { 14 | super.viewDidLoad() 15 | 16 | // Do any additional setup after loading the view. 17 | 18 | let view = creatImageView(nil, self.view) { (make) in 19 | make.centerX.centerY.equalToSuperview() 20 | make.width.equalTo(SCREEN_WIDTH-200) 21 | make.height.equalTo(100) 22 | } 23 | view.backgroundColor = .orange 24 | 25 | _ = creatBadgeView(view, .topRight, "20") 26 | _ = creatBadgeView(view, .bottomLeft, "4000") 27 | 28 | } 29 | 30 | override func didReceiveMemoryWarning() { 31 | super.didReceiveMemoryWarning() 32 | // Dispose of any resources that can be recreated. 33 | } 34 | 35 | 36 | /* 37 | // MARK: - Navigation 38 | 39 | // In a storyboard-based application, you will often want to do a little preparation before navigation 40 | override func prepare(for segue: UIStoryboardSegue, sender: Any?) { 41 | // Get the new view controller using segue.destinationViewController. 42 | // Pass the selected object to the new view controller. 43 | } 44 | */ 45 | 46 | } 47 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/Snapkit/Source/SnapKit.h: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #import 25 | 26 | FOUNDATION_EXPORT double SnapKitVersionNumber; 27 | FOUNDATION_EXPORT const unsigned char SnapKitVersionString[]; -------------------------------------------------------------------------------- /ZYBase/ThirdLib/Alamofire/Source/Alamofire.h: -------------------------------------------------------------------------------- 1 | // 2 | // Alamofire.h 3 | // 4 | // Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | @import Foundation; 26 | 27 | FOUNDATION_EXPORT double AlamofireVersionNumber; 28 | FOUNDATION_EXPORT const unsigned char AlamofireVersionString[]; 29 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/Alamofire/Alamofire.xcodeproj/xcuserdata/mzywx.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Alamofire iOS.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 4CCB207C1D45563900C64D5B 16 | 17 | primary 18 | 19 | 20 | 4CF626EE1BA7CB3E0011A099 21 | 22 | primary 23 | 24 | 25 | 4CF626F71BA7CB3E0011A099 26 | 27 | primary 28 | 29 | 30 | 4DD67C0A1A5C55C900ED2280 31 | 32 | primary 33 | 34 | 35 | E4202FCD1B667AA100C997FB 36 | 37 | primary 38 | 39 | 40 | F8111E3219A95C8B0040E7D1 41 | 42 | primary 43 | 44 | 45 | F8111E3D19A95C8B0040E7D1 46 | 47 | primary 48 | 49 | 50 | F829C6B11A7A94F100A2CD59 51 | 52 | primary 53 | 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /ZYBase/Tools/Categories/UINavigationController+SGProgress.h: -------------------------------------------------------------------------------- 1 | // 2 | // UINavigationController+SGProgress.h 3 | // NavigationProgress 4 | // 5 | // Created by Shawn Gryschuk on 2013-09-19. 6 | // Copyright (c) 2013 Shawn Gryschuk. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #define kSGProgressTitleChanged @"kSGProgressTitleChanged" 12 | #define kSGProgressOldTitle @"kSGProgressOldTitle" 13 | 14 | @interface UINavigationController (SGProgress) 15 | 16 | /** 17 | * 进度条的高度 18 | */ 19 | @property(nonatomic,strong)NSNumber *progressHeight; 20 | 21 | - (void)showSGProgress; 22 | - (void)showSGProgressWithDuration:(float)duration; 23 | - (void)showSGProgressWithDuration:(float)duration andTintColor:(UIColor *)tintColor; 24 | - (void)showSGProgressWithDuration:(float)duration andTintColor:(UIColor *)tintColor andTitle:(NSString *)title; 25 | - (void)showSGProgressWithMaskAndDuration:(float)duration; 26 | - (void)showSGProgressWithMaskAndDuration:(float)duration andTitle:(NSString *) title; 27 | 28 | 29 | - (void)setSGProgressPercentage:(float)percentage; 30 | - (void)setSGProgressPercentage:(float)percentage andTitle:(NSString *)title; 31 | - (void)setSGProgressPercentage:(float)percentage andTintColor:(UIColor *)tintColor; 32 | - (void)setSGProgressMaskWithPercentage:(float)percentage; 33 | - (void)setSGProgressMaskWithPercentage:(float)percentage andTitle:(NSString *)title; 34 | 35 | 36 | - (void)finishSGProgress; 37 | 38 | - (void)hiddenSGProgress; 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /ZYBase/Tools/Categories/NSObject+Property.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+Property.m 3 | // ZYBase 4 | // 5 | // Created by MAC on 2017/5/8. 6 | // Copyright © 2017年 Mzywx. All rights reserved. 7 | // 8 | 9 | #import "NSObject+Property.h" 10 | #import 11 | 12 | @implementation NSObject (Property) 13 | 14 | 15 | /** 16 | 获取某个类里面的全部属性 17 | 18 | @param class 传入的类 19 | @return 属性数组 20 | */ 21 | -(NSArray*)getAllProperty:(Class)class{ 22 | unsigned int count; 23 | objc_property_t *properties = class_copyPropertyList(class, &count); 24 | NSMutableArray *propertyArr = [NSMutableArray array]; 25 | for (int i=0; i 9 | 10 | @class ZYAlertView; 11 | typedef void(^ZYAlertViewHandler)(ZYAlertView *alertView); 12 | 13 | typedef NS_ENUM(NSInteger,ZYAlertViewTransitionStyle) { 14 | ZYAlertViewTransitionStyleSlideFromBottom = 0, 15 | ZYAlertViewTransitionStyleSlideFromTop, 16 | ZYAlertViewTransitionStyleFade, 17 | ZYAlertViewTransitionStyleBounce, 18 | ZYAlertViewTransitionStyleDropDown 19 | }; 20 | @interface ZYAlertView : UIView 21 | 22 | @property (nonatomic, weak) UIWindow *oldKeyWindow; 23 | @property (nonatomic, strong) UIWindow *alertWindow; 24 | @property (nonatomic, strong) UIView * containerView; 25 | @property (nonatomic, assign) BOOL isTouchOtherUndissmiss; 26 | @property (nonatomic, assign, getter = isVisible) BOOL visible; 27 | @property (nonatomic, readonly, getter = isParallaxEffectEnabled) BOOL enabledParallaxEffect; 28 | @property (nonatomic, assign, getter = isLayoutDirty) BOOL layoutDirty; 29 | @property (nonatomic, copy) ZYAlertViewHandler willShowHandler; 30 | @property (nonatomic, copy) ZYAlertViewHandler didShowHandler; 31 | @property (nonatomic, copy) ZYAlertViewHandler willDismissHandler; 32 | @property (nonatomic, copy) ZYAlertViewHandler didDismissHandler; 33 | @property (nonatomic, assign) ZYAlertViewTransitionStyle transitionStyle; 34 | 35 | - (void)show; 36 | 37 | - (void)dismissAnimated:(BOOL)animated; 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/Snapkit/Source/ConstraintInsets.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | 31 | #if os(iOS) || os(tvOS) 32 | public typealias ConstraintInsets = UIEdgeInsets 33 | #else 34 | public typealias ConstraintInsets = EdgeInsets 35 | #endif 36 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/Snapkit/Source/ConstraintLayoutSupport.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | 31 | #if os(iOS) || os(tvOS) 32 | @available(iOS 8.0, *) 33 | public typealias ConstraintLayoutSupport = UILayoutSupport 34 | #else 35 | public class ConstraintLayoutSupport {} 36 | #endif 37 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/Snapkit/Source/UILayoutSupport+Extensions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #endif 27 | 28 | 29 | @available(iOS 8.0, *) 30 | public extension ConstraintLayoutSupport { 31 | 32 | public var snp: ConstraintLayoutSupportDSL { 33 | return ConstraintLayoutSupportDSL(support: self) 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/Snapkit/Source/ConstraintLayoutGuide+Extensions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #endif 27 | 28 | 29 | @available(iOS 9.0, OSX 10.11, *) 30 | public extension ConstraintLayoutGuide { 31 | 32 | public var snp: ConstraintLayoutGuideDSL { 33 | return ConstraintLayoutGuideDSL(guide: self) 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /ZYBase/Tools/Extensions/UITableView+CacheCellHeight.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UITableView+CacheCellHeight.swift 3 | // demo 4 | // 5 | // Created by MZY on 16/1/19. 6 | // Copyright © 2016年 MZY. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | private var __ZY_cache_cell_heigh_for_row_key = "__ZY_cache_cell_heigh_for_row" 12 | private var __ZY_cache_cell_calheigh_for_row_key = "__ZY_cache_cell_calheigh_for_row_key" 13 | /// 14 | /// 基于SnapKit扩展自动计算cell的高度 15 | /// 16 | extension UITableView { 17 | public var ZY_cacheHeightDictionary: NSMutableDictionary? { 18 | get { 19 | let dict = objc_getAssociatedObject(self, 20 | &__ZY_cache_cell_heigh_for_row_key) as? NSMutableDictionary; 21 | 22 | if let cache = dict { 23 | return cache; 24 | } 25 | 26 | let newDict = NSMutableDictionary() 27 | 28 | objc_setAssociatedObject(self, 29 | &__ZY_cache_cell_heigh_for_row_key, 30 | newDict, 31 | .OBJC_ASSOCIATION_RETAIN_NONATOMIC) 32 | 33 | return newDict 34 | } 35 | } 36 | 37 | public var ZY_cacheCellDictionary: NSMutableDictionary? { 38 | get { 39 | let dict = objc_getAssociatedObject(self, 40 | &__ZY_cache_cell_calheigh_for_row_key) as? NSMutableDictionary; 41 | 42 | if let cache = dict { 43 | return cache; 44 | } 45 | 46 | let newDict = NSMutableDictionary() 47 | 48 | objc_setAssociatedObject(self, 49 | &__ZY_cache_cell_calheigh_for_row_key, 50 | newDict, 51 | .OBJC_ASSOCIATION_RETAIN_NONATOMIC) 52 | 53 | return newDict 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/Snapkit/Source/ConstraintLayoutGuide.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | 31 | #if os(iOS) || os(tvOS) 32 | @available(iOS 9.0, *) 33 | public typealias ConstraintLayoutGuide = UILayoutGuide 34 | #else 35 | @available(OSX 10.11, *) 36 | public typealias ConstraintLayoutGuide = NSLayoutGuide 37 | #endif 38 | -------------------------------------------------------------------------------- /ZYBase.xcodeproj/xcuserdata/mzywx.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 14 | 15 | 16 | 18 | 22 | 23 | 24 | 26 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /ZYBaseDemo/SubVCS/ScanResultVC.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ScanResultVC.swift 3 | // ZYBase 4 | // 5 | // Created by Mzywx on 2017/3/3. 6 | // Copyright © 2017年 Mzywx. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ScanResultVC: BaseWebVC { 12 | 13 | override func viewDidLoad() { 14 | super.viewDidLoad() 15 | self.title = "扫描结果" 16 | // setBackItem(self, #selector(backClick), #imageLiteral(resourceName: "backbutton.png")) 17 | // Do any additional setup after loading the view. 18 | } 19 | func backClick() { 20 | 21 | if let count = self.navigationController?.viewControllers.count { 22 | if count>=3 { 23 | let vc = self.navigationController?.viewControllers[count - 3] 24 | if let preVC = vc { 25 | _ = self.navigationController?.popToViewController(preVC, animated: true) 26 | }else{ 27 | _ = self.navigationController?.popViewController(animated: true) 28 | } 29 | } 30 | } 31 | } 32 | override func didReceiveMemoryWarning() { 33 | super.didReceiveMemoryWarning() 34 | // Dispose of any resources that can be recreated. 35 | } 36 | 37 | 38 | /* 39 | // MARK: - Navigation 40 | 41 | // In a storyboard-based application, you will often want to do a little preparation before navigation 42 | override func prepare(for segue: UIStoryboardSegue, sender: Any?) { 43 | // Get the new view controller using segue.destinationViewController. 44 | // Pass the selected object to the new view controller. 45 | } 46 | */ 47 | 48 | } 49 | -------------------------------------------------------------------------------- /.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 | *.xcuserstate 23 | 24 | ## Obj-C/Swift specific 25 | *.hmap 26 | *.ipa 27 | *.dSYM.zip 28 | *.dSYM 29 | 30 | ## Playgrounds 31 | timeline.xctimeline 32 | playground.xcworkspace 33 | 34 | # Swift Package Manager 35 | # 36 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 37 | # Packages/ 38 | .build/ 39 | 40 | # CocoaPods 41 | # 42 | # We recommend against adding the Pods directory to your .gitignore. However 43 | # you should judge for yourself, the pros and cons are mentioned at: 44 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 45 | # 46 | # Pods/ 47 | 48 | # Carthage 49 | # 50 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 51 | # Carthage/Checkouts 52 | 53 | Carthage/Build 54 | 55 | # fastlane 56 | # 57 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 58 | # screenshots whenever they are needed. 59 | # For more information about the recommended setup visit: 60 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 61 | 62 | fastlane/report.xml 63 | fastlane/Preview.html 64 | fastlane/screenshots 65 | fastlane/test_output 66 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/Snapkit/Source/ConstraintConfig.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | public typealias ConstraintInterfaceLayoutDirection = UIUserInterfaceLayoutDirection 27 | #else 28 | import AppKit 29 | public typealias ConstraintInterfaceLayoutDirection = NSUserInterfaceLayoutDirection 30 | #endif 31 | 32 | 33 | public struct ConstraintConfig { 34 | 35 | public static var interfaceLayoutDirection: ConstraintInterfaceLayoutDirection = .leftToRight 36 | 37 | } 38 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/Kingfisher/Sources/Kingfisher.h: -------------------------------------------------------------------------------- 1 | // 2 | // Kingfisher.h 3 | // Kingfisher 4 | // 5 | // Created by Wei Wang on 15/4/6. 6 | // 7 | // Copyright (c) 2017 Wei Wang 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining a copy 10 | // of this software and associated documentation files (the "Software"), to deal 11 | // in the Software without restriction, including without limitation the rights 12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the Software is 14 | // furnished to do so, subject to the following conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be included in 17 | // all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | // THE SOFTWARE. 26 | 27 | #import 28 | 29 | //! Project version number for Kingfisher. 30 | FOUNDATION_EXPORT double KingfisherVersionNumber; 31 | 32 | //! Project version string for Kingfisher. 33 | FOUNDATION_EXPORT const unsigned char KingfisherVersionString[]; 34 | 35 | // In this header, you should import all the public headers of your framework using statements like #import 36 | 37 | 38 | -------------------------------------------------------------------------------- /ZYBaseDemo/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 | -------------------------------------------------------------------------------- /ZYBase/Tools/ZYChineseSort/ZYChineseSort.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZYChineseSort.h 3 | // ZYBase 4 | // 5 | // Created by MAC on 2017/5/15. 6 | // Copyright © 2017年 Mzywx. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ZYChineseSort : NSObject 12 | /* mode 可选择1 或 2(可以分别使用看下加载时间做选择,时间差不多选mode=1) 13 | * 14 | * 1-使用系统解析汉字拼音方法,准确性有保障,同时能区分一部分的多音字如(重庆,重量)(*经过测试发现仅仅能区分很小一部分多音字) 15 | * 数据比较多的话非常耗时!非常耗时!非常耗时!、(如果数据量不大,推荐使用这个) 16 | * 2-使用一个放在内存中的拼音数组进行查询,对于多音字没有任何判断, 17 | * 但是效率远超过mode=1,如果显示要求不高且数据量不小推荐用mode=2 18 | * 19 | * (*使用mode=1的话可以对结果进行缓存,可减少加载时间) 20 | * (*所有未区分的多音字都按默认拼音处理) 21 | */ 22 | #define BMSortMode 2 23 | //1、打印函数耗时 0、不打印 24 | #define BMLog 1 25 | 26 | 27 | /** 28 | * 根据汉字返回汉字的拼音 29 | * 30 | * @param word 一个汉字 31 | * 32 | * @return 拼音的字符串 33 | */ 34 | +(NSString *)transformChinese:(NSString *)word; 35 | 36 | #pragma mark =========比较字符串数组========== 37 | /** 38 | * 排序后的首字母(不重复)用于tableView的右侧索引 39 | * 40 | * @param stringArr 需要排序的字符数组 41 | * 42 | * @return 排序后的首字母(不重复) 43 | */ 44 | +(NSMutableArray*)IndexArray:(NSArray*)stringArr; 45 | 46 | /** 47 | * 返回联系人 48 | * 49 | * @param stringArr 需要排序的字符数组 50 | * 51 | * @return 更具首字母排序后的字符数组 52 | */ 53 | +(NSMutableArray*)LetterSortArray:(NSArray*)stringArr; 54 | 55 | #pragma mark =========比较对象数组========== 56 | /** 57 | * 排序后的首字母(不重复)用于tableView的右侧索引 58 | * 59 | * @param objectArray 需要排序的对象数组 60 | * @param key 需要比较的对象的字段 61 | * 62 | * @return 排序后的首字母(不重复) 63 | */ 64 | +(NSMutableArray*)IndexWithArray:(NSArray*)objectArray Key:(NSString *)key; 65 | 66 | /** 67 | * 给对象数组排序 68 | * 69 | * @param objectArray 需要排序的对象数组 70 | * @param key 需要比较的对象的字段 71 | * 72 | * @return 根据字段排序后的对象数组(同首写字母的在一个数组中) 73 | */ 74 | +(NSMutableArray*)sortObjectArray:(NSArray*)objectArray Key:(NSString *)key; 75 | @end 76 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/Kingfisher/Sources/ThreadHelper.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ThreadHelper.swift 3 | // Kingfisher 4 | // 5 | // Created by Wei Wang on 15/10/9. 6 | // 7 | // Copyright (c) 2017 Wei Wang 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining a copy 10 | // of this software and associated documentation files (the "Software"), to deal 11 | // in the Software without restriction, including without limitation the rights 12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the Software is 14 | // furnished to do so, subject to the following conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be included in 17 | // all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | // THE SOFTWARE. 26 | 27 | import Foundation 28 | 29 | extension DispatchQueue { 30 | // This method will dispatch the `block` to self. 31 | // If `self` is the main queue, and current thread is main thread, the block 32 | // will be invoked immediately instead of being dispatched. 33 | func safeAsync(_ block: @escaping ()->()) { 34 | if self === DispatchQueue.main && Thread.isMainThread { 35 | block() 36 | } else { 37 | async { block() } 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/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 | -------------------------------------------------------------------------------- /ZYBaseDemo/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 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/Snapkit/Source/ConstraintRelation.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | 31 | internal enum ConstraintRelation : Int { 32 | case equal = 1 33 | case lessThanOrEqual 34 | case greaterThanOrEqual 35 | 36 | internal var layoutRelation: NSLayoutRelation { 37 | get { 38 | switch(self) { 39 | case .equal: 40 | return .equal 41 | case .lessThanOrEqual: 42 | return .lessThanOrEqual 43 | case .greaterThanOrEqual: 44 | return .greaterThanOrEqual 45 | } 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/Snapkit/Source/ConstraintMakerFinalizable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | 31 | public class ConstraintMakerFinalizable { 32 | 33 | internal let description: ConstraintDescription 34 | 35 | internal init(_ description: ConstraintDescription) { 36 | self.description = description 37 | } 38 | 39 | @discardableResult 40 | public func labeled(_ label: String) -> ConstraintMakerFinalizable { 41 | self.description.label = label 42 | return self 43 | } 44 | 45 | public var constraint: Constraint { 46 | return self.description.constraint! 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/Alamofire/Source/DispatchQueue+Alamofire.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DispatchQueue+Alamofire.swift 3 | // 4 | // Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | import Dispatch 26 | import Foundation 27 | 28 | extension DispatchQueue { 29 | static var userInteractive: DispatchQueue { return DispatchQueue.global(qos: .userInteractive) } 30 | static var userInitiated: DispatchQueue { return DispatchQueue.global(qos: .userInitiated) } 31 | static var utility: DispatchQueue { return DispatchQueue.global(qos: .utility) } 32 | static var background: DispatchQueue { return DispatchQueue.global(qos: .background) } 33 | 34 | func after(_ delay: TimeInterval, execute closure: @escaping () -> Void) { 35 | asyncAfter(deadline: .now() + delay, execute: closure) 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/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"; -------------------------------------------------------------------------------- /ZYBaseDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | china 7 | CFBundleDisplayName 8 | Swift框架 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | NSAppTransportSecurity 26 | 27 | NSAllowsArbitraryLoads 28 | 29 | 30 | NSBluetoothPeripheralUsageDescription 31 | 请点击允许以允许访问。若不允许,你将无法进行定位 32 | NSCameraUsageDescription 33 | 请点击允许以允许访问,若不允许,你将无法进行拍照 34 | NSContactsUsageDescription 35 | 请点击允许以允许访问,若不允许,你将无法添加新的联系人信息 36 | NSLocationAlwaysUsageDescription 37 | 请点击允许以允许访问,若不允许,你将无法进行定位 38 | NSMicrophoneUsageDescription 39 | 请点击允许以允许访问,若不允许,你将无法使用语音等功能 40 | NSPhotoLibraryUsageDescription 41 | 请点击允许以允许访问,若不允许,你将无法使用图片等功能 42 | UILaunchStoryboardName 43 | LaunchScreen 44 | UIMainStoryboardFile 45 | Main 46 | UIRequiredDeviceCapabilities 47 | 48 | armv7 49 | 50 | UISupportedInterfaceOrientations 51 | 52 | UIInterfaceOrientationPortrait 53 | UIInterfaceOrientationLandscapeLeft 54 | UIInterfaceOrientationLandscapeRight 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /ZYBaseDemo/ResultViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ResultViewController.swift 3 | // BaseDemo 4 | // 5 | // Created by Mzywx on 2016/12/26. 6 | // Copyright © 2016年 Mzywx. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import ZYBase 11 | import WebKit 12 | class ResultViewController: LBXResultVC,WKNavigationDelegate { 13 | 14 | override func viewDidLoad() { 15 | super.viewDidLoad() 16 | 17 | 18 | let webView = WKWebView(frame: .init(x: 0, y: 64, width: SCREEN_WIDTH, height: SCREEN_HEIGHT-64)) 19 | webView.backgroundColor = .gray 20 | let request = URLRequest(url: URL(string: (self.result?.strScanned)!)!) 21 | webView.load(request) 22 | webView.navigationDelegate = self 23 | self.view.addSubview(webView) 24 | // Do any additional setup after loading the view. 25 | } 26 | deinit { 27 | printLog("\(ResultViewController.self) deinit") 28 | } 29 | // 页面开始加载时调用 30 | func webView(_ webView: WKWebView, didStartProvisionalNavigation navigation: WKNavigation!) { 31 | } 32 | // 当内容开始返回时调用 33 | func webView(_ webView: WKWebView, didCommit navigation: WKNavigation!) { 34 | } 35 | // 页面加载完成之后调用 36 | func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) { 37 | 38 | 39 | } 40 | // 页面加载失败时调用 41 | func webView(_ webView: WKWebView, didFail navigation: WKNavigation!, withError error: Error) { 42 | } 43 | 44 | 45 | override func didReceiveMemoryWarning() { 46 | super.didReceiveMemoryWarning() 47 | // Dispose of any resources that can be recreated. 48 | } 49 | 50 | 51 | /* 52 | // MARK: - Navigation 53 | 54 | // In a storyboard-based application, you will often want to do a little preparation before navigation 55 | override func prepare(for segue: UIStoryboardSegue, sender: Any?) { 56 | // Get the new view controller using segue.destinationViewController. 57 | // Pass the selected object to the new view controller. 58 | } 59 | */ 60 | 61 | } 62 | -------------------------------------------------------------------------------- /ZYBase/Tools/ZYNetModel/ZYRootModel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ZYRootModel.swift 3 | // ZYBase 4 | // 5 | // Created by Mzywx on 2016/12/29. 6 | // Copyright © 2016年 Mzywx. All rights reserved. 7 | // 8 | 9 | open class ZYRootModel: NSObject { 10 | public var data : Any! 11 | public var map : Any! 12 | public var message : String! 13 | public var status : String! 14 | public var statusCode : String! 15 | public init(fromJson json:JSON,dataClass:ZYDataModel.Type?,mapClass:ZYMapModel.Type?) { 16 | if json.isEmpty { 17 | return 18 | } 19 | let dataArrJson = json["list"].arrayValue 20 | if !dataArrJson.isEmpty { 21 | var dicArr : Array = [] 22 | for dataDic in dataArrJson { 23 | let dataModel = dataClass?.init(fromJson: dataDic) 24 | dicArr.append(dataModel!) 25 | } 26 | data = dicArr 27 | } 28 | let dataDicJson = json["list"].dictionaryValue 29 | if !dataDicJson.isEmpty{ 30 | let dataDic = json["list"] 31 | data = dataClass?.init(fromJson: dataDic) 32 | } 33 | 34 | let mapArrJosn = json["map"].arrayValue 35 | if !mapArrJosn.isEmpty { 36 | var dicArr : Array = [] 37 | for dataDic in mapArrJosn { 38 | let mapModel = mapClass?.init(fromJson: dataDic) 39 | dicArr.append(mapModel!) 40 | } 41 | map = dicArr 42 | } 43 | 44 | let mapDicJosn = json["map"].dictionaryValue 45 | if !mapDicJosn.isEmpty { 46 | let mapDic = json["map"] 47 | map = mapClass?.init(fromJson: mapDic) 48 | } 49 | message = json["message"].stringValue 50 | status = json["status"].stringValue 51 | statusCode = json["statusCode"].stringValue 52 | } 53 | } 54 | 55 | open class ZYDataModel: NSObject { 56 | required public init(fromJson json:JSON) { 57 | 58 | } 59 | } 60 | open class ZYMapModel: NSObject { 61 | required public init(fromJson json:JSON) { 62 | 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/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 | -------------------------------------------------------------------------------- /ZYBaseDemo/BrowserVC.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController2.swift 3 | // BaseDemo 4 | // 5 | // Created by Mzywx on 2016/12/21. 6 | // Copyright © 2016年 Mzywx. All rights reserved. 7 | // 8 | 9 | import ZYBase 10 | 11 | 12 | 13 | class BrowserVC: KINWebBrowserViewController{ 14 | 15 | var requestUrl : String! 16 | 17 | override func viewDidLoad() { 18 | super.viewDidLoad() 19 | 20 | self.showsURLInNavigationBar = true 21 | self.loadURLString(requestUrl) 22 | 23 | let pan = UIPanGestureRecognizer(target: self, action: #selector(panClick)) 24 | self.navigationController?.navigationBar.addGestureRecognizer(pan) 25 | 26 | 27 | } 28 | 29 | @objc private func panClick() { 30 | self.dismiss(animated: true, completion: nil) 31 | } 32 | 33 | 34 | func webBrowser(_ webBrowser: KINWebBrowserViewController!, didStartLoading URL: URL!) { 35 | 36 | } 37 | func webBrowser(_ webBrowser: KINWebBrowserViewController!, didFinishLoading URL: URL!) { 38 | 39 | } 40 | func webBrowser(_ webBrowser: KINWebBrowserViewController!, didFailToLoad URL: URL!, error: Error!) { 41 | 42 | } 43 | func webBrowserViewControllerWillDismiss(_ viewController: KINWebBrowserViewController!) { 44 | 45 | } 46 | 47 | 48 | deinit { 49 | printLog("\(self.classForCoder) deinit") 50 | } 51 | 52 | 53 | override func didReceiveMemoryWarning() { 54 | super.didReceiveMemoryWarning() 55 | // Dispose of any resources that can be recreated. 56 | } 57 | 58 | override func viewWillAppear(_ animated: Bool) { 59 | super.viewWillAppear(animated) 60 | } 61 | 62 | /* 63 | // MARK: - Navigation 64 | 65 | // In a storyboard-based application, you will often want to do a little preparation before navigation 66 | override func prepare(for segue: UIStoryboardSegue, sender: Any?) { 67 | // Get the new view controller using segue.destinationViewController. 68 | // Pass the selected object to the new view controller. 69 | } 70 | */ 71 | 72 | } 73 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/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 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/Kingfisher/Sources/RequestModifier.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RequestModifier.swift 3 | // Kingfisher 4 | // 5 | // Created by Wei Wang on 2016/09/05. 6 | // 7 | // Copyright (c) 2017 Wei Wang 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining a copy 10 | // of this software and associated documentation files (the "Software"), to deal 11 | // in the Software without restriction, including without limitation the rights 12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the Software is 14 | // furnished to do so, subject to the following conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be included in 17 | // all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | // THE SOFTWARE. 26 | 27 | import Foundation 28 | 29 | /// Request modifier of image downloader. 30 | public protocol ImageDownloadRequestModifier { 31 | func modified(for request: URLRequest) -> URLRequest? 32 | } 33 | 34 | struct NoModifier: ImageDownloadRequestModifier { 35 | static let `default` = NoModifier() 36 | private init() {} 37 | func modified(for request: URLRequest) -> URLRequest? { 38 | return request 39 | } 40 | } 41 | 42 | public struct AnyModifier: ImageDownloadRequestModifier { 43 | 44 | let block: (URLRequest) -> URLRequest? 45 | 46 | public func modified(for request: URLRequest) -> URLRequest? { 47 | return block(request) 48 | } 49 | 50 | public init(modify: @escaping (URLRequest) -> URLRequest? ) { 51 | block = modify 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/Snapkit/Source/ConstraintRelatableTarget.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | 31 | public protocol ConstraintRelatableTarget { 32 | } 33 | 34 | extension Int: ConstraintRelatableTarget { 35 | } 36 | 37 | extension UInt: ConstraintRelatableTarget { 38 | } 39 | 40 | extension Float: ConstraintRelatableTarget { 41 | } 42 | 43 | extension Double: ConstraintRelatableTarget { 44 | } 45 | 46 | extension CGFloat: ConstraintRelatableTarget { 47 | } 48 | 49 | extension CGSize: ConstraintRelatableTarget { 50 | } 51 | 52 | extension CGPoint: ConstraintRelatableTarget { 53 | } 54 | 55 | extension ConstraintInsets: ConstraintRelatableTarget { 56 | } 57 | 58 | extension ConstraintItem: ConstraintRelatableTarget { 59 | } 60 | 61 | extension ConstraintView: ConstraintRelatableTarget { 62 | } 63 | 64 | @available(iOS 9.0, OSX 10.11, *) 65 | extension ConstraintLayoutGuide: ConstraintRelatableTarget { 66 | } 67 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/Snapkit/Source/LayoutConstraint.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | 31 | public class LayoutConstraint : NSLayoutConstraint { 32 | 33 | public var label: String? { 34 | get { 35 | return self.identifier 36 | } 37 | set { 38 | self.identifier = newValue 39 | } 40 | } 41 | 42 | internal weak var constraint: Constraint? = nil 43 | 44 | } 45 | 46 | internal func ==(lhs: LayoutConstraint, rhs: LayoutConstraint) -> Bool { 47 | guard lhs.firstItem === rhs.firstItem && 48 | lhs.secondItem === rhs.secondItem && 49 | lhs.firstAttribute == rhs.firstAttribute && 50 | lhs.secondAttribute == rhs.secondAttribute && 51 | lhs.relation == rhs.relation && 52 | lhs.priority == rhs.priority && 53 | lhs.multiplier == rhs.multiplier else { 54 | return false 55 | } 56 | return true 57 | } 58 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/Snapkit/Source/ConstraintLayoutSupportDSL.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | 31 | @available(iOS 8.0, *) 32 | public struct ConstraintLayoutSupportDSL: ConstraintDSL { 33 | 34 | public var target: AnyObject? { 35 | return self.support 36 | } 37 | 38 | internal let support: ConstraintLayoutSupport 39 | 40 | internal init(support: ConstraintLayoutSupport) { 41 | self.support = support 42 | 43 | } 44 | 45 | public var top: ConstraintItem { 46 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.top) 47 | } 48 | 49 | public var bottom: ConstraintItem { 50 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.bottom) 51 | } 52 | 53 | public var height: ConstraintItem { 54 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.height) 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/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 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/LBXScan/LBXScanNetAnimation.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LBXScanNetAnimation.swift 3 | // swiftScan 4 | // 5 | // Created by lbxia on 15/12/9. 6 | // Copyright © 2015年 xialibing. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class LBXScanNetAnimation: UIImageView { 12 | 13 | var isAnimationing = false 14 | var animationRect:CGRect = CGRect.zero 15 | 16 | 17 | 18 | static public func instance()->LBXScanNetAnimation 19 | { 20 | return LBXScanNetAnimation() 21 | } 22 | 23 | func startAnimatingWithRect(animationRect:CGRect, parentView:UIView, image:UIImage?) 24 | { 25 | self.image = image 26 | self.animationRect = animationRect 27 | parentView.addSubview(self) 28 | 29 | self.isHidden = false; 30 | 31 | isAnimationing = true; 32 | 33 | if (image != nil) 34 | { 35 | stepAnimation() 36 | } 37 | 38 | 39 | 40 | } 41 | 42 | func stepAnimation() 43 | { 44 | if (!isAnimationing) { 45 | return; 46 | } 47 | 48 | var frame = animationRect; 49 | 50 | 51 | let hImg = self.image!.size.height * animationRect.size.width / self.image!.size.width; 52 | 53 | frame.origin.y -= hImg; 54 | frame.size.height = hImg; 55 | self.frame = frame; 56 | 57 | self.alpha = 0.0; 58 | 59 | UIView.animate(withDuration: 1.2, animations: { () -> Void in 60 | 61 | self.alpha = 1.0; 62 | 63 | var frame = self.animationRect; 64 | let hImg = self.image!.size.height * self.animationRect.size.width / self.image!.size.width; 65 | 66 | frame.origin.y += (frame.size.height - hImg); 67 | frame.size.height = hImg; 68 | 69 | self.frame = frame; 70 | 71 | }, completion:{ (value: Bool) -> Void in 72 | 73 | self.perform(#selector(LBXScanNetAnimation.stepAnimation), with: nil, afterDelay: 0.3) 74 | 75 | }) 76 | 77 | } 78 | 79 | func stopStepAnimating() 80 | { 81 | self.isHidden = true; 82 | isAnimationing = false; 83 | } 84 | 85 | } 86 | -------------------------------------------------------------------------------- /ZYBase/Tools/ZYCustomeAlert/ZYAlertVC.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZYAlertVC.m 3 | // ZYAlertView 4 | // 5 | // Created by Mzywx on 16/3/15. 6 | // Copyright © 2016年 Mzywx. All rights reserved. 7 | // 8 | 9 | #import "ZYAlertVC.h" 10 | #import "ZYAlertView.h" 11 | #import "UIWindow+ZYUitily.h" 12 | 13 | @implementation ZYAlertVC 14 | 15 | -(void)loadView 16 | { 17 | [super loadView]; 18 | self.view = self.alertView; 19 | } 20 | - (void)viewDidLoad { 21 | [super viewDidLoad]; 22 | } 23 | 24 | #ifdef __IPHONE_7_0 25 | - (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration 26 | { 27 | if ([self respondsToSelector:@selector(setNeedsStatusBarAppearanceUpdate)]) { 28 | [self setNeedsStatusBarAppearanceUpdate]; 29 | } 30 | } 31 | #elif __IPHONE_8_0 32 | -(void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id)coordinator{ 33 | if ([self respondsToSelector:@selector(setNeedsStatusBarAppearanceUpdate)]) { 34 | [self setNeedsStatusBarAppearanceUpdate]; 35 | } 36 | } 37 | #endif 38 | 39 | - (UIInterfaceOrientationMask)supportedInterfaceOrientations 40 | { 41 | UIViewController *viewController = [self.alertView.oldKeyWindow currentViewController]; 42 | if (viewController) { 43 | return [viewController supportedInterfaceOrientations]; 44 | } 45 | return UIInterfaceOrientationMaskAll; 46 | } 47 | - (BOOL)shouldAutorotate 48 | { 49 | UIViewController *viewController = [self.alertView.oldKeyWindow currentViewController]; 50 | if (viewController) { 51 | return [viewController shouldAutorotate]; 52 | } 53 | return YES; 54 | } 55 | 56 | #ifdef __IPHONE_7_0 57 | - (UIStatusBarStyle)preferredStatusBarStyle 58 | { 59 | UIWindow *window = self.alertView.oldKeyWindow; 60 | if (!window) { 61 | window = [UIApplication sharedApplication].windows[0]; 62 | } 63 | return [[window viewControllerForStatusBarStyle] preferredStatusBarStyle]; 64 | } 65 | 66 | - (BOOL)prefersStatusBarHidden 67 | { 68 | UIWindow *window = self.alertView.oldKeyWindow; 69 | if (!window) { 70 | window = [UIApplication sharedApplication].windows[0]; 71 | } 72 | return [[window viewControllerForStatusBarHidden] prefersStatusBarHidden]; 73 | } 74 | #endif 75 | 76 | @end 77 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/Snapkit/Source/ConstraintItem.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | 31 | public final class ConstraintItem { 32 | 33 | internal weak var target: AnyObject? 34 | internal let attributes: ConstraintAttributes 35 | 36 | internal init(target: AnyObject?, attributes: ConstraintAttributes) { 37 | self.target = target 38 | self.attributes = attributes 39 | } 40 | 41 | internal var layoutConstraintItem: LayoutConstraintItem? { 42 | return self.target as? LayoutConstraintItem 43 | } 44 | 45 | } 46 | 47 | public func ==(lhs: ConstraintItem, rhs: ConstraintItem) -> Bool { 48 | // pointer equality 49 | guard lhs !== rhs else { 50 | return true 51 | } 52 | 53 | // must both have valid targets and identical attributes 54 | guard let target1 = lhs.target, 55 | let target2 = rhs.target, 56 | target1 === target2 && lhs.attributes == rhs.attributes else { 57 | return false 58 | } 59 | 60 | return true 61 | } 62 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/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 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/Snapkit/Source/ConstraintMakerEditable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | 31 | public class ConstraintMakerEditable: ConstraintMakerPriortizable { 32 | 33 | @discardableResult 34 | public func multipliedBy(_ amount: ConstraintMultiplierTarget) -> ConstraintMakerEditable { 35 | self.description.multiplier = amount 36 | return self 37 | } 38 | 39 | @discardableResult 40 | public func dividedBy(_ amount: ConstraintMultiplierTarget) -> ConstraintMakerEditable { 41 | return self.multipliedBy(1.0 / amount.constraintMultiplierTargetValue) 42 | } 43 | 44 | @discardableResult 45 | public func offset(_ amount: ConstraintOffsetTarget) -> ConstraintMakerEditable { 46 | self.description.constant = amount.constraintOffsetTargetValue 47 | return self 48 | } 49 | 50 | @discardableResult 51 | public func inset(_ amount: ConstraintInsetTarget) -> ConstraintMakerEditable { 52 | self.description.constant = amount.constraintInsetTargetValue 53 | return self 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/Snapkit/Source/ConstraintPriorityTarget.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | 31 | public protocol ConstraintPriorityTarget { 32 | 33 | var constraintPriorityTargetValue: Float { get } 34 | 35 | } 36 | 37 | extension Int: ConstraintPriorityTarget { 38 | 39 | public var constraintPriorityTargetValue: Float { 40 | return Float(self) 41 | } 42 | 43 | } 44 | 45 | extension UInt: ConstraintPriorityTarget { 46 | 47 | public var constraintPriorityTargetValue: Float { 48 | return Float(self) 49 | } 50 | 51 | } 52 | 53 | extension Float: ConstraintPriorityTarget { 54 | 55 | public var constraintPriorityTargetValue: Float { 56 | return self 57 | } 58 | 59 | } 60 | 61 | extension Double: ConstraintPriorityTarget { 62 | 63 | public var constraintPriorityTargetValue: Float { 64 | return Float(self) 65 | } 66 | 67 | } 68 | 69 | extension CGFloat: ConstraintPriorityTarget { 70 | 71 | public var constraintPriorityTargetValue: Float { 72 | return Float(self) 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/LBXScan/LBXScanLineAnimation.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LBXScanLineAnimation.swift 3 | // swiftScan 4 | // 5 | // Created by lbxia on 15/12/9. 6 | // Copyright © 2015年 xialibing. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class LBXScanLineAnimation: UIImageView { 12 | 13 | var isAnimationing = false 14 | var animationRect: CGRect = CGRect.zero 15 | 16 | func startAnimatingWithRect(animationRect: CGRect, parentView: UIView, image: UIImage?) 17 | { 18 | self.image = image 19 | self.animationRect = animationRect 20 | parentView.addSubview(self) 21 | 22 | self.isHidden = false; 23 | 24 | isAnimationing = true; 25 | 26 | if image != nil 27 | { 28 | stepAnimation() 29 | } 30 | 31 | } 32 | 33 | func stepAnimation() 34 | { 35 | if (!isAnimationing) { 36 | return; 37 | } 38 | 39 | var frame:CGRect = animationRect; 40 | 41 | let hImg = self.image!.size.height * animationRect.size.width / self.image!.size.width; 42 | 43 | frame.origin.y -= hImg; 44 | frame.size.height = hImg; 45 | self.frame = frame; 46 | self.alpha = 0.0; 47 | 48 | UIView.animate(withDuration: 1.4, animations: { () -> Void in 49 | 50 | self.alpha = 1.0; 51 | 52 | var frame = self.animationRect; 53 | let hImg = self.image!.size.height * self.animationRect.size.width / self.image!.size.width; 54 | 55 | frame.origin.y += (frame.size.height - hImg); 56 | frame.size.height = hImg; 57 | 58 | self.frame = frame; 59 | 60 | }, completion:{ (value: Bool) -> Void in 61 | 62 | self.perform(#selector(LBXScanLineAnimation.stepAnimation), with: nil, afterDelay: 0.3) 63 | }) 64 | 65 | } 66 | 67 | func stopStepAnimating() 68 | { 69 | self.isHidden = true; 70 | isAnimationing = false; 71 | } 72 | 73 | static public func instance()->LBXScanLineAnimation 74 | { 75 | return LBXScanLineAnimation() 76 | } 77 | 78 | deinit 79 | { 80 | // print("LBXScanLineAnimation deinit") 81 | stopStepAnimating() 82 | } 83 | 84 | } 85 | 86 | 87 | 88 | 89 | 90 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/Snapkit/Source/ConstraintMultiplierTarget.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | 31 | public protocol ConstraintMultiplierTarget { 32 | 33 | var constraintMultiplierTargetValue: CGFloat { get } 34 | 35 | } 36 | 37 | extension Int: ConstraintMultiplierTarget { 38 | 39 | public var constraintMultiplierTargetValue: CGFloat { 40 | return CGFloat(self) 41 | } 42 | 43 | } 44 | 45 | extension UInt: ConstraintMultiplierTarget { 46 | 47 | public var constraintMultiplierTargetValue: CGFloat { 48 | return CGFloat(self) 49 | } 50 | 51 | } 52 | 53 | extension Float: ConstraintMultiplierTarget { 54 | 55 | public var constraintMultiplierTargetValue: CGFloat { 56 | return CGFloat(self) 57 | } 58 | 59 | } 60 | 61 | extension Double: ConstraintMultiplierTarget { 62 | 63 | public var constraintMultiplierTargetValue: CGFloat { 64 | return CGFloat(self) 65 | } 66 | 67 | } 68 | 69 | extension CGFloat: ConstraintMultiplierTarget { 70 | 71 | public var constraintMultiplierTargetValue: CGFloat { 72 | return self 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/Snapkit/Source/ConstraintOffsetTarget.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | 31 | public protocol ConstraintOffsetTarget: ConstraintConstantTarget { 32 | } 33 | 34 | extension Int: ConstraintOffsetTarget { 35 | } 36 | 37 | extension UInt: ConstraintOffsetTarget { 38 | } 39 | 40 | extension Float: ConstraintOffsetTarget { 41 | } 42 | 43 | extension Double: ConstraintOffsetTarget { 44 | } 45 | 46 | extension CGFloat: ConstraintOffsetTarget { 47 | } 48 | 49 | extension ConstraintOffsetTarget { 50 | 51 | internal var constraintOffsetTargetValue: CGFloat { 52 | let offset: CGFloat 53 | if let amount = self as? Float { 54 | offset = CGFloat(amount) 55 | } else if let amount = self as? Double { 56 | offset = CGFloat(amount) 57 | } else if let amount = self as? CGFloat { 58 | offset = CGFloat(amount) 59 | } else if let amount = self as? Int { 60 | offset = CGFloat(amount) 61 | } else if let amount = self as? UInt { 62 | offset = CGFloat(amount) 63 | } else { 64 | offset = 0.0 65 | } 66 | return offset 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/Kingfisher/Sources/Kingfisher.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Kingfisher.swift 3 | // Kingfisher 4 | // 5 | // Created by Wei Wang on 16/9/14. 6 | // 7 | // Copyright (c) 2017 Wei Wang 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining a copy 10 | // of this software and associated documentation files (the "Software"), to deal 11 | // in the Software without restriction, including without limitation the rights 12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the Software is 14 | // furnished to do so, subject to the following conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be included in 17 | // all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | // THE SOFTWARE. 26 | 27 | import Foundation 28 | import ImageIO 29 | 30 | #if os(macOS) 31 | import AppKit 32 | public typealias Image = NSImage 33 | public typealias Color = NSColor 34 | public typealias ImageView = NSImageView 35 | typealias Button = NSButton 36 | #else 37 | import UIKit 38 | public typealias Image = UIImage 39 | public typealias Color = UIColor 40 | #if !os(watchOS) 41 | public typealias ImageView = UIImageView 42 | typealias Button = UIButton 43 | #endif 44 | #endif 45 | 46 | public final class Kingfisher { 47 | public let base: Base 48 | public init(_ base: Base) { 49 | self.base = base 50 | } 51 | } 52 | 53 | /** 54 | A type that has Kingfisher extensions. 55 | */ 56 | public protocol KingfisherCompatible { 57 | associatedtype CompatibleType 58 | var kf: CompatibleType { get } 59 | } 60 | 61 | public extension KingfisherCompatible { 62 | public var kf: Kingfisher { 63 | get { return Kingfisher(self) } 64 | } 65 | } 66 | 67 | extension Image: KingfisherCompatible { } 68 | #if !os(watchOS) 69 | extension ImageView: KingfisherCompatible { } 70 | extension Button: KingfisherCompatible { } 71 | #endif 72 | -------------------------------------------------------------------------------- /ZYBaseDemo/SubVCS/WebVC.swift: -------------------------------------------------------------------------------- 1 | // 2 | // WebVC.swift 3 | // ZYBase 4 | // 5 | // Created by Mzywx on 2017/2/28. 6 | // Copyright © 2017年 Mzywx. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import WebKit 11 | 12 | enum WebloadType:Int { 13 | case local 14 | case net 15 | } 16 | 17 | class WebVC: BaseWebVC { 18 | 19 | 20 | 21 | var loadType : WebloadType! 22 | var webUrl : String! 23 | 24 | override func viewDidLoad() { 25 | super.viewDidLoad() 26 | 27 | isUseWebTitle = true 28 | isShowProgress = true 29 | 30 | if loadType == .local { 31 | addJavaScriptMessages(["showMobile","showName","showSendMsg"]) 32 | } 33 | 34 | webloadHtml(urlStr: webUrl) 35 | 36 | // Do any additional setup after loading the view. 37 | } 38 | 39 | override func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage) { 40 | if message.name == "showMobile" { 41 | callJavaScript("alertMobile()") 42 | } 43 | if message.name == "showName" { 44 | callJavaScript("alertName('\(message.body)')") 45 | } 46 | if message.name == "showSendMsg" { 47 | if message.body is Array { 48 | let ary = message.body as! Array 49 | callJavaScript("alertSendMsg('\(ary[0])','\(ary[1])')") 50 | } 51 | } 52 | } 53 | 54 | override func webView(_ webView: WKWebView, runJavaScriptAlertPanelWithMessage message: String, initiatedByFrame frame: WKFrameInfo, completionHandler: @escaping () -> Void) { 55 | let alertVC = UIAlertController(title: webView.title, message: message, preferredStyle: .alert) 56 | alertVC.addAction(UIAlertAction(title: "ok", style: .cancel, handler: { (action) in 57 | completionHandler() 58 | })) 59 | self.present(alertVC, animated: true, completion: nil) 60 | } 61 | 62 | 63 | override func didReceiveMemoryWarning() { 64 | super.didReceiveMemoryWarning() 65 | // Dispose of any resources that can be recreated. 66 | } 67 | 68 | 69 | /* 70 | // MARK: - Navigation 71 | 72 | // In a storyboard-based application, you will often want to do a little preparation before navigation 73 | override func prepare(for segue: UIStoryboardSegue, sender: Any?) { 74 | // Get the new view controller using segue.destinationViewController. 75 | // Pass the selected object to the new view controller. 76 | } 77 | */ 78 | 79 | } 80 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/LBXScan/LBXScanViewStyle.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LBXScanViewStyle.swift 3 | // swiftScan 4 | // 5 | // Created by xialibing on 15/12/8. 6 | // Copyright © 2015年 xialibing. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | ///扫码区域动画效果 12 | public enum LBXScanViewAnimationStyle 13 | { 14 | case LineMove //线条上下移动 15 | case NetGrid//网格 16 | case LineStill//线条停止在扫码区域中央 17 | case None //无动画 18 | } 19 | 20 | ///扫码区域4个角位置类型 21 | public enum LBXScanViewPhotoframeAngleStyle 22 | { 23 | case Inner//内嵌,一般不显示矩形框情况下 24 | case Outer//外嵌,包围在矩形框的4个角 25 | case On //在矩形框的4个角上,覆盖 26 | } 27 | 28 | 29 | public struct LBXScanViewStyle 30 | { 31 | 32 | // MARK: - -中心位置矩形框 33 | 34 | /// 是否需要绘制扫码矩形框,默认YES 35 | public var isNeedShowRetangle:Bool = true 36 | 37 | /** 38 | * 默认扫码区域为正方形,如果扫码区域不是正方形,设置宽高比 39 | */ 40 | public var whRatio:CGFloat = 1.0 41 | 42 | /** 43 | @brief 矩形框(视频显示透明区)域向上移动偏移量,0表示扫码透明区域在当前视图中心位置,如果负值表示扫码区域下移 44 | */ 45 | public var centerUpOffset:CGFloat = 44 46 | 47 | /** 48 | * 矩形框(视频显示透明区)域离界面左边及右边距离,默认60 49 | */ 50 | public var xScanRetangleOffset:CGFloat = 60 51 | 52 | /** 53 | @brief 矩形框线条颜色,默认白色 54 | */ 55 | public var colorRetangleLine = UIColor.white 56 | 57 | 58 | //MARK -矩形框(扫码区域)周围4个角 59 | 60 | /** 61 | @brief 扫码区域的4个角类型 62 | */ 63 | public var photoframeAngleStyle = LBXScanViewPhotoframeAngleStyle.Outer 64 | 65 | //4个角的颜色 66 | public var colorAngle = UIColor(red: 0.0, green: 167.0/255.0, blue: 231.0/255.0, alpha: 1.0) 67 | 68 | //扫码区域4个角的宽度和高度 69 | public var photoframeAngleW:CGFloat = 24.0 70 | public var photoframeAngleH:CGFloat = 24.0 71 | /** 72 | @brief 扫码区域4个角的线条宽度,默认6,建议8到4之间 73 | */ 74 | public var photoframeLineW:CGFloat = 6 75 | 76 | //MARK: ----动画效果 77 | 78 | /** 79 | @brief 扫码动画效果:线条或网格 80 | */ 81 | public var anmiationStyle = LBXScanViewAnimationStyle.LineMove 82 | 83 | 84 | /** 85 | * 动画效果的图像,如线条或网格的图像 86 | */ 87 | public var animationImage:UIImage? 88 | 89 | 90 | // MARK: -非识别区域颜色,默认 RGBA (0,0,0,0.5),范围(0--1) 91 | public var color_NotRecoginitonArea:UIColor = UIColor(red: 0.0, green: 0.0, blue: 0.0, alpha: 0.5); 92 | 93 | public init() 94 | { 95 | 96 | } 97 | 98 | 99 | } 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | -------------------------------------------------------------------------------- /ZYBaseDemo/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 小黄 6 | 13 | 14 | 51 | 52 | 53 | 54 | 55 | 56 | 57 |
58 | 59 |
60 | 61 |
62 |
63 | 64 |
65 |
66 | 67 |
68 |
69 | 70 |
71 |
72 | 73 |
74 |
75 | 76 |
77 |
78 | 79 |
80 | 81 | 82 | 83 | 84 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/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 -------------------------------------------------------------------------------- /ZYBaseDemo/TestTableViewCell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TestTableViewCell.swift 3 | // BaseDemo 4 | // 5 | // Created by Mzywx on 2016/12/23. 6 | // Copyright © 2016年 Mzywx. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import ZYBase 11 | 12 | typealias ExpendClosure = () -> () 13 | 14 | class TestTableViewCell: UITableViewCell { 15 | 16 | 17 | fileprivate var btn:UIButton! 18 | fileprivate var lbl:UILabel! 19 | var expendSure : ExpendClosure? 20 | 21 | 22 | override func awakeFromNib() { 23 | super.awakeFromNib() 24 | // Initialization code 25 | 26 | 27 | 28 | } 29 | override init(style: UITableViewCellStyle, reuseIdentifier: String?) { 30 | super.init(style: style, reuseIdentifier: reuseIdentifier) 31 | creatSubviews() 32 | } 33 | 34 | 35 | func creatSubviews() { 36 | btn = creatButton("点击操作", .system) 37 | drawBorder(btn, .cyan, 6.0) 38 | btn.backgroundColor = .orange 39 | btn.addTarget(self, action: #selector(btnClick), for: .touchUpInside) 40 | self.contentView.addSubview(btn) 41 | 42 | lbl = creatLable(getFont(14), nil) 43 | lbl.numberOfLines = 0 44 | lbl.backgroundColor = .brown 45 | drawBorder(lbl, .blue, 6.0) 46 | self.contentView.addSubview(lbl) 47 | lbl.preferredMaxLayoutWidth = SCREEN_WIDTH-20 48 | 49 | btn.snp.makeConstraints { (make) in 50 | make.top.left.equalToSuperview().offset(10) 51 | make.right.equalToSuperview().offset(-10) 52 | make.height.equalTo(30) 53 | } 54 | lbl.snp.makeConstraints { (make) in 55 | make.left.right.equalTo(btn) 56 | make.top.equalTo(btn.snp.bottom).offset(10) 57 | } 58 | 59 | setAutoCellHeightCondition(self, lbl, 10) 60 | 61 | } 62 | 63 | func configData(model:TestModel) { 64 | btn.setTitle(model.isExpend! ? "合并" : "展开", for: .normal) 65 | lbl.text = model.content 66 | lbl.backgroundColor = model.isExpend! ? .brown : .orange 67 | btn.backgroundColor = model.isExpend! ? .orange : .brown 68 | } 69 | 70 | func btnClick() { 71 | if expendSure != nil { 72 | expendSure!() 73 | } 74 | } 75 | 76 | required init?(coder aDecoder: NSCoder) { 77 | fatalError("init(coder:) has not been implemented") 78 | } 79 | 80 | override func setSelected(_ selected: Bool, animated: Bool) { 81 | super.setSelected(selected, animated: animated) 82 | 83 | // Configure the view for the selected state 84 | } 85 | 86 | } 87 | -------------------------------------------------------------------------------- /ZYBaseDemo/SubVCS/WKWebVC.swift: -------------------------------------------------------------------------------- 1 | // 2 | // WKWebVC.swift 3 | // ZYBase 4 | // 5 | // Created by Mzywx on 2017/2/24. 6 | // Copyright © 2017年 Mzywx. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class WKWebVC: BaseDemoVC,UITableViewDelegate,UITableViewDataSource { 12 | 13 | 14 | fileprivate var webTab : UITableView! 15 | fileprivate var webArr : Array = [] 16 | 17 | override func viewDidLoad() { 18 | super.viewDidLoad() 19 | 20 | webArr = ["加载远程网页","加载本地网页","HTML示例"] 21 | 22 | webTab = creatTabView(self, .plain, { (make) in 23 | make.left.right.top.equalToSuperview() 24 | make.bottom.equalToSuperview() 25 | }) 26 | 27 | // Do any additional setup after loading the view. 28 | } 29 | 30 | func numberOfSections(in tableView: UITableView) -> Int { 31 | return 1 32 | } 33 | func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 34 | return webArr.count 35 | } 36 | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { 37 | var cell = tableView.dequeueReusableCell(withIdentifier: "cellID") 38 | if cell == nil { 39 | cell = UITableViewCell.init(style: .default, reuseIdentifier: "cellID") 40 | } 41 | cell?.textLabel?.text = webArr[indexPath.row] 42 | return cell! 43 | } 44 | 45 | func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { 46 | let webvc = WebVC() 47 | 48 | switch indexPath.row { 49 | case 0: 50 | webvc.webUrl = "http://www.zhuotop.com" 51 | webvc.loadType = .net 52 | case 1: 53 | webvc.webUrl = "index" 54 | webvc.loadType = .local 55 | case 2: 56 | webvc.webUrl = "BallPool" 57 | webvc.loadType = .local 58 | default: break 59 | 60 | } 61 | 62 | self.navigationController?.pushViewController(webvc, animated: true) 63 | 64 | } 65 | override func didReceiveMemoryWarning() { 66 | super.didReceiveMemoryWarning() 67 | // Dispose of any resources that can be recreated. 68 | } 69 | 70 | 71 | /* 72 | // MARK: - Navigation 73 | 74 | // In a storyboard-based application, you will often want to do a little preparation before navigation 75 | override func prepare(for segue: UIStoryboardSegue, sender: Any?) { 76 | // Get the new view controller using segue.destinationViewController. 77 | // Pass the selected object to the new view controller. 78 | } 79 | */ 80 | 81 | } 82 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/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 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/Snapkit/Source/ConstraintLayoutGuideDSL.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | 31 | @available(iOS 9.0, OSX 10.11, *) 32 | public struct ConstraintLayoutGuideDSL: ConstraintAttributesDSL { 33 | 34 | @discardableResult 35 | public func prepareConstraints(_ closure: (_ make: ConstraintMaker) -> Void) -> [Constraint] { 36 | return ConstraintMaker.prepareConstraints(item: self.guide, closure: closure) 37 | } 38 | 39 | public func makeConstraints(_ closure: (_ make: ConstraintMaker) -> Void) { 40 | ConstraintMaker.makeConstraints(item: self.guide, closure: closure) 41 | } 42 | 43 | public func remakeConstraints(_ closure: (_ make: ConstraintMaker) -> Void) { 44 | ConstraintMaker.remakeConstraints(item: self.guide, closure: closure) 45 | } 46 | 47 | public func updateConstraints(_ closure: (_ make: ConstraintMaker) -> Void) { 48 | ConstraintMaker.updateConstraints(item: self.guide, closure: closure) 49 | } 50 | 51 | public func removeConstraints() { 52 | ConstraintMaker.removeConstraints(item: self.guide) 53 | } 54 | 55 | public var target: AnyObject? { 56 | return self.guide 57 | } 58 | 59 | internal let guide: ConstraintLayoutGuide 60 | 61 | internal init(guide: ConstraintLayoutGuide) { 62 | self.guide = guide 63 | 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/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 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/Snapkit/Source/ConstraintPriority.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | public struct ConstraintPriority : ExpressibleByFloatLiteral, Equatable, Strideable { 31 | public typealias FloatLiteralType = Float 32 | 33 | public let value: Float 34 | 35 | public init(floatLiteral value: Float) { 36 | self.value = value 37 | } 38 | 39 | public init(_ value: Float) { 40 | self.value = value 41 | } 42 | 43 | public static var required: ConstraintPriority { 44 | return 1000.0 45 | } 46 | 47 | public static var high: ConstraintPriority { 48 | return 750.0 49 | } 50 | 51 | public static var medium: ConstraintPriority { 52 | #if os(OSX) 53 | return 501.0 54 | #else 55 | return 500.0 56 | #endif 57 | 58 | } 59 | 60 | public static var low: ConstraintPriority { 61 | return 250.0 62 | } 63 | 64 | public static func ==(lhs: ConstraintPriority, rhs: ConstraintPriority) -> Bool { 65 | return lhs.value == rhs.value 66 | } 67 | 68 | // MARK: Strideable 69 | 70 | public func advanced(by n: FloatLiteralType) -> ConstraintPriority { 71 | return ConstraintPriority(floatLiteral: value + n) 72 | } 73 | 74 | public func distance(to other: ConstraintPriority) -> FloatLiteralType { 75 | return other.value - value 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/Snapkit/Source/ConstraintMakerPriortizable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | 31 | public class ConstraintMakerPriortizable: ConstraintMakerFinalizable { 32 | 33 | @discardableResult 34 | public func priority(_ amount: ConstraintPriority) -> ConstraintMakerFinalizable { 35 | self.description.priority = amount.value 36 | return self 37 | } 38 | 39 | @discardableResult 40 | public func priority(_ amount: ConstraintPriorityTarget) -> ConstraintMakerFinalizable { 41 | self.description.priority = amount 42 | return self 43 | } 44 | 45 | @available(*, deprecated:3.0, message:"Use priority(.required) instead.") 46 | @discardableResult 47 | public func priorityRequired() -> ConstraintMakerFinalizable { 48 | return self.priority(.required) 49 | } 50 | 51 | @available(*, deprecated:3.0, message:"Use priority(.high) instead.") 52 | @discardableResult 53 | public func priorityHigh() -> ConstraintMakerFinalizable { 54 | return self.priority(.high) 55 | } 56 | 57 | @available(*, deprecated:3.0, message:"Use priority(.medium) instead.") 58 | @discardableResult 59 | public func priorityMedium() -> ConstraintMakerFinalizable { 60 | return self.priority(.medium) 61 | } 62 | 63 | @available(*, deprecated:3.0, message:"Use priority(.low) instead.") 64 | @discardableResult 65 | public func priorityLow() -> ConstraintMakerFinalizable { 66 | return self.priority(.low) 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/Alamofire/Source/Notifications.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Notifications.swift 3 | // 4 | // Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | import Foundation 26 | 27 | extension Notification.Name { 28 | /// Used as a namespace for all `URLSessionTask` related notifications. 29 | public struct Task { 30 | /// Posted when a `URLSessionTask` is resumed. The notification `object` contains the resumed `URLSessionTask`. 31 | public static let DidResume = Notification.Name(rawValue: "org.alamofire.notification.name.task.didResume") 32 | 33 | /// Posted when a `URLSessionTask` is suspended. The notification `object` contains the suspended `URLSessionTask`. 34 | public static let DidSuspend = Notification.Name(rawValue: "org.alamofire.notification.name.task.didSuspend") 35 | 36 | /// Posted when a `URLSessionTask` is cancelled. The notification `object` contains the cancelled `URLSessionTask`. 37 | public static let DidCancel = Notification.Name(rawValue: "org.alamofire.notification.name.task.didCancel") 38 | 39 | /// Posted when a `URLSessionTask` is completed. The notification `object` contains the completed `URLSessionTask`. 40 | public static let DidComplete = Notification.Name(rawValue: "org.alamofire.notification.name.task.didComplete") 41 | } 42 | } 43 | 44 | // MARK: - 45 | 46 | extension Notification { 47 | /// Used as a namespace for all `Notification` user info dictionary keys. 48 | public struct Key { 49 | /// User info dictionary key representing the `URLSessionTask` associated with the notification. 50 | public static let Task = "org.alamofire.notification.key.task" 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/Snapkit/Source/ConstraintDescription.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | 31 | public class ConstraintDescription { 32 | 33 | internal let item: LayoutConstraintItem 34 | internal var attributes: ConstraintAttributes 35 | internal var relation: ConstraintRelation? = nil 36 | internal var sourceLocation: (String, UInt)? = nil 37 | internal var label: String? = nil 38 | internal var related: ConstraintItem? = nil 39 | internal var multiplier: ConstraintMultiplierTarget = 1.0 40 | internal var constant: ConstraintConstantTarget = 0.0 41 | internal var priority: ConstraintPriorityTarget = 1000.0 42 | internal lazy var constraint: Constraint? = { 43 | guard let relation = self.relation, 44 | let related = self.related, 45 | let sourceLocation = self.sourceLocation else { 46 | return nil 47 | } 48 | let from = ConstraintItem(target: self.item, attributes: self.attributes) 49 | 50 | return Constraint( 51 | from: from, 52 | to: related, 53 | relation: relation, 54 | sourceLocation: sourceLocation, 55 | label: self.label, 56 | multiplier: self.multiplier, 57 | constant: self.constant, 58 | priority: self.priority 59 | ) 60 | }() 61 | 62 | // MARK: Initialization 63 | 64 | internal init(item: LayoutConstraintItem, attributes: ConstraintAttributes) { 65 | self.item = item 66 | self.attributes = attributes 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /ZYBase/Tools/ZYCustomeAlert/ExampleAlert/ZYCustomSelectAlert.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ZYCustomSelectAlert.swift 3 | // ZYBase 4 | // 5 | // Created by Mzywx on 2017/3/1. 6 | // Copyright © 2017年 Mzywx. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | public typealias ZYSelectAlertCompletionClosure = (Int) -> Void 12 | 13 | open class ZYCustomSelectAlert: UIView,UITableViewDelegate,UITableViewDataSource { 14 | public var titleArr : Array! 15 | public var completion : ZYSelectAlertCompletionClosure? 16 | 17 | lazy var selectTab: UITableView = { 18 | let tab = UITableView(frame: CGRect.init(x: 0, y: 0, width: SCREEN_WIDTH-100, height: CGFloat(self.titleArr.count)*getPtH(80)), style: .plain) 19 | tab.backgroundColor = .white 20 | tab.layer.masksToBounds = true 21 | tab.layer.cornerRadius = 4.0 22 | tab.delegate = self 23 | tab.dataSource = self 24 | tab.bounces = false 25 | return tab 26 | }() 27 | 28 | public init(_ title:String,_ selectTitles:Array,_ completion:@escaping ZYSelectAlertCompletionClosure) { 29 | super.init(frame: .zero) 30 | self.completion = completion 31 | titleArr = selectTitles 32 | titleArr.insert(title, at: 0) 33 | self.frame = CGRect(x: 50, y: (SCREEN_HEIGHT-CGFloat(self.titleArr.count)*getPtH(80))/2, width: SCREEN_WIDTH-100, height: CGFloat(self.titleArr.count)*getPtH(80)) 34 | self.addSubview(selectTab) 35 | } 36 | 37 | required public init?(coder aDecoder: NSCoder) { 38 | fatalError("init(coder:) has not been implemented") 39 | } 40 | 41 | public func numberOfSections(in tableView: UITableView) -> Int { 42 | return 1 43 | } 44 | 45 | public func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 46 | return titleArr.count 47 | } 48 | 49 | public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { 50 | var cell = tableView.dequeueReusableCell(withIdentifier: "cellID") 51 | if cell == nil { 52 | cell = UITableViewCell(style: .default, reuseIdentifier: "cellID") 53 | } 54 | if indexPath.row>0 { 55 | cell?.textLabel?.textColor = .blue; 56 | } 57 | cell?.textLabel?.text = titleArr[indexPath.row] 58 | cell?.textLabel?.font = getFont(getPtW(30)) 59 | return cell! 60 | } 61 | 62 | public func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { 63 | tableView.deselectRow(at: indexPath, animated: true) 64 | if indexPath.row>0 { 65 | if completion != nil { 66 | completion!(indexPath.row) 67 | } 68 | dismissZYAlert() 69 | } 70 | } 71 | public func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { 72 | return getPtH(80) 73 | } 74 | 75 | 76 | } 77 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/Kingfisher/Sources/Resource.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Resource.swift 3 | // Kingfisher 4 | // 5 | // Created by Wei Wang on 15/4/6. 6 | // 7 | // Copyright (c) 2017 Wei Wang 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining a copy 10 | // of this software and associated documentation files (the "Software"), to deal 11 | // in the Software without restriction, including without limitation the rights 12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the Software is 14 | // furnished to do so, subject to the following conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be included in 17 | // all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | // THE SOFTWARE. 26 | 27 | import Foundation 28 | 29 | 30 | /// `Resource` protocol defines how to download and cache a resource from network. 31 | public protocol Resource { 32 | /// The key used in cache. 33 | var cacheKey: String { get } 34 | 35 | /// The target image URL. 36 | var downloadURL: URL { get } 37 | } 38 | 39 | /** 40 | ImageResource is a simple combination of `downloadURL` and `cacheKey`. 41 | 42 | When passed to image view set methods, Kingfisher will try to download the target 43 | image from the `downloadURL`, and then store it with the `cacheKey` as the key in cache. 44 | */ 45 | public struct ImageResource: Resource { 46 | /// The key used in cache. 47 | public let cacheKey: String 48 | 49 | /// The target image URL. 50 | public let downloadURL: URL 51 | 52 | /** 53 | Create a resource. 54 | 55 | - parameter downloadURL: The target image URL. 56 | - parameter cacheKey: The cache key. If `nil`, Kingfisher will use the `absoluteString` of `downloadURL` as the key. 57 | 58 | - returns: A resource. 59 | */ 60 | public init(downloadURL: URL, cacheKey: String? = nil) { 61 | self.downloadURL = downloadURL 62 | self.cacheKey = cacheKey ?? downloadURL.absoluteString 63 | } 64 | } 65 | 66 | /** 67 | URL conforms to `Resource` in Kingfisher. 68 | The `absoluteString` of this URL is used as `cacheKey`. And the URL itself will be used as `downloadURL`. 69 | If you need customize the url and/or cache key, use `ImageResource` instead. 70 | */ 71 | extension URL: Resource { 72 | public var cacheKey: String { return absoluteString } 73 | public var downloadURL: URL { return self } 74 | } 75 | -------------------------------------------------------------------------------- /ZYBase/BaseSet/RootManager.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RootManager.swift 3 | // ZywxBase 4 | // 5 | // Created by Mzywx on 2016/12/21. 6 | // Copyright © 2016年 Mzywx. All rights reserved. 7 | // 8 | 9 | open class RootManager: NSObject { 10 | 11 | public static let shareManager = RootManager() 12 | private override init(){ 13 | 14 | } 15 | 16 | /** 17 | * 创建TabBar 18 | * - window: window 19 | * - controllers: tabBarVC的viewControllers 20 | * - titles: tabBarItem的title 21 | * - images: tabBarItem的image 22 | * - selectImages: tabBarItem的selectimage 23 | */ 24 | open func creatRootVC(_ window:UIWindow,_ controllers:Array,_ titles:Array?,_ images:Array?,_ selectImages:Array?) { 25 | 26 | NotificationCenter.default.removeObserver(self) 27 | window.rootViewController = nil 28 | 29 | var navArr:Array = [] 30 | for i in 0.. 10 | 11 | typedef NS_ENUM(NSUInteger, ZYBadgeViewAlignment) 12 | { 13 | ZYBadgeViewAlignmentTopLeft = 1, 14 | ZYBadgeViewAlignmentTopRight, 15 | ZYBadgeViewAlignmentTopCenter, 16 | ZYBadgeViewAlignmentCenterLeft, 17 | ZYBadgeViewAlignmentCenterRight, 18 | ZYBadgeViewAlignmentBottomLeft, 19 | ZYBadgeViewAlignmentBottomRight, 20 | ZYBadgeViewAlignmentBottomCenter, 21 | ZYBadgeViewAlignmentCenter 22 | }; 23 | 24 | @interface ZYBadgeView : UIView 25 | 26 | @property (nonatomic, copy) NSString *badgeText; 27 | 28 | #pragma mark - Customization 29 | 30 | @property (nonatomic, assign) ZYBadgeViewAlignment badgeAlignment UI_APPEARANCE_SELECTOR; 31 | 32 | @property (nonatomic, strong) UIColor *badgeTextColor UI_APPEARANCE_SELECTOR; 33 | @property (nonatomic, assign) CGSize badgeTextShadowOffset UI_APPEARANCE_SELECTOR; 34 | @property (nonatomic, strong) UIColor *badgeTextShadowColor UI_APPEARANCE_SELECTOR; 35 | 36 | @property (nonatomic, strong) UIFont *badgeTextFont UI_APPEARANCE_SELECTOR; 37 | 38 | @property (nonatomic, strong) UIColor *badgeBackgroundColor UI_APPEARANCE_SELECTOR; 39 | 40 | /** 41 | * Color of the overlay circle at the top. Default is semi-transparent white. 42 | */ 43 | @property (nonatomic, strong) UIColor *badgeOverlayColor UI_APPEARANCE_SELECTOR; 44 | 45 | /** 46 | * Color of the badge shadow. Default is semi-transparent black. 47 | */ 48 | @property (nonatomic, strong) UIColor *badgeShadowColor UI_APPEARANCE_SELECTOR; 49 | 50 | /** 51 | * Offset of the badge shadow. Default is 3.0 points down. 52 | */ 53 | @property (nonatomic, assign) CGSize badgeShadowSize UI_APPEARANCE_SELECTOR; 54 | 55 | /** 56 | * Width of the circle around the badge. Default is 2.0 points. 57 | */ 58 | @property (nonatomic, assign) CGFloat badgeStrokeWidth UI_APPEARANCE_SELECTOR; 59 | 60 | /** 61 | * Color of the circle around the badge. Default is white. 62 | */ 63 | @property (nonatomic, strong) UIColor *badgeStrokeColor UI_APPEARANCE_SELECTOR; 64 | 65 | /** 66 | * Allows to shift the badge by x and y points. 67 | */ 68 | @property (nonatomic, assign) CGPoint badgePositionAdjustment UI_APPEARANCE_SELECTOR; 69 | 70 | /** 71 | * You can use this to position the view if you're drawing it using drawRect instead of `-addSubview:` 72 | * (optional) If not provided, the superview frame is used. 73 | */ 74 | @property (nonatomic, assign) CGRect frameToPositionInRelationWith UI_APPEARANCE_SELECTOR; 75 | 76 | /** 77 | * The minimum width of a badge circle. We need this to avoid elipse shapes when using small fonts. 78 | */ 79 | @property (nonatomic, assign) CGFloat badgeMinWidth UI_APPEARANCE_SELECTOR; 80 | 81 | /** 82 | * Optionally init using this method to have the badge automatically added to another view. 83 | */ 84 | - (id)initWithParentView:(UIView *)parentView alignment:(ZYBadgeViewAlignment)alignment; 85 | 86 | @end 87 | -------------------------------------------------------------------------------- /ZYBase/ThirdLib/Snapkit/Source/ConstraintInsetTarget.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | 31 | public protocol ConstraintInsetTarget: ConstraintConstantTarget { 32 | } 33 | 34 | extension Int: ConstraintInsetTarget { 35 | } 36 | 37 | extension UInt: ConstraintInsetTarget { 38 | } 39 | 40 | extension Float: ConstraintInsetTarget { 41 | } 42 | 43 | extension Double: ConstraintInsetTarget { 44 | } 45 | 46 | extension CGFloat: ConstraintInsetTarget { 47 | } 48 | 49 | extension ConstraintInsets: ConstraintInsetTarget { 50 | } 51 | 52 | extension ConstraintInsetTarget { 53 | 54 | internal var constraintInsetTargetValue: ConstraintInsets { 55 | if let amount = self as? ConstraintInsets { 56 | return amount 57 | } else if let amount = self as? Float { 58 | return ConstraintInsets(top: CGFloat(amount), left: CGFloat(amount), bottom: CGFloat(amount), right: CGFloat(amount)) 59 | } else if let amount = self as? Double { 60 | return ConstraintInsets(top: CGFloat(amount), left: CGFloat(amount), bottom: CGFloat(amount), right: CGFloat(amount)) 61 | } else if let amount = self as? CGFloat { 62 | return ConstraintInsets(top: amount, left: amount, bottom: amount, right: amount) 63 | } else if let amount = self as? Int { 64 | return ConstraintInsets(top: CGFloat(amount), left: CGFloat(amount), bottom: CGFloat(amount), right: CGFloat(amount)) 65 | } else if let amount = self as? UInt { 66 | return ConstraintInsets(top: CGFloat(amount), left: CGFloat(amount), bottom: CGFloat(amount), right: CGFloat(amount)) 67 | } else { 68 | return ConstraintInsets(top: 0, left: 0, bottom: 0, right: 0) 69 | } 70 | } 71 | 72 | } 73 | --------------------------------------------------------------------------------