├── 1.gif ├── 10.gif ├── 2.gif ├── 3.gif ├── 4.gif ├── 5.gif ├── 6.gif ├── 7.gif ├── 8.gif ├── 9.gif ├── MZRefresh ├── 1.gif ├── bird.gif ├── dog.gif ├── Assets.xcassets │ ├── Contents.json │ ├── running1.imageset │ │ ├── running1@2x.png │ │ └── Contents.json │ ├── running2.imageset │ │ ├── running2@2x.png │ │ └── Contents.json │ ├── running3.imageset │ │ ├── running3@2x.png │ │ └── Contents.json │ ├── running4.imageset │ │ ├── running4@2x.png │ │ └── Contents.json │ ├── running5.imageset │ │ ├── running5@2x.png │ │ └── Contents.json │ ├── running6.imageset │ │ ├── running6@2x.png │ │ └── Contents.json │ ├── AccentColor.colorset │ │ └── Contents.json │ └── AppIcon.appiconset │ │ └── Contents.json ├── MZRefresh │ ├── MZRefresh.bundle │ │ ├── up@2x.png │ │ ├── up@3x.png │ │ ├── down@2x.png │ │ ├── down@3x.png │ │ ├── zh-Hans.lproj │ │ │ └── Localizable.strings │ │ ├── zh-Hant.lproj │ │ │ └── Localizable.strings │ │ └── en.lproj │ │ │ └── Localizable.strings │ ├── MZRefreshFooterComponent.swift │ ├── MZRefreshHeaderComponent.swift │ ├── UIImage+MZRefresh.swift │ ├── MZRefreshComponent.swift │ ├── Localized.swift │ ├── MZRefreshDate.swift │ └── MZRefreshConfig.swift ├── Info.plist ├── AppDelegate.swift ├── RefreshTypeCell.swift ├── Base.lproj │ └── LaunchScreen.storyboard ├── RefreshTypeController.swift ├── TableViewRefreshController.swift ├── OnlyGifRefreshController.swift ├── DefaultNoMoreDataController.swift ├── CustomNoMoreDataController.swift ├── NormalRefreshController.swift ├── GifRefreshController.swift ├── ViewController.swift └── CollectionViewRefreshController.swift ├── Pods ├── Target Support Files │ ├── SnapKit │ │ ├── SnapKit.modulemap │ │ ├── SnapKit-dummy.m │ │ ├── SnapKit-prefix.pch │ │ ├── SnapKit-umbrella.h │ │ ├── SnapKit.debug.xcconfig │ │ ├── SnapKit.release.xcconfig │ │ └── SnapKit-Info.plist │ ├── Pods-MZRefresh │ │ ├── Pods-MZRefresh.modulemap │ │ ├── Pods-MZRefresh-dummy.m │ │ ├── Pods-MZRefresh-frameworks-Debug-output-files.xcfilelist │ │ ├── Pods-MZRefresh-frameworks-Release-output-files.xcfilelist │ │ ├── Pods-MZRefresh-frameworks-Debug-input-files.xcfilelist │ │ ├── Pods-MZRefresh-frameworks-Release-input-files.xcfilelist │ │ ├── Pods-MZRefresh-umbrella.h │ │ ├── Pods-MZRefresh-Info.plist │ │ ├── Pods-MZRefresh.debug.xcconfig │ │ ├── Pods-MZRefresh.release.xcconfig │ │ ├── Pods-MZRefresh-acknowledgements.markdown │ │ └── Pods-MZRefresh-acknowledgements.plist │ └── NVActivityIndicatorView │ │ ├── NVActivityIndicatorView.modulemap │ │ ├── NVActivityIndicatorView-dummy.m │ │ ├── NVActivityIndicatorView-prefix.pch │ │ ├── NVActivityIndicatorView-umbrella.h │ │ ├── NVActivityIndicatorView.debug.xcconfig │ │ ├── NVActivityIndicatorView.release.xcconfig │ │ └── NVActivityIndicatorView-Info.plist ├── Manifest.lock ├── Pods.xcodeproj │ └── xcuserdata │ │ ├── cenglong.xcuserdatad │ │ └── xcschemes │ │ │ ├── xcschememanagement.plist │ │ │ ├── Pods-MZRefresh.xcscheme │ │ │ └── NVActivityIndicatorView.xcscheme │ │ └── zenglong.xcuserdatad │ │ └── xcschemes │ │ ├── xcschememanagement.plist │ │ ├── SnapKit.xcscheme │ │ ├── Pods-MZRefresh.xcscheme │ │ └── NVActivityIndicatorView.xcscheme ├── SnapKit │ ├── LICENSE │ └── Source │ │ ├── ConstraintView.swift │ │ ├── ConstraintInsets.swift │ │ ├── ConstraintDirectionalInsets.swift │ │ ├── UILayoutSupport+Extensions.swift │ │ ├── ConstraintLayoutSupport.swift │ │ ├── ConstraintLayoutGuide+Extensions.swift │ │ ├── ConstraintLayoutGuide.swift │ │ ├── ConstraintConfig.swift │ │ ├── ConstraintRelation.swift │ │ ├── Typealiases.swift │ │ ├── ConstraintMakerFinalizable.swift │ │ ├── ConstraintDirectionalInsetTarget.swift │ │ ├── ConstraintLayoutSupportDSL.swift │ │ ├── ConstraintItem.swift │ │ ├── ConstraintRelatableTarget.swift │ │ ├── ConstraintMultiplierTarget.swift │ │ ├── ConstraintOffsetTarget.swift │ │ ├── LayoutConstraint.swift │ │ ├── ConstraintPriorityTarget.swift │ │ ├── ConstraintLayoutGuideDSL.swift │ │ ├── ConstraintMakerEditable.swift │ │ ├── ConstraintPriority.swift │ │ ├── ConstraintMakerPriortizable.swift │ │ ├── ConstraintDescription.swift │ │ ├── ConstraintInsetTarget.swift │ │ └── LayoutConstraintItem.swift └── NVActivityIndicatorView │ ├── LICENSE │ └── Sources │ └── Base │ ├── NVActivityIndicatorAnimationDelegate.swift │ └── Animations │ ├── NVActivityIndicatorAnimationBlank.swift │ ├── NVActivityIndicatorAnimationSemiCircleSpin.swift │ ├── NVActivityIndicatorAnimationBallDoubleBounce.swift │ ├── NVActivityIndicatorAnimationLineScale.swift │ ├── NVActivityIndicatorAnimationLineScaleParty.swift │ ├── NVActivityIndicatorAnimationBallScale.swift │ ├── NVActivityIndicatorAnimationBallClipRotate.swift │ ├── NVActivityIndicatorAnimationLineScalePulseOut.swift │ ├── NVActivityIndicatorAnimationLineScalePulseOutRapid.swift │ ├── NVActivityIndicatorAnimationBallPulse.swift │ ├── NVActivityIndicatorAnimationBallScaleRipple.swift │ ├── NVActivityIndicatorAnimationBallPulseSync.swift │ ├── NVActivityIndicatorAnimationAudioEqualizer.swift │ ├── NVActivityIndicatorAnimationBallScaleMultiple.swift │ ├── NVActivityIndicatorAnimationBallGridBeat.swift │ ├── NVActivityIndicatorAnimationBallScaleRippleMultiple.swift │ ├── NVActivityIndicatorAnimationBallBeat.swift │ ├── NVActivityIndicatorAnimationCircleStrokeSpin.swift │ └── NVActivityIndicatorAnimationBallRotateChase.swift ├── Podfile ├── MZRefresh.xcodeproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcuserdata │ │ └── cenglong.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── xcuserdata │ ├── cenglong.xcuserdatad │ └── xcschemes │ │ └── xcschememanagement.plist │ └── zenglong.xcuserdatad │ └── xcschemes │ └── xcschememanagement.plist ├── MZRefresh.xcworkspace ├── xcuserdata │ ├── cenglong.xcuserdatad │ │ ├── UserInterfaceState.xcuserstate │ │ └── xcdebugger │ │ │ └── Breakpoints_v2.xcbkptlist │ └── zenglong.xcuserdatad │ │ ├── UserInterfaceState.xcuserstate │ │ └── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist ├── contents.xcworkspacedata └── xcshareddata │ └── IDEWorkspaceChecks.plist ├── CHANGELOG.md ├── Podfile.lock ├── MZRefresh.podspec └── LICENSE /1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1691665955/MZRefresh/HEAD/1.gif -------------------------------------------------------------------------------- /10.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1691665955/MZRefresh/HEAD/10.gif -------------------------------------------------------------------------------- /2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1691665955/MZRefresh/HEAD/2.gif -------------------------------------------------------------------------------- /3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1691665955/MZRefresh/HEAD/3.gif -------------------------------------------------------------------------------- /4.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1691665955/MZRefresh/HEAD/4.gif -------------------------------------------------------------------------------- /5.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1691665955/MZRefresh/HEAD/5.gif -------------------------------------------------------------------------------- /6.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1691665955/MZRefresh/HEAD/6.gif -------------------------------------------------------------------------------- /7.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1691665955/MZRefresh/HEAD/7.gif -------------------------------------------------------------------------------- /8.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1691665955/MZRefresh/HEAD/8.gif -------------------------------------------------------------------------------- /9.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1691665955/MZRefresh/HEAD/9.gif -------------------------------------------------------------------------------- /MZRefresh/1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1691665955/MZRefresh/HEAD/MZRefresh/1.gif -------------------------------------------------------------------------------- /MZRefresh/bird.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1691665955/MZRefresh/HEAD/MZRefresh/bird.gif -------------------------------------------------------------------------------- /MZRefresh/dog.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1691665955/MZRefresh/HEAD/MZRefresh/dog.gif -------------------------------------------------------------------------------- /MZRefresh/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /MZRefresh/MZRefresh/MZRefresh.bundle/up@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1691665955/MZRefresh/HEAD/MZRefresh/MZRefresh/MZRefresh.bundle/up@2x.png -------------------------------------------------------------------------------- /MZRefresh/MZRefresh/MZRefresh.bundle/up@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1691665955/MZRefresh/HEAD/MZRefresh/MZRefresh/MZRefresh.bundle/up@3x.png -------------------------------------------------------------------------------- /MZRefresh/MZRefresh/MZRefresh.bundle/down@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1691665955/MZRefresh/HEAD/MZRefresh/MZRefresh/MZRefresh.bundle/down@2x.png -------------------------------------------------------------------------------- /MZRefresh/MZRefresh/MZRefresh.bundle/down@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1691665955/MZRefresh/HEAD/MZRefresh/MZRefresh/MZRefresh.bundle/down@3x.png -------------------------------------------------------------------------------- /MZRefresh/Assets.xcassets/running1.imageset/running1@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1691665955/MZRefresh/HEAD/MZRefresh/Assets.xcassets/running1.imageset/running1@2x.png -------------------------------------------------------------------------------- /MZRefresh/Assets.xcassets/running2.imageset/running2@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1691665955/MZRefresh/HEAD/MZRefresh/Assets.xcassets/running2.imageset/running2@2x.png -------------------------------------------------------------------------------- /MZRefresh/Assets.xcassets/running3.imageset/running3@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1691665955/MZRefresh/HEAD/MZRefresh/Assets.xcassets/running3.imageset/running3@2x.png -------------------------------------------------------------------------------- /MZRefresh/Assets.xcassets/running4.imageset/running4@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1691665955/MZRefresh/HEAD/MZRefresh/Assets.xcassets/running4.imageset/running4@2x.png -------------------------------------------------------------------------------- /MZRefresh/Assets.xcassets/running5.imageset/running5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1691665955/MZRefresh/HEAD/MZRefresh/Assets.xcassets/running5.imageset/running5@2x.png -------------------------------------------------------------------------------- /MZRefresh/Assets.xcassets/running6.imageset/running6@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1691665955/MZRefresh/HEAD/MZRefresh/Assets.xcassets/running6.imageset/running6@2x.png -------------------------------------------------------------------------------- /Pods/Target Support Files/SnapKit/SnapKit.modulemap: -------------------------------------------------------------------------------- 1 | framework module SnapKit { 2 | umbrella header "SnapKit-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SnapKit/SnapKit-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_SnapKit : NSObject 3 | @end 4 | @implementation PodsDummy_SnapKit 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-MZRefresh/Pods-MZRefresh.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_MZRefresh { 2 | umbrella header "Pods-MZRefresh-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | platform :ios, '10.0' 2 | inhibit_all_warnings! 3 | 4 | target 'MZRefresh' do 5 | use_frameworks! 6 | 7 | pod 'NVActivityIndicatorView' 8 | pod 'SnapKit', '~> 5.0.1' 9 | 10 | end 11 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-MZRefresh/Pods-MZRefresh-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_MZRefresh : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_MZRefresh 5 | @end 6 | -------------------------------------------------------------------------------- /MZRefresh/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /MZRefresh.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /MZRefresh.xcworkspace/xcuserdata/cenglong.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1691665955/MZRefresh/HEAD/MZRefresh.xcworkspace/xcuserdata/cenglong.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /MZRefresh.xcworkspace/xcuserdata/zenglong.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1691665955/MZRefresh/HEAD/MZRefresh.xcworkspace/xcuserdata/zenglong.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /MZRefresh/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Pods/Target Support Files/NVActivityIndicatorView/NVActivityIndicatorView.modulemap: -------------------------------------------------------------------------------- 1 | framework module NVActivityIndicatorView { 2 | umbrella header "NVActivityIndicatorView-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-MZRefresh/Pods-MZRefresh-frameworks-Debug-output-files.xcfilelist: -------------------------------------------------------------------------------- 1 | ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/NVActivityIndicatorView.framework 2 | ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SnapKit.framework -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-MZRefresh/Pods-MZRefresh-frameworks-Release-output-files.xcfilelist: -------------------------------------------------------------------------------- 1 | ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/NVActivityIndicatorView.framework 2 | ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SnapKit.framework -------------------------------------------------------------------------------- /Pods/Target Support Files/NVActivityIndicatorView/NVActivityIndicatorView-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_NVActivityIndicatorView : NSObject 3 | @end 4 | @implementation PodsDummy_NVActivityIndicatorView 5 | @end 6 | -------------------------------------------------------------------------------- /MZRefresh.xcworkspace/xcuserdata/zenglong.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | -------------------------------------------------------------------------------- /MZRefresh.xcodeproj/project.xcworkspace/xcuserdata/cenglong.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1691665955/MZRefresh/HEAD/MZRefresh.xcodeproj/project.xcworkspace/xcuserdata/cenglong.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /MZRefresh/MZRefresh/MZRefreshFooterComponent.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MZRefreshFooterComponent.swift 3 | // MZRefresh 4 | // 5 | // Created by 曾龙 on 2022/6/7. 6 | // 7 | 8 | import Foundation 9 | 10 | public protocol MZRefreshFooterComponent: MZRefreshComponent { 11 | 12 | } 13 | -------------------------------------------------------------------------------- /MZRefresh/MZRefresh/MZRefreshHeaderComponent.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MZRefreshHeaderComponent.swift 3 | // MZRefresh 4 | // 5 | // Created by 曾龙 on 2022/6/7. 6 | // 7 | 8 | import Foundation 9 | 10 | public protocol MZRefreshHeaderComponent: MZRefreshComponent { 11 | 12 | } 13 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-MZRefresh/Pods-MZRefresh-frameworks-Debug-input-files.xcfilelist: -------------------------------------------------------------------------------- 1 | ${PODS_ROOT}/Target Support Files/Pods-MZRefresh/Pods-MZRefresh-frameworks.sh 2 | ${BUILT_PRODUCTS_DIR}/NVActivityIndicatorView/NVActivityIndicatorView.framework 3 | ${BUILT_PRODUCTS_DIR}/SnapKit/SnapKit.framework -------------------------------------------------------------------------------- /Pods/Target Support Files/SnapKit/SnapKit-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-MZRefresh/Pods-MZRefresh-frameworks-Release-input-files.xcfilelist: -------------------------------------------------------------------------------- 1 | ${PODS_ROOT}/Target Support Files/Pods-MZRefresh/Pods-MZRefresh-frameworks.sh 2 | ${BUILT_PRODUCTS_DIR}/NVActivityIndicatorView/NVActivityIndicatorView.framework 3 | ${BUILT_PRODUCTS_DIR}/SnapKit/SnapKit.framework -------------------------------------------------------------------------------- /MZRefresh.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /MZRefresh.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Pods/Target Support Files/NVActivityIndicatorView/NVActivityIndicatorView-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /MZRefresh.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SnapKit/SnapKit-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double SnapKitVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char SnapKitVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-MZRefresh/Pods-MZRefresh-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_MZRefreshVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_MZRefreshVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /MZRefresh/Assets.xcassets/running1.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "filename" : "running1@2x.png", 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MZRefresh/Assets.xcassets/running2.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "filename" : "running2@2x.png", 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MZRefresh/Assets.xcassets/running3.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "filename" : "running3@2x.png", 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MZRefresh/Assets.xcassets/running4.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "filename" : "running4@2x.png", 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MZRefresh/Assets.xcassets/running5.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "filename" : "running5@2x.png", 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MZRefresh/Assets.xcassets/running6.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "filename" : "running6@2x.png", 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ### 0.0.9 2 | 3 | - 更新时间 4 | 5 | 2023年12月7日 6 | 7 | - 新增 8 | 9 | 无 10 | 11 | - 优化 12 | 13 | 1、修复“只有上拉加载,没有下拉刷新,导致不能手动触发上拉加载”的问题 14 | 15 | 16 | ### 0.0.8 17 | 18 | - 更新时间 19 | 20 | 2023年7月15日 21 | 22 | - 新增 23 | 24 | 无 25 | 26 | - 优化 27 | 28 | 1、解决线上版本图片无法显示的问题 29 | 30 | 31 | ### 0.0.6 32 | 33 | - 更新时间 34 | 35 | 2023年3月17日 36 | 37 | - 新增 38 | 39 | 无 40 | 41 | - 优化 42 | 43 | 1、优化SnapKit布局刷新组件显示异常的问题 44 | -------------------------------------------------------------------------------- /MZRefresh.xcodeproj/xcuserdata/cenglong.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | MZRefresh.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 2 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /MZRefresh.xcodeproj/xcuserdata/zenglong.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | MZRefresh.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 3 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Pods/Target Support Files/NVActivityIndicatorView/NVActivityIndicatorView-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double NVActivityIndicatorViewVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char NVActivityIndicatorViewVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /MZRefresh/MZRefresh/MZRefresh.bundle/zh-Hans.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | /* 2 | Localizable.strings 3 | MZRefresh 4 | 5 | Created by 曾龙 on 2022/1/14. 6 | 7 | */ 8 | 9 | "pull_down_to_refresh" = "下拉可以刷新"; 10 | "release_to_refresh" = "松开立即刷新"; 11 | "loading" = "正在刷新数据中..."; 12 | 13 | "tap_or_pull_up_to_load_more" = "点击或上拉加载更多"; 14 | "pull_up_to_load_more" = "上拉可以加载更多"; 15 | "release_to_load_more" = "松开立即加载更多"; 16 | "no_more_data" = "已经全部加载完毕"; 17 | 18 | "last_update_time" = "最后更新:"; 19 | "today" = "今天"; 20 | "no_record" = "无记录"; 21 | -------------------------------------------------------------------------------- /MZRefresh/MZRefresh/MZRefresh.bundle/zh-Hant.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | /* 2 | Localizable.strings 3 | MZRefresh 4 | 5 | Created by 曾龙 on 2022/1/14. 6 | 7 | */ 8 | 9 | "pull_down_to_refresh" = "下拉可以刷新"; 10 | "release_to_refresh" = "鬆開立即刷新"; 11 | "loading" = "正在刷新數據中..."; 12 | 13 | "tap_or_pull_up_to_load_more" = "點擊或上拉加載更多"; 14 | "pull_up_to_load_more" = "上拉可以加載更多"; 15 | "release_to_load_more" = "鬆開立即加載更多"; 16 | "no_more_data" = "已經全部加載完畢"; 17 | 18 | "last_update_time" = "最後更新:"; 19 | "today" = "今天"; 20 | "no_record" = "無記錄"; 21 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - NVActivityIndicatorView (5.1.1): 3 | - NVActivityIndicatorView/Base (= 5.1.1) 4 | - NVActivityIndicatorView/Base (5.1.1) 5 | - SnapKit (5.0.1) 6 | 7 | DEPENDENCIES: 8 | - NVActivityIndicatorView 9 | - SnapKit (~> 5.0.1) 10 | 11 | SPEC REPOS: 12 | trunk: 13 | - NVActivityIndicatorView 14 | - SnapKit 15 | 16 | SPEC CHECKSUMS: 17 | NVActivityIndicatorView: 1f6c5687f1171810aa27a3296814dc2d7dec3667 18 | SnapKit: 97b92857e3df3a0c71833cce143274bf6ef8e5eb 19 | 20 | PODFILE CHECKSUM: 0e41b0c297435ec05d41358514414e1c9b43ced5 21 | 22 | COCOAPODS: 1.11.3 23 | -------------------------------------------------------------------------------- /Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - NVActivityIndicatorView (5.1.1): 3 | - NVActivityIndicatorView/Base (= 5.1.1) 4 | - NVActivityIndicatorView/Base (5.1.1) 5 | - SnapKit (5.0.1) 6 | 7 | DEPENDENCIES: 8 | - NVActivityIndicatorView 9 | - SnapKit (~> 5.0.1) 10 | 11 | SPEC REPOS: 12 | trunk: 13 | - NVActivityIndicatorView 14 | - SnapKit 15 | 16 | SPEC CHECKSUMS: 17 | NVActivityIndicatorView: 1f6c5687f1171810aa27a3296814dc2d7dec3667 18 | SnapKit: 97b92857e3df3a0c71833cce143274bf6ef8e5eb 19 | 20 | PODFILE CHECKSUM: 0e41b0c297435ec05d41358514414e1c9b43ced5 21 | 22 | COCOAPODS: 1.11.3 23 | -------------------------------------------------------------------------------- /MZRefresh/MZRefresh/MZRefresh.bundle/en.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | /* 2 | Localizable.strings 3 | MZRefresh 4 | 5 | Created by 曾龙 on 2022/1/14. 6 | 7 | */ 8 | 9 | "pull_down_to_refresh" = "Pull down to refresh"; 10 | "release_to_refresh" = "Release to refresh"; 11 | "loading" = "Loading..."; 12 | 13 | "tap_or_pull_up_to_load_more" = "Tap or pull up to load more"; 14 | "pull_up_to_load_more" = "Pull up to load more"; 15 | "release_to_load_more" = "Release to load more"; 16 | "no_more_data" = "No more data"; 17 | 18 | "last_update_time" = "Last update: "; 19 | "today" = "Today"; 20 | "no_record" = "No record"; 21 | -------------------------------------------------------------------------------- /MZRefresh.xcworkspace/xcuserdata/cenglong.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 9 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/cenglong.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | NVActivityIndicatorView.xcscheme 8 | 9 | isShown 10 | 11 | orderHint 12 | 0 13 | 14 | Pods-MZRefresh.xcscheme 15 | 16 | isShown 17 | 18 | orderHint 19 | 1 20 | 21 | 22 | SuppressBuildableAutocreation 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /MZRefresh.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |spec| 2 | spec.name = "MZRefresh" 3 | spec.version = "0.0.9" 4 | spec.summary = "Swift下拉刷新、上拉加载组件,简单易用,适用于UIScrollView、UITableView、UICollectionView等继承于UIScrollView的组件。" 5 | spec.homepage = "https://github.com/1691665955/MZRefresh" 6 | spec.authors = { 'MZ' => '1691665955@qq.com' } 7 | spec.license = { :type => "MIT", :file => "LICENSE" } 8 | spec.source = { :git => "https://github.com/1691665955/MZRefresh.git", :tag => spec.version} 9 | spec.platform = :ios, "9.0" 10 | spec.swift_version = '5.0' 11 | spec.source_files = "MZRefresh/MZRefresh/*.swift" 12 | spec.resources = 'MZRefresh/MZRefresh/*.{png,bundle}' 13 | spec.dependency 'NVActivityIndicatorView' 14 | end 15 | -------------------------------------------------------------------------------- /MZRefresh/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // MZRefresh 4 | // 5 | // Created by 曾龙 on 2022/1/10. 6 | // 7 | 8 | import UIKit 9 | 10 | @main 11 | class AppDelegate: UIResponder, UIApplicationDelegate { 12 | 13 | var window: UIWindow? 14 | 15 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 16 | 17 | // MZRefreshConfig.shareInstance.setRefreshStatusColor(.brown) 18 | // MZRefreshConfig.shareInstance.setRefreshStatusFont(.systemFont(ofSize: 18)) 19 | // MZRefreshConfig.shareInstance.setRefreshTimeColor(.cyan) 20 | // MZRefreshConfig.shareInstance.setRefreshTimeFont(.systemFont(ofSize: 12)) 21 | 22 | return true 23 | } 24 | 25 | } 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SnapKit/SnapKit.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/SnapKit 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LIBRARY_SEARCH_PATHS = $(inherited) "${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift 5 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS -suppress-warnings 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_ROOT = ${SRCROOT} 9 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/SnapKit 10 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 11 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 12 | SKIP_INSTALL = YES 13 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 14 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SnapKit/SnapKit.release.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/SnapKit 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LIBRARY_SEARCH_PATHS = $(inherited) "${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift 5 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS -suppress-warnings 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_ROOT = ${SRCROOT} 9 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/SnapKit 10 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 11 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 12 | SKIP_INSTALL = YES 13 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 14 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/zenglong.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | NVActivityIndicatorView.xcscheme 8 | 9 | isShown 10 | 11 | orderHint 12 | 0 13 | 14 | Pods-MZRefresh.xcscheme 15 | 16 | isShown 17 | 18 | orderHint 19 | 1 20 | 21 | SnapKit.xcscheme 22 | 23 | isShown 24 | 25 | orderHint 26 | 2 27 | 28 | 29 | SuppressBuildableAutocreation 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SnapKit/SnapKit-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 | 5.0.1 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/NVActivityIndicatorView/NVActivityIndicatorView.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/NVActivityIndicatorView 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LIBRARY_SEARCH_PATHS = $(inherited) "${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift 5 | OTHER_LDFLAGS = $(inherited) -framework "QuartzCore" -framework "UIKit" 6 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS -suppress-warnings 7 | PODS_BUILD_DIR = ${BUILD_DIR} 8 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 9 | PODS_ROOT = ${SRCROOT} 10 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/NVActivityIndicatorView 11 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 12 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 13 | SKIP_INSTALL = YES 14 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 15 | -------------------------------------------------------------------------------- /Pods/Target Support Files/NVActivityIndicatorView/NVActivityIndicatorView.release.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/NVActivityIndicatorView 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LIBRARY_SEARCH_PATHS = $(inherited) "${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift 5 | OTHER_LDFLAGS = $(inherited) -framework "QuartzCore" -framework "UIKit" 6 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS -suppress-warnings 7 | PODS_BUILD_DIR = ${BUILD_DIR} 8 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 9 | PODS_ROOT = ${SRCROOT} 10 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/NVActivityIndicatorView 11 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 12 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 13 | SKIP_INSTALL = YES 14 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 15 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-MZRefresh/Pods-MZRefresh-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 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/NVActivityIndicatorView/NVActivityIndicatorView-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 | 5.1.1 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 1691665955 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 | -------------------------------------------------------------------------------- /Pods/SnapKit/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /Pods/NVActivityIndicatorView/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Vinh Nguyen 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 | -------------------------------------------------------------------------------- /MZRefresh/MZRefresh/UIImage+MZRefresh.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+MZRefresh.swift 3 | // MZRefresh 4 | // 5 | // Created by 曾龙 on 2022/1/15. 6 | // 7 | 8 | import Foundation 9 | import UIKit 10 | 11 | extension UIImage { 12 | func color(atPoint point: CGPoint) -> UIColor { 13 | let imageWidth = self.size.width 14 | let imageHeight = self.size.width 15 | if !CGRect(x: 0, y: 0, width: imageWidth, height: imageHeight).contains(point) { 16 | return .clear 17 | } 18 | 19 | let provider = self.cgImage?.dataProvider 20 | let providerData = provider?.data 21 | let data = CFDataGetBytePtr(providerData) 22 | 23 | let x = Int(trunc(point.x)) 24 | let y = Int(trunc(point.y)) 25 | 26 | let numberOfComponents = 4 27 | let pixelData = ((Int(size.width) * y) + x) * numberOfComponents 28 | 29 | let r = CGFloat(data![pixelData]) / 255.0 30 | let g = CGFloat(data![pixelData + 1]) / 255.0 31 | let b = CGFloat(data![pixelData + 2]) / 255.0 32 | let a = CGFloat(data![pixelData + 3]) / 255.0 33 | 34 | return UIColor(red: r, green: g, blue: b, alpha: a) 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /MZRefresh/MZRefresh/MZRefreshComponent.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MZRefreshComponent.swift 3 | // MZRefresh 4 | // 5 | // Created by 曾龙 on 2022/1/11. 6 | // 7 | 8 | import Foundation 9 | import UIKit 10 | 11 | let MZRefreshScreenWidth = UIScreen.main.bounds.width 12 | public typealias MZRefreshBlock = (_ oldStatus: MZRefreshStatus, _ newStatus: MZRefreshStatus) -> Void 13 | 14 | public enum MZRefreshStatus: Int { 15 | case normal = 0 16 | case ready = 1 17 | case refresh = 2 18 | } 19 | 20 | public protocol MZRefreshComponent { 21 | 22 | /// 刷新组件的宽度 23 | var refreshWidth: CGFloat {get set} 24 | 25 | /// 刷新状态 26 | var currentStatus: MZRefreshStatus { get set } 27 | 28 | /// 下拉刷新 29 | var refreshNormalView: UIView { get } 30 | 31 | /// 释放刷新 32 | var refreshReadyView: UIView { get } 33 | 34 | /// 正在刷新 35 | var refreshingView: UIView { get } 36 | 37 | /// 刷新条件 38 | var refreshOffset: CGFloat { get } 39 | 40 | /// 开始刷新 41 | var beginRefresh: () -> Void { get } 42 | 43 | /// 刷新状态更新 44 | var statusUpdate: MZRefreshBlock? {get set} 45 | 46 | /// 滚动高度百分比动态监听,根据百分比处理过渡动画 47 | func didScroll(_ percent: CGFloat) 48 | 49 | /// 刷新组件宽度更新 50 | func refreshWidthUpdate(_ width: CGFloat) 51 | } 52 | -------------------------------------------------------------------------------- /MZRefresh/MZRefresh/Localized.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Localized.swift 3 | // MZRefresh 4 | // 5 | // Created by 曾龙 on 2022/1/14. 6 | // 7 | 8 | import Foundation 9 | 10 | extension String { 11 | 12 | func localized( 13 | _ language: Language = .current, 14 | value: String? = nil, 15 | table: String = "Localizable" 16 | ) -> String { 17 | guard let path = Bundle.refreshBundle?.path(forResource: language.rawValue, ofType: "lproj") else { 18 | return self 19 | } 20 | return Bundle(path: path)?.localizedString(forKey: self, value: value, table: table) ?? self 21 | } 22 | } 23 | 24 | public enum Language: String { 25 | case en 26 | case zhHans = "zh-Hans" 27 | case zhHant = "zh-Hant" 28 | 29 | public static var current: Language = { 30 | guard let language = Locale.preferredLanguages.first else { return .en } 31 | 32 | if language.contains("zh-HK") { return .zhHant } 33 | 34 | if language.contains("zh-Hant") { return .zhHant } 35 | 36 | if language.contains("zh-Hans") { return .zhHans } 37 | 38 | return Language(rawValue: language) ?? .en 39 | }() 40 | } 41 | 42 | extension Bundle { 43 | static let refreshBundle: Bundle? = { 44 | let containnerBundle = Bundle(for: MZRefreshNormalHeader.self) 45 | return Bundle(path: containnerBundle.path(forResource: "MZRefresh", ofType: "bundle")!) ?? .main 46 | }() 47 | } 48 | 49 | -------------------------------------------------------------------------------- /Pods/SnapKit/Source/ConstraintView.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 ConstraintView = UIView 33 | #else 34 | public typealias ConstraintView = NSView 35 | #endif 36 | -------------------------------------------------------------------------------- /Pods/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 = NSEdgeInsets 35 | #endif 36 | -------------------------------------------------------------------------------- /Pods/SnapKit/Source/ConstraintDirectionalInsets.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 11.0, tvOS 11.0, *) 33 | public typealias ConstraintDirectionalInsets = NSDirectionalEdgeInsets 34 | #endif 35 | -------------------------------------------------------------------------------- /Pods/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 | var snp: ConstraintLayoutSupportDSL { 33 | return ConstraintLayoutSupportDSL(support: self) 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /Pods/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 | -------------------------------------------------------------------------------- /Pods/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 | var snp: ConstraintLayoutGuideDSL { 33 | return ConstraintLayoutGuideDSL(guide: self) 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /Pods/NVActivityIndicatorView/Sources/Base/NVActivityIndicatorAnimationDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NVActivityIndicatorDelegate.swift 3 | // NVActivityIndicatorView 4 | // 5 | // The MIT License (MIT) 6 | 7 | // Copyright (c) 2016 Vinh Nguyen 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 all 17 | // 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 THE 25 | // SOFTWARE. 26 | // 27 | 28 | #if canImport(UIKit) 29 | import UIKit 30 | 31 | // swiftlint:disable:next class_delegate_protocol 32 | protocol NVActivityIndicatorAnimationDelegate { 33 | func setUpAnimation(in layer: CALayer, size: CGSize, color: UIColor) 34 | } 35 | #endif 36 | -------------------------------------------------------------------------------- /MZRefresh/MZRefresh/MZRefreshDate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MZRefreshDate.swift 3 | // MZRefresh 4 | // 5 | // Created by 曾龙 on 2022/1/13. 6 | // 7 | 8 | import Foundation 9 | 10 | let MZRefreshDateKey = "MZRefreshDateKey" 11 | 12 | public struct MZRefreshDate { 13 | 14 | /// 保存当前刷新时间 15 | public static func saveRefreshDate() { 16 | let userDefaults = UserDefaults.standard 17 | userDefaults.setValue(Date(), forKey: MZRefreshDateKey) 18 | userDefaults.synchronize() 19 | } 20 | 21 | /// 获取上次刷新时间 22 | /// - Returns: 上次刷新时间 23 | public static func getLastRefreshTime() -> String { 24 | guard let date = UserDefaults.standard.value(forKey: MZRefreshDateKey) as? Date else { 25 | return "no_record".localized() 26 | } 27 | let formatter = DateFormatter() 28 | formatter.dateFormat = "yyyy-MM-dd HH:mm" 29 | let lastTime = formatter.string(from: date) 30 | let nowTime = formatter.string(from: Date()) 31 | if lastTime[lastTime.startIndex...lastTime.index(lastTime.startIndex, offsetBy: 10)] == nowTime[nowTime.startIndex...nowTime.index(nowTime.startIndex, offsetBy: 10)] { 32 | return "\("today".localized()) " + String(lastTime[lastTime.index(lastTime.endIndex, offsetBy: -5)...]) 33 | } else if lastTime[lastTime.startIndex...lastTime.index(lastTime.startIndex, offsetBy: 5)] == nowTime[nowTime.startIndex...nowTime.index(nowTime.startIndex, offsetBy: 5)] { 34 | return String(lastTime[lastTime.index(lastTime.startIndex, offsetBy: 5)...]) 35 | } else { 36 | return lastTime 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-MZRefresh/Pods-MZRefresh.debug.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/NVActivityIndicatorView" "${PODS_CONFIGURATION_BUILD_DIR}/SnapKit" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/NVActivityIndicatorView/NVActivityIndicatorView.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/SnapKit/SnapKit.framework/Headers" 6 | LD_RUNPATH_SEARCH_PATHS = $(inherited) /usr/lib/swift '@executable_path/Frameworks' '@loader_path/Frameworks' 7 | LIBRARY_SEARCH_PATHS = $(inherited) "${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift 8 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_CONFIGURATION_BUILD_DIR}/NVActivityIndicatorView/NVActivityIndicatorView.framework/Headers" -isystem "${PODS_CONFIGURATION_BUILD_DIR}/SnapKit/SnapKit.framework/Headers" -iframework "${PODS_CONFIGURATION_BUILD_DIR}/NVActivityIndicatorView" -iframework "${PODS_CONFIGURATION_BUILD_DIR}/SnapKit" 9 | OTHER_LDFLAGS = $(inherited) -framework "NVActivityIndicatorView" -framework "QuartzCore" -framework "SnapKit" -framework "UIKit" 10 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 11 | PODS_BUILD_DIR = ${BUILD_DIR} 12 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 13 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 14 | PODS_ROOT = ${SRCROOT}/Pods 15 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 16 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-MZRefresh/Pods-MZRefresh.release.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/NVActivityIndicatorView" "${PODS_CONFIGURATION_BUILD_DIR}/SnapKit" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/NVActivityIndicatorView/NVActivityIndicatorView.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/SnapKit/SnapKit.framework/Headers" 6 | LD_RUNPATH_SEARCH_PATHS = $(inherited) /usr/lib/swift '@executable_path/Frameworks' '@loader_path/Frameworks' 7 | LIBRARY_SEARCH_PATHS = $(inherited) "${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift 8 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_CONFIGURATION_BUILD_DIR}/NVActivityIndicatorView/NVActivityIndicatorView.framework/Headers" -isystem "${PODS_CONFIGURATION_BUILD_DIR}/SnapKit/SnapKit.framework/Headers" -iframework "${PODS_CONFIGURATION_BUILD_DIR}/NVActivityIndicatorView" -iframework "${PODS_CONFIGURATION_BUILD_DIR}/SnapKit" 9 | OTHER_LDFLAGS = $(inherited) -framework "NVActivityIndicatorView" -framework "QuartzCore" -framework "SnapKit" -framework "UIKit" 10 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 11 | PODS_BUILD_DIR = ${BUILD_DIR} 12 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 13 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 14 | PODS_ROOT = ${SRCROOT}/Pods 15 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 16 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 17 | -------------------------------------------------------------------------------- /Pods/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 | -------------------------------------------------------------------------------- /Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBlank.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NVActivityIndicatorAnimationBlank.swift 3 | // NVActivityIndicatorView 4 | // 5 | // The MIT License (MIT) 6 | 7 | // Copyright (c) 2016 Vinh Nguyen 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 all 17 | // 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 THE 25 | // SOFTWARE. 26 | // 27 | 28 | #if canImport(UIKit) 29 | import UIKit 30 | 31 | class NVActivityIndicatorAnimationBlank: NVActivityIndicatorAnimationDelegate { 32 | 33 | func setUpAnimation(in _: CALayer, size _: CGSize, color _: UIColor) { 34 | // Do nothing 35 | } 36 | } 37 | #endif 38 | -------------------------------------------------------------------------------- /MZRefresh/RefreshTypeCell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RefreshTypeCell.swift 3 | // MZRefresh 4 | // 5 | // Created by 曾龙 on 2022/1/13. 6 | // 7 | 8 | import UIKit 9 | import NVActivityIndicatorView 10 | 11 | class RefreshTypeCell: UICollectionViewCell { 12 | var indicatorType: NVActivityIndicatorType? { 13 | didSet { 14 | self.indicatorView?.stopAnimating() 15 | self.indicatorView?.removeFromSuperview() 16 | let space: CGFloat = 15.0 17 | let itemWidth = (SCREEN_WIDTH - space * 4) / 3 18 | self.indicatorView = NVActivityIndicatorView(frame: CGRect(x: 0, y: 0, width: itemWidth, height: itemWidth), type: indicatorType ?? .blank, color: .brown, padding: 10) 19 | self.contentView.addSubview(self.indicatorView!) 20 | self.indicatorView?.startAnimating() 21 | 22 | self.indicatorNameLabel.text = "\(indicatorType ?? .blank)" 23 | } 24 | } 25 | 26 | private var indicatorView: NVActivityIndicatorView? 27 | 28 | private var indicatorNameLabel: UILabel = { 29 | let space: CGFloat = 15.0 30 | let itemWidth = (SCREEN_WIDTH - space * 4) / 3 31 | 32 | let label = UILabel(frame: CGRect(x: 0, y: itemWidth, width: itemWidth, height: 20)) 33 | label.font = .systemFont(ofSize: 12) 34 | label.textColor = .brown 35 | label.textAlignment = .center 36 | return label 37 | }() 38 | 39 | override init(frame: CGRect) { 40 | super.init(frame: frame) 41 | self.contentView.addSubview(indicatorNameLabel) 42 | } 43 | 44 | required init?(coder: NSCoder) { 45 | fatalError("init(coder:) has not been implemented") 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Pods/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 | -------------------------------------------------------------------------------- /MZRefresh/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 | -------------------------------------------------------------------------------- /Pods/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: LayoutRelation { 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 | -------------------------------------------------------------------------------- /Pods/SnapKit/Source/Typealiases.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 | import Foundation 25 | 26 | #if os(iOS) || os(tvOS) 27 | import UIKit 28 | #if swift(>=4.2) 29 | typealias LayoutRelation = NSLayoutConstraint.Relation 30 | typealias LayoutAttribute = NSLayoutConstraint.Attribute 31 | #else 32 | typealias LayoutRelation = NSLayoutRelation 33 | typealias LayoutAttribute = NSLayoutAttribute 34 | #endif 35 | typealias LayoutPriority = UILayoutPriority 36 | #else 37 | import AppKit 38 | typealias LayoutRelation = NSLayoutConstraint.Relation 39 | typealias LayoutAttribute = NSLayoutConstraint.Attribute 40 | typealias LayoutPriority = NSLayoutConstraint.Priority 41 | #endif 42 | 43 | -------------------------------------------------------------------------------- /Pods/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 | -------------------------------------------------------------------------------- /Pods/SnapKit/Source/ConstraintDirectionalInsetTarget.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 | #if os(iOS) || os(tvOS) 31 | public protocol ConstraintDirectionalInsetTarget: ConstraintConstantTarget { 32 | } 33 | 34 | @available(iOS 11.0, tvOS 11.0, *) 35 | extension ConstraintDirectionalInsets: ConstraintDirectionalInsetTarget { 36 | } 37 | 38 | extension ConstraintDirectionalInsetTarget { 39 | 40 | @available(iOS 11.0, tvOS 11.0, *) 41 | internal var constraintDirectionalInsetTargetValue: ConstraintDirectionalInsets { 42 | if let amount = self as? ConstraintDirectionalInsets { 43 | return amount 44 | } else { 45 | return ConstraintDirectionalInsets(top: 0, leading: 0, bottom: 0, trailing: 0) 46 | } 47 | } 48 | } 49 | #endif 50 | -------------------------------------------------------------------------------- /MZRefresh/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "scale" : "2x", 6 | "size" : "20x20" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "scale" : "3x", 11 | "size" : "20x20" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "scale" : "2x", 16 | "size" : "29x29" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "scale" : "3x", 21 | "size" : "29x29" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "scale" : "2x", 26 | "size" : "40x40" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "scale" : "3x", 31 | "size" : "40x40" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "scale" : "2x", 36 | "size" : "60x60" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "scale" : "3x", 41 | "size" : "60x60" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "scale" : "1x", 46 | "size" : "20x20" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "scale" : "2x", 51 | "size" : "20x20" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "scale" : "1x", 56 | "size" : "29x29" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "scale" : "2x", 61 | "size" : "29x29" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "scale" : "1x", 66 | "size" : "40x40" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "scale" : "2x", 71 | "size" : "40x40" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "scale" : "1x", 76 | "size" : "76x76" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "scale" : "2x", 81 | "size" : "76x76" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "scale" : "2x", 86 | "size" : "83.5x83.5" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "scale" : "1x", 91 | "size" : "1024x1024" 92 | } 93 | ], 94 | "info" : { 95 | "author" : "xcode", 96 | "version" : 1 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /Pods/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 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/zenglong.xcuserdatad/xcschemes/SnapKit.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 50 | 51 | 53 | 54 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/cenglong.xcuserdatad/xcschemes/Pods-MZRefresh.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 50 | 51 | 53 | 54 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/zenglong.xcuserdatad/xcschemes/Pods-MZRefresh.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 50 | 51 | 53 | 54 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /MZRefresh/RefreshTypeController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RefreshTypeController.swift 3 | // MZRefresh 4 | // 5 | // Created by 曾龙 on 2022/1/13. 6 | // 7 | 8 | import UIKit 9 | import NVActivityIndicatorView 10 | 11 | class RefreshTypeController: UIViewController, UICollectionViewDataSource { 12 | 13 | func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { 14 | return self.presentingIndicatorTypes.count 15 | } 16 | 17 | func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { 18 | let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "RefreshTypeCell", for: indexPath) as! RefreshTypeCell 19 | cell.indicatorType = self.presentingIndicatorTypes[indexPath.row] 20 | return cell 21 | } 22 | 23 | 24 | lazy var collectionView: UICollectionView = { 25 | let space: CGFloat = 15.0 26 | let itemWidth = (SCREEN_WIDTH - space * 4) / 3 27 | 28 | let layout = UICollectionViewFlowLayout() 29 | layout.itemSize = CGSize(width: itemWidth, height: itemWidth + 20) 30 | layout.sectionInset = UIEdgeInsets(top: space, left: space, bottom: space, right: space) 31 | layout.minimumLineSpacing = space 32 | layout.minimumInteritemSpacing = space 33 | 34 | let collectionView = UICollectionView(frame: self.view.bounds, collectionViewLayout: layout) 35 | collectionView.backgroundColor = .white 36 | collectionView.dataSource = self 37 | collectionView.register(RefreshTypeCell.classForCoder(), forCellWithReuseIdentifier: "RefreshTypeCell") 38 | return collectionView 39 | }() 40 | 41 | private let presentingIndicatorTypes = { 42 | return NVActivityIndicatorType.allCases.filter { $0 != .blank } 43 | }() 44 | 45 | override func viewDidLoad() { 46 | super.viewDidLoad() 47 | if #available(iOS 13.0, *) { 48 | self.view.backgroundColor = UIColor.init(dynamicProvider: { traitCollection in 49 | return (traitCollection.userInterfaceStyle == .dark) ? .black : .white 50 | }) 51 | } else { 52 | self.view.backgroundColor = .white 53 | } 54 | self.view.addSubview(self.collectionView) 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /Pods/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 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/cenglong.xcuserdatad/xcschemes/NVActivityIndicatorView.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 50 | 51 | 53 | 54 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/zenglong.xcuserdatad/xcschemes/NVActivityIndicatorView.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 50 | 51 | 53 | 54 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /Pods/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 | #if os(iOS) || os(tvOS) 59 | @available(iOS 11.0, tvOS 11.0, *) 60 | extension ConstraintDirectionalInsets: ConstraintRelatableTarget { 61 | } 62 | #endif 63 | 64 | extension ConstraintItem: ConstraintRelatableTarget { 65 | } 66 | 67 | extension ConstraintView: ConstraintRelatableTarget { 68 | } 69 | 70 | @available(iOS 9.0, OSX 10.11, *) 71 | extension ConstraintLayoutGuide: ConstraintRelatableTarget { 72 | } 73 | -------------------------------------------------------------------------------- /Pods/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 | -------------------------------------------------------------------------------- /Pods/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 | -------------------------------------------------------------------------------- /MZRefresh/TableViewRefreshController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TableViewRefreshController.swift 3 | // MZRefresh 4 | // 5 | // Created by 曾龙 on 2022/1/13. 6 | // 7 | 8 | import UIKit 9 | 10 | class TableViewRefreshController: UIViewController, UITableViewDataSource { 11 | func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 12 | return self.count 13 | } 14 | 15 | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { 16 | let cell = tableView.dequeueReusableCell(withIdentifier: "UITableViewCell") 17 | cell?.selectionStyle = .none 18 | cell?.textLabel?.text = "第\(indexPath.row + 1)行" 19 | return cell! 20 | } 21 | 22 | lazy var tableView: UITableView = { 23 | let tableView = UITableView(frame: self.view.bounds, style: .plain) 24 | tableView.dataSource = self 25 | tableView.estimatedRowHeight = 50 26 | tableView.register(UITableViewCell.classForCoder(), forCellReuseIdentifier: "UITableViewCell") 27 | tableView.tableFooterView = UIView(frame: CGRect.zero) 28 | tableView.setRefreshHeader(MZRefreshNormalHeader(type: .ballClipRotatePulse, color: .brown, showTime: false, beginRefresh: { 29 | DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 2) { [weak self] in 30 | self?.count = 10 31 | self?.tableView.reloadData() 32 | self?.tableView.stopHeaderRefreshing() 33 | } 34 | })) 35 | tableView.setRefreshFooter(MZRefreshNormalFooter(type: .ballClipRotatePulse, color: .brown, beginRefresh: { 36 | DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 2) { [weak self] in 37 | self?.count += 10 38 | self?.tableView.reloadData() 39 | self?.tableView.stopFooterRefreshing() 40 | } 41 | })) 42 | return tableView 43 | }() 44 | 45 | var count: Int = 0 46 | 47 | override func viewDidLoad() { 48 | super.viewDidLoad() 49 | if #available(iOS 13.0, *) { 50 | self.view.backgroundColor = UIColor.init(dynamicProvider: { traitCollection in 51 | return (traitCollection.userInterfaceStyle == .dark) ? .black : .white 52 | }) 53 | } else { 54 | self.view.backgroundColor = .white 55 | } 56 | self.view.addSubview(self.tableView) 57 | self.tableView.startHeaderRefreshing() 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationSemiCircleSpin.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NVActivityIndicatorAnimationSemiCircleSpin.swift 3 | // NVActivityIndicatorView 4 | // 5 | // The MIT License (MIT) 6 | 7 | // Copyright (c) 2016 Vinh Nguyen 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 all 17 | // 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 THE 25 | // SOFTWARE. 26 | // 27 | 28 | #if canImport(UIKit) 29 | import UIKit 30 | 31 | class NVActivityIndicatorAnimationSemiCircleSpin: NVActivityIndicatorAnimationDelegate { 32 | 33 | func setUpAnimation(in layer: CALayer, size: CGSize, color: UIColor) { 34 | let duration: CFTimeInterval = 0.6 35 | 36 | // Animation 37 | let animation = CAKeyframeAnimation(keyPath: "transform.rotation.z") 38 | 39 | animation.keyTimes = [0, 0.5, 1] 40 | animation.values = [0, Double.pi, 2 * Double.pi] 41 | animation.duration = duration 42 | animation.repeatCount = HUGE 43 | animation.isRemovedOnCompletion = false 44 | 45 | // Draw circle 46 | let circle = NVActivityIndicatorShape.circleSemi.layerWith(size: size, color: color) 47 | let frame = CGRect( 48 | x: (layer.bounds.width - size.width) / 2, 49 | y: (layer.bounds.height - size.height) / 2, 50 | width: size.width, 51 | height: size.height 52 | ) 53 | 54 | circle.frame = frame 55 | circle.add(animation, forKey: "animation") 56 | layer.addSublayer(circle) 57 | } 58 | } 59 | #endif 60 | -------------------------------------------------------------------------------- /MZRefresh/OnlyGifRefreshController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // OnlyGifRefreshController.swift 3 | // MZRefresh 4 | // 5 | // Created by 曾龙 on 2022/1/15. 6 | // 7 | 8 | import UIKit 9 | import SnapKit 10 | 11 | class OnlyGifRefreshController: UIViewController, UITableViewDataSource { 12 | 13 | func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 14 | return self.count 15 | } 16 | 17 | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { 18 | let cell = tableView.dequeueReusableCell(withIdentifier: "UITableViewCell") 19 | cell?.selectionStyle = .none 20 | cell?.textLabel?.text = "第\(indexPath.row + 1)行" 21 | return cell! 22 | } 23 | 24 | lazy var tableView: UITableView = { 25 | let tableView = UITableView() 26 | tableView.dataSource = self 27 | tableView.estimatedRowHeight = 50 28 | tableView.register(UITableViewCell.classForCoder(), forCellReuseIdentifier: "UITableViewCell") 29 | tableView.tableFooterView = UIView(frame: CGRect.zero) 30 | let path = Bundle.main.path(forResource: "dog", ofType: "gif")! 31 | let data = try! Data(contentsOf: URL(fileURLWithPath: path)) 32 | tableView.setRefreshHeader(MZRefreshOnlyGifHeader(gifImage: data, size: 80, refreshOffSet: 80, beginRefresh: { 33 | DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 2) { [weak self] in 34 | self?.count = Int.random(in: 1...7) 35 | self?.tableView.reloadData() 36 | self?.tableView.stopHeaderRefreshing() 37 | } 38 | })) 39 | return tableView 40 | }() 41 | 42 | var count: Int = 0 43 | 44 | override func viewDidLoad() { 45 | super.viewDidLoad() 46 | if #available(iOS 13.0, *) { 47 | self.view.backgroundColor = UIColor.init(dynamicProvider: { traitCollection in 48 | return (traitCollection.userInterfaceStyle == .dark) ? .black : .white 49 | }) 50 | } else { 51 | self.view.backgroundColor = .white 52 | } 53 | self.view.addSubview(self.tableView) 54 | makeConstraints() 55 | 56 | self.tableView.startHeaderRefreshing() 57 | } 58 | 59 | } 60 | 61 | extension OnlyGifRefreshController { 62 | func makeConstraints() { 63 | tableView.snp.makeConstraints { make in 64 | make.left.top.bottom.equalToSuperview() 65 | make.right.equalTo(-100) 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /Pods/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 | // If firstItem or secondItem on either constraint has a dangling pointer 48 | // this comparison can cause a crash. The solution for this is to ensure 49 | // your layout code hold strong references to things like Views, LayoutGuides 50 | // and LayoutAnchors as SnapKit will not keep strong references to any of these. 51 | guard lhs.firstAttribute == rhs.firstAttribute && 52 | lhs.secondAttribute == rhs.secondAttribute && 53 | lhs.relation == rhs.relation && 54 | lhs.priority == rhs.priority && 55 | lhs.multiplier == rhs.multiplier && 56 | lhs.secondItem === rhs.secondItem && 57 | lhs.firstItem === rhs.firstItem else { 58 | return false 59 | } 60 | return true 61 | } 62 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-MZRefresh/Pods-MZRefresh-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## NVActivityIndicatorView 5 | 6 | The MIT License (MIT) 7 | 8 | Copyright (c) 2016 Vinh Nguyen 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a copy 11 | of this software and associated documentation files (the "Software"), to deal 12 | in the Software without restriction, including without limitation the rights 13 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | copies of the Software, and to permit persons to whom the Software is 15 | furnished to do so, subject to the following conditions: 16 | 17 | The above copyright notice and this permission notice shall be included in all 18 | copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | SOFTWARE. 27 | 28 | 29 | ## SnapKit 30 | 31 | Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 32 | 33 | Permission is hereby granted, free of charge, to any person obtaining a copy 34 | of this software and associated documentation files (the "Software"), to deal 35 | in the Software without restriction, including without limitation the rights 36 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 37 | copies of the Software, and to permit persons to whom the Software is 38 | furnished to do so, subject to the following conditions: 39 | 40 | The above copyright notice and this permission notice shall be included in 41 | all copies or substantial portions of the Software. 42 | 43 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 44 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 45 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 46 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 47 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 48 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 49 | THE SOFTWARE. 50 | 51 | Generated by CocoaPods - https://cocoapods.org 52 | -------------------------------------------------------------------------------- /Pods/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 | 77 | #if os(iOS) || os(tvOS) 78 | extension UILayoutPriority: ConstraintPriorityTarget { 79 | 80 | public var constraintPriorityTargetValue: Float { 81 | return self.rawValue 82 | } 83 | 84 | } 85 | #endif 86 | -------------------------------------------------------------------------------- /MZRefresh/MZRefresh/MZRefreshConfig.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MZRefreshConfig.swift 3 | // MZRefresh 4 | // 5 | // Created by 曾龙 on 2022/9/2. 6 | // 7 | 8 | import UIKit 9 | 10 | public class MZRefreshConfig: NSObject { 11 | 12 | /// 刷新状态文字颜色 13 | var statusColor: UIColor = { 14 | if #available(iOS 13.0, *) { 15 | return UIColor.label 16 | } else { 17 | return UIColor.black 18 | } 19 | }() 20 | 21 | /// 刷新时间文字颜色 22 | var timeColor: UIColor = { 23 | if #available(iOS 13.0, *) { 24 | return UIColor.secondaryLabel 25 | } else { 26 | return UIColor.gray 27 | } 28 | }() 29 | 30 | /// 刷新状态文字字体 31 | var statusFont: UIFont = .systemFont(ofSize: 16) 32 | 33 | /// 刷新时间文字字体 34 | var timeFont: UIFont = .systemFont(ofSize: 14) 35 | 36 | /// 配置类单例 37 | public static let shareInstance = MZRefreshConfig() 38 | 39 | /// 设置刷新状态文字颜色 40 | /// - Parameter color: 文字颜色 41 | public func setRefreshStatusColor(_ color: UIColor) { 42 | MZRefreshConfig.shareInstance.statusColor = color 43 | NotificationCenter.default.post(name: Notification.Name.MZRefreshStatusColorChanged, object: nil) 44 | } 45 | 46 | /// 设置刷新时间文字字体 47 | /// - Parameter color: 文字颜色 48 | public func setRefreshTimeColor(_ color: UIColor) { 49 | MZRefreshConfig.shareInstance.timeColor = color 50 | NotificationCenter.default.post(name: Notification.Name.MZRefreshTimeColorChanged, object: nil) 51 | } 52 | 53 | /// 设置刷新状态文字字体 54 | /// - Parameter font: 文字字体 55 | public func setRefreshStatusFont(_ font: UIFont) { 56 | MZRefreshConfig.shareInstance.statusFont = font 57 | NotificationCenter.default.post(name: Notification.Name.MZRefreshStatusFontChanged, object: nil) 58 | } 59 | 60 | /// 设置刷新时间文字字体 61 | /// - Parameter font: 文字字体 62 | public func setRefreshTimeFont(_ font: UIFont) { 63 | MZRefreshConfig.shareInstance.timeFont = font 64 | NotificationCenter.default.post(name: Notification.Name.MZRefreshTimeFontChanged, object: nil) 65 | } 66 | } 67 | 68 | extension Notification.Name { 69 | 70 | /// 刷新状态字体颜色更新 71 | static let MZRefreshStatusColorChanged = Notification.Name("MZRefreshStatusColorChanged") 72 | 73 | /// 刷新时间字体颜色更新 74 | static let MZRefreshTimeColorChanged = Notification.Name("MZRefreshTimeColorChanged") 75 | 76 | /// 刷新状态字体大小更新 77 | static let MZRefreshStatusFontChanged = Notification.Name("MZRefreshStatusFontChanged") 78 | 79 | /// 刷新时间字体大小更新 80 | static let MZRefreshTimeFontChanged = Notification.Name("MZRefreshTimeFontChanged") 81 | } 82 | -------------------------------------------------------------------------------- /Pods/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 | -------------------------------------------------------------------------------- /Pods/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 | #if os(iOS) || os(tvOS) 57 | @discardableResult 58 | @available(iOS 11.0, tvOS 11.0, *) 59 | public func inset(_ amount: ConstraintDirectionalInsetTarget) -> ConstraintMakerEditable { 60 | self.description.constant = amount.constraintDirectionalInsetTargetValue 61 | return self 62 | } 63 | #endif 64 | } 65 | -------------------------------------------------------------------------------- /Pods/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 | -------------------------------------------------------------------------------- /MZRefresh/DefaultNoMoreDataController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DefaultNoMoreDataController.swift 3 | // MZRefresh 4 | // 5 | // Created by 曾龙 on 2022/5/23. 6 | // 7 | 8 | import UIKit 9 | 10 | class DefaultNoMoreDataController: UIViewController, UITableViewDataSource { 11 | 12 | func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 13 | return self.count 14 | } 15 | 16 | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { 17 | let cell = tableView.dequeueReusableCell(withIdentifier: "UITableViewCell") 18 | cell?.selectionStyle = .none 19 | cell?.textLabel?.text = "第\(indexPath.row + 1)行" 20 | return cell! 21 | } 22 | 23 | lazy var tableView: UITableView = { 24 | let tableView = UITableView() 25 | tableView.dataSource = self 26 | tableView.estimatedRowHeight = 50 27 | tableView.register(UITableViewCell.classForCoder(), forCellReuseIdentifier: "UITableViewCell") 28 | tableView.tableFooterView = UIView(frame: CGRect.zero) 29 | tableView.setRefreshHeader(MZRefreshNormalHeader(type: .ballClipRotatePulse, color: .brown, showTime: false, beginRefresh: { 30 | DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 2) { [weak self] in 31 | self?.count = 10 32 | self?.tableView.reloadData() 33 | self?.tableView.stopHeaderRefreshing() 34 | } 35 | })) 36 | tableView.setRefreshFooter(MZRefreshNormalFooter(type: .ballClipRotatePulse, color: .brown, beginRefresh: { 37 | DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 2) { [weak self] in 38 | self?.count += 10 39 | self?.tableView.reloadData() 40 | self?.tableView.stopFooterRefreshingWithNoMoreData() 41 | } 42 | })) 43 | return tableView 44 | }() 45 | 46 | var count: Int = 0 47 | 48 | override func viewDidLoad() { 49 | super.viewDidLoad() 50 | if #available(iOS 13.0, *) { 51 | self.view.backgroundColor = UIColor.init(dynamicProvider: { traitCollection in 52 | return (traitCollection.userInterfaceStyle == .dark) ? .black : .white 53 | }) 54 | } else { 55 | self.view.backgroundColor = .white 56 | } 57 | self.view.addSubview(self.tableView) 58 | makeConstraints() 59 | 60 | self.tableView.startHeaderRefreshing() 61 | } 62 | 63 | } 64 | 65 | extension DefaultNoMoreDataController { 66 | func makeConstraints() { 67 | tableView.snp.makeConstraints { make in 68 | make.left.right.top.bottom.equalToSuperview() 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /Pods/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, message:"Use priority(.required) instead.") 46 | @discardableResult 47 | public func priorityRequired() -> ConstraintMakerFinalizable { 48 | return self.priority(.required) 49 | } 50 | 51 | @available(*, deprecated, message:"Use priority(.high) instead.") 52 | @discardableResult 53 | public func priorityHigh() -> ConstraintMakerFinalizable { 54 | return self.priority(.high) 55 | } 56 | 57 | @available(*, deprecated, message:"Use priority(.medium) instead.") 58 | @discardableResult 59 | public func priorityMedium() -> ConstraintMakerFinalizable { 60 | return self.priority(.medium) 61 | } 62 | 63 | @available(*, deprecated, message:"Use priority(.low) instead.") 64 | @discardableResult 65 | public func priorityLow() -> ConstraintMakerFinalizable { 66 | return self.priority(.low) 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /Pods/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 | -------------------------------------------------------------------------------- /Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallDoubleBounce.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NVActivityIndicatorAnimationBallsBounce.swift 3 | // NVActivityIndicatorView 4 | // 5 | // The MIT License (MIT) 6 | 7 | // Copyright (c) 2016 Vinh Nguyen 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 all 17 | // 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 THE 25 | // SOFTWARE. 26 | // 27 | 28 | #if canImport(UIKit) 29 | import UIKit 30 | 31 | class NVActivityIndicatorAnimationBallDoubleBounce: NVActivityIndicatorAnimationDelegate { 32 | 33 | func setUpAnimation(in layer: CALayer, size: CGSize, color: UIColor) { 34 | for index in (0...1) { 35 | bouncingBall(in: layer, size: size, color: color, startingAt: CACurrentMediaTime() + Double(index)) 36 | } 37 | } 38 | 39 | fileprivate func bouncingBall(in layer: CALayer, size: CGSize, color: UIColor, startingAt: CFTimeInterval) { 40 | // Scale animation 41 | let scaleAnimation = CAKeyframeAnimation(keyPath: "transform.scale") 42 | scaleAnimation.duration = 2 43 | scaleAnimation.keyTimes = [0, 0.5, 1] 44 | scaleAnimation.values = [-1, 0, -1] 45 | 46 | scaleAnimation.timingFunction = CAMediaTimingFunction(name: .easeInEaseOut) 47 | scaleAnimation.repeatCount = HUGE 48 | scaleAnimation.isRemovedOnCompletion = false 49 | 50 | let circle = NVActivityIndicatorShape.circle.layerWith(size: size, color: color) 51 | let frame = CGRect(x: (layer.bounds.size.width - size.width) / 2, 52 | y: (layer.bounds.size.height - size.height) / 2, 53 | width: size.width, 54 | height: size.height) 55 | 56 | scaleAnimation.beginTime = startingAt 57 | circle.frame = frame 58 | circle.opacity = 0.6 59 | circle.add(scaleAnimation, forKey: "animation") 60 | layer.addSublayer(circle) 61 | } 62 | } 63 | #endif 64 | -------------------------------------------------------------------------------- /Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationLineScale.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NVActivityIndicatorAnimationBarScale.swift 3 | // NVActivityIndicatorView 4 | // 5 | // The MIT License (MIT) 6 | 7 | // Copyright (c) 2016 Vinh Nguyen 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 all 17 | // 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 THE 25 | // SOFTWARE. 26 | // 27 | 28 | #if canImport(UIKit) 29 | import UIKit 30 | 31 | class NVActivityIndicatorAnimationLineScale: NVActivityIndicatorAnimationDelegate { 32 | 33 | func setUpAnimation(in layer: CALayer, size: CGSize, color: UIColor) { 34 | let lineSize = size.width / 9 35 | let x = (layer.bounds.size.width - size.width) / 2 36 | let y = (layer.bounds.size.height - size.height) / 2 37 | let duration: CFTimeInterval = 1 38 | let beginTime = CACurrentMediaTime() 39 | let beginTimes = [0.1, 0.2, 0.3, 0.4, 0.5] 40 | let timingFunction = CAMediaTimingFunction(controlPoints: 0.2, 0.68, 0.18, 1.08) 41 | 42 | // Animation 43 | let animation = CAKeyframeAnimation(keyPath: "transform.scale.y") 44 | 45 | animation.keyTimes = [0, 0.5, 1] 46 | animation.timingFunctions = [timingFunction, timingFunction] 47 | animation.values = [1, 0.4, 1] 48 | animation.duration = duration 49 | animation.repeatCount = HUGE 50 | animation.isRemovedOnCompletion = false 51 | 52 | // Draw lines 53 | for i in 0 ..< 5 { 54 | let line = NVActivityIndicatorShape.line.layerWith(size: CGSize(width: lineSize, height: size.height), color: color) 55 | let frame = CGRect(x: x + lineSize * 2 * CGFloat(i), y: y, width: lineSize, height: size.height) 56 | 57 | animation.beginTime = beginTime + beginTimes[i] 58 | line.frame = frame 59 | line.add(animation, forKey: "animation") 60 | layer.addSublayer(line) 61 | } 62 | } 63 | } 64 | #endif 65 | -------------------------------------------------------------------------------- /Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationLineScaleParty.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NVActivityIndicatorAnimationLineScaleParty.swift 3 | // NVActivityIndicatorView 4 | // 5 | // The MIT License (MIT) 6 | 7 | // Copyright (c) 2016 Vinh Nguyen 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 all 17 | // 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 THE 25 | // SOFTWARE. 26 | // 27 | 28 | #if canImport(UIKit) 29 | import UIKit 30 | 31 | class NVActivityIndicatorAnimationLineScaleParty: NVActivityIndicatorAnimationDelegate { 32 | 33 | func setUpAnimation(in layer: CALayer, size: CGSize, color: UIColor) { 34 | let lineSize = size.width / 7 35 | let x = (layer.bounds.size.width - size.width) / 2 36 | let y = (layer.bounds.size.height - size.height) / 2 37 | let durations: [CFTimeInterval] = [1.26, 0.43, 1.01, 0.73] 38 | let beginTime = CACurrentMediaTime() 39 | let beginTimes: [CFTimeInterval] = [0.77, 0.29, 0.28, 0.74] 40 | let timingFunction = CAMediaTimingFunction(name: .default) 41 | 42 | // Animation 43 | let animation = CAKeyframeAnimation(keyPath: "transform.scale") 44 | 45 | animation.keyTimes = [0, 0.5, 1] 46 | animation.timingFunctions = [timingFunction, timingFunction] 47 | animation.values = [1, 0.5, 1] 48 | animation.repeatCount = HUGE 49 | animation.isRemovedOnCompletion = false 50 | 51 | for i in 0 ..< 4 { 52 | let line = NVActivityIndicatorShape.line.layerWith(size: CGSize(width: lineSize, height: size.height), color: color) 53 | let frame = CGRect(x: x + lineSize * 2 * CGFloat(i), y: y, width: lineSize, height: size.height) 54 | 55 | animation.beginTime = beginTime + beginTimes[i] 56 | animation.duration = durations[i] 57 | line.frame = frame 58 | line.add(animation, forKey: "animation") 59 | layer.addSublayer(line) 60 | } 61 | } 62 | } 63 | #endif 64 | -------------------------------------------------------------------------------- /Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallScale.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NVActivityIndicatorAnimationBallScale.swift 3 | // NVActivityIndicatorView 4 | // 5 | // The MIT License (MIT) 6 | 7 | // Copyright (c) 2016 Vinh Nguyen 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 all 17 | // 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 THE 25 | // SOFTWARE. 26 | // 27 | 28 | #if canImport(UIKit) 29 | import UIKit 30 | 31 | class NVActivityIndicatorAnimationBallScale: NVActivityIndicatorAnimationDelegate { 32 | 33 | func setUpAnimation(in layer: CALayer, size: CGSize, color: UIColor) { 34 | let duration: CFTimeInterval = 1 35 | 36 | // Scale animation 37 | let scaleAnimation = CABasicAnimation(keyPath: "transform.scale") 38 | 39 | scaleAnimation.duration = duration 40 | scaleAnimation.fromValue = 0 41 | scaleAnimation.toValue = 1 42 | 43 | // Opacity animation 44 | let opacityAnimation = CABasicAnimation(keyPath: "opacity") 45 | 46 | opacityAnimation.duration = duration 47 | opacityAnimation.fromValue = 1 48 | opacityAnimation.toValue = 0 49 | 50 | // Animation 51 | let animation = CAAnimationGroup() 52 | 53 | animation.animations = [scaleAnimation, opacityAnimation] 54 | animation.timingFunction = CAMediaTimingFunction(name: .easeInEaseOut) 55 | animation.duration = duration 56 | animation.repeatCount = HUGE 57 | animation.isRemovedOnCompletion = false 58 | 59 | // Draw circle 60 | let circle = NVActivityIndicatorShape.circle.layerWith(size: size, color: color) 61 | 62 | circle.frame = CGRect(x: (layer.bounds.size.width - size.width) / 2, 63 | y: (layer.bounds.size.height - size.height) / 2, 64 | width: size.width, 65 | height: size.height) 66 | circle.add(animation, forKey: "animation") 67 | layer.addSublayer(circle) 68 | } 69 | } 70 | #endif 71 | -------------------------------------------------------------------------------- /Pods/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 | -------------------------------------------------------------------------------- /Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallClipRotate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NVActivityIndicatorBallClipRotate.swift 3 | // NVActivityIndicatorView 4 | // 5 | // The MIT License (MIT) 6 | 7 | // Copyright (c) 2016 Vinh Nguyen 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 all 17 | // 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 THE 25 | // SOFTWARE. 26 | // 27 | 28 | #if canImport(UIKit) 29 | import UIKit 30 | 31 | class NVActivityIndicatorAnimationBallClipRotate: NVActivityIndicatorAnimationDelegate { 32 | 33 | func setUpAnimation(in layer: CALayer, size: CGSize, color: UIColor) { 34 | let duration: CFTimeInterval = 0.75 35 | 36 | // Scale animation 37 | let scaleAnimation = CAKeyframeAnimation(keyPath: "transform.scale") 38 | 39 | scaleAnimation.keyTimes = [0, 0.5, 1] 40 | scaleAnimation.values = [1, 0.6, 1] 41 | 42 | // Rotate animation 43 | let rotateAnimation = CAKeyframeAnimation(keyPath: "transform.rotation.z") 44 | 45 | rotateAnimation.keyTimes = scaleAnimation.keyTimes 46 | rotateAnimation.values = [0, Double.pi, 2 * Double.pi] 47 | 48 | // Animation 49 | let animation = CAAnimationGroup() 50 | 51 | animation.animations = [scaleAnimation, rotateAnimation] 52 | animation.timingFunction = CAMediaTimingFunction(name: .linear) 53 | animation.duration = duration 54 | animation.repeatCount = HUGE 55 | animation.isRemovedOnCompletion = false 56 | 57 | // Draw circle 58 | let circle = NVActivityIndicatorShape.ringThirdFour.layerWith(size: CGSize(width: size.width, height: size.height), color: color) 59 | let frame = CGRect(x: (layer.bounds.size.width - size.width) / 2, 60 | y: (layer.bounds.size.height - size.height) / 2, 61 | width: size.width, 62 | height: size.height) 63 | 64 | circle.frame = frame 65 | circle.add(animation, forKey: "animation") 66 | layer.addSublayer(circle) 67 | } 68 | } 69 | #endif 70 | -------------------------------------------------------------------------------- /Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationLineScalePulseOut.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NVActivityIndicatorAnimationLineScalePulseOut.swift 3 | // NVActivityIndicatorView 4 | // 5 | // The MIT License (MIT) 6 | 7 | // Copyright (c) 2016 Vinh Nguyen 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 all 17 | // 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 THE 25 | // SOFTWARE. 26 | // 27 | 28 | #if canImport(UIKit) 29 | import UIKit 30 | 31 | class NVActivityIndicatorAnimationLineScalePulseOut: NVActivityIndicatorAnimationDelegate { 32 | 33 | func setUpAnimation(in layer: CALayer, size: CGSize, color: UIColor) { 34 | let lineSize = size.width / 9 35 | let x = (layer.bounds.size.width - size.width) / 2 36 | let y = (layer.bounds.size.height - size.height) / 2 37 | let duration: CFTimeInterval = 1 38 | let beginTime = CACurrentMediaTime() 39 | let beginTimes = [0.4, 0.2, 0, 0.2, 0.4] 40 | let timingFunction = CAMediaTimingFunction(controlPoints: 0.85, 0.25, 0.37, 0.85) 41 | 42 | // Animation 43 | let animation = CAKeyframeAnimation(keyPath: "transform.scale.y") 44 | 45 | animation.keyTimes = [0, 0.5, 1] 46 | animation.timingFunctions = [timingFunction, timingFunction] 47 | animation.values = [1, 0.4, 1] 48 | animation.duration = duration 49 | animation.repeatCount = HUGE 50 | animation.isRemovedOnCompletion = false 51 | 52 | // Draw lines 53 | for i in 0 ..< 5 { 54 | let line = NVActivityIndicatorShape.line.layerWith(size: CGSize(width: lineSize, height: size.height), color: color) 55 | let frame = CGRect(x: x + lineSize * 2 * CGFloat(i), 56 | y: y, 57 | width: lineSize, 58 | height: size.height) 59 | 60 | animation.beginTime = beginTime + beginTimes[i] 61 | line.frame = frame 62 | line.add(animation, forKey: "animation") 63 | layer.addSublayer(line) 64 | } 65 | } 66 | } 67 | #endif 68 | -------------------------------------------------------------------------------- /Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationLineScalePulseOutRapid.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NVActivityIndicatorAnimationLineScalePulseOutRapid.swift 3 | // NVActivityIndicatorView 4 | // 5 | // The MIT License (MIT) 6 | 7 | // Copyright (c) 2016 Vinh Nguyen 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 all 17 | // 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 THE 25 | // SOFTWARE. 26 | // 27 | 28 | #if canImport(UIKit) 29 | import UIKit 30 | 31 | class NVActivityIndicatorAnimationLineScalePulseOutRapid: NVActivityIndicatorAnimationDelegate { 32 | 33 | func setUpAnimation(in layer: CALayer, size: CGSize, color: UIColor) { 34 | let lineSize = size.width / 9 35 | let x = (layer.bounds.size.width - size.width) / 2 36 | let y = (layer.bounds.size.height - size.height) / 2 37 | let duration: CFTimeInterval = 0.9 38 | let beginTime = CACurrentMediaTime() 39 | let beginTimes = [0.5, 0.25, 0, 0.25, 0.5] 40 | let timingFunction = CAMediaTimingFunction(controlPoints: 0.11, 0.49, 0.38, 0.78) 41 | 42 | // Animation 43 | let animation = CAKeyframeAnimation(keyPath: "transform.scale.y") 44 | 45 | animation.keyTimes = [0, 0.8, 0.9] 46 | animation.timingFunctions = [timingFunction, timingFunction] 47 | animation.beginTime = beginTime 48 | animation.values = [1, 0.3, 1] 49 | animation.duration = duration 50 | animation.repeatCount = HUGE 51 | animation.isRemovedOnCompletion = false 52 | 53 | // Draw lines 54 | for i in 0 ..< 5 { 55 | let line = NVActivityIndicatorShape.line.layerWith(size: CGSize(width: lineSize, height: size.height), color: color) 56 | let frame = CGRect(x: x + lineSize * 2 * CGFloat(i), 57 | y: y, 58 | width: lineSize, 59 | height: size.height) 60 | 61 | animation.beginTime = beginTime + beginTimes[i] 62 | line.frame = frame 63 | line.add(animation, forKey: "animation") 64 | layer.addSublayer(line) 65 | } 66 | } 67 | } 68 | #endif 69 | -------------------------------------------------------------------------------- /Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallPulse.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NVActivityIndicatorAnimationBallPulse.swift 3 | // NVActivityIndicatorView 4 | // 5 | // The MIT License (MIT) 6 | 7 | // Copyright (c) 2016 Vinh Nguyen 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 all 17 | // 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 THE 25 | // SOFTWARE. 26 | // 27 | 28 | #if canImport(UIKit) 29 | import UIKit 30 | 31 | class NVActivityIndicatorAnimationBallPulse: NVActivityIndicatorAnimationDelegate { 32 | func setUpAnimation(in layer: CALayer, size: CGSize, color: UIColor) { 33 | let circleSpacing: CGFloat = 2 34 | let circleSize: CGFloat = (size.width - 2 * circleSpacing) / 3 35 | let x: CGFloat = (layer.bounds.size.width - size.width) / 2 36 | let y: CGFloat = (layer.bounds.size.height - circleSize) / 2 37 | let duration: CFTimeInterval = 0.75 38 | let beginTime = CACurrentMediaTime() 39 | let beginTimes: [CFTimeInterval] = [0.12, 0.24, 0.36] 40 | let timingFunction = CAMediaTimingFunction(controlPoints: 0.2, 0.68, 0.18, 1.08) 41 | let animation = CAKeyframeAnimation(keyPath: "transform.scale") 42 | 43 | // Animation 44 | animation.keyTimes = [0, 0.3, 1] 45 | animation.timingFunctions = [timingFunction, timingFunction] 46 | animation.values = [1, 0.3, 1] 47 | animation.duration = duration 48 | animation.repeatCount = HUGE 49 | animation.isRemovedOnCompletion = false 50 | 51 | // Draw circles 52 | for i in 0 ..< 3 { 53 | let circle = NVActivityIndicatorShape.circle.layerWith(size: CGSize(width: circleSize, height: circleSize), color: color) 54 | let frame = CGRect(x: x + circleSize * CGFloat(i) + circleSpacing * CGFloat(i), 55 | y: y, 56 | width: circleSize, 57 | height: circleSize) 58 | 59 | animation.beginTime = beginTime + beginTimes[i] 60 | circle.frame = frame 61 | circle.add(animation, forKey: "animation") 62 | layer.addSublayer(circle) 63 | } 64 | } 65 | } 66 | #endif 67 | -------------------------------------------------------------------------------- /MZRefresh/CustomNoMoreDataController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CustomNoMoreDataController.swift 3 | // MZRefresh 4 | // 5 | // Created by 曾龙 on 2022/5/23. 6 | // 7 | 8 | import UIKit 9 | import SnapKit 10 | 11 | class CustomNoMoreDataController: UIViewController, UITableViewDataSource { 12 | 13 | func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 14 | return self.count 15 | } 16 | 17 | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { 18 | let cell = tableView.dequeueReusableCell(withIdentifier: "UITableViewCell") 19 | cell?.selectionStyle = .none 20 | cell?.textLabel?.text = "第\(indexPath.row + 1)行" 21 | return cell! 22 | } 23 | 24 | lazy var tableView: UITableView = { 25 | let tableView = UITableView() 26 | tableView.dataSource = self 27 | tableView.estimatedRowHeight = 50 28 | tableView.register(UITableViewCell.classForCoder(), forCellReuseIdentifier: "UITableViewCell") 29 | tableView.tableFooterView = UIView(frame: CGRect.zero) 30 | tableView.setRefreshHeader(MZRefreshNormalHeader(type: .ballClipRotatePulse, color: .brown, showTime: false, beginRefresh: { 31 | DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 2) { [weak self] in 32 | self?.count = 10 33 | self?.tableView.reloadData() 34 | self?.tableView.stopHeaderRefreshing() 35 | } 36 | })) 37 | tableView.setRefreshFooter(MZRefreshNormalFooter(type: .ballClipRotatePulse, color: .brown, beginRefresh: { 38 | DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 2) { [weak self] in 39 | self?.count += 10 40 | self?.tableView.reloadData() 41 | self?.tableView.stopFooterRefreshingWithNoMoreData() 42 | } 43 | })) 44 | 45 | // 自定义NoMoreData组件 46 | let footer = UILabel(frame: CGRect(x: 0, y: 0, width: SCREEN_WIDTH - 100, height: 40)) 47 | footer.font = .systemFont(ofSize: 14) 48 | footer.textAlignment = .center 49 | footer.textColor = .brown 50 | footer.text = "—— 生活的强者,往往都能坚持到底 ——" 51 | tableView.setRefreshNoMoreDataView(footer) 52 | return tableView 53 | }() 54 | 55 | var count: Int = 0 56 | 57 | override func viewDidLoad() { 58 | super.viewDidLoad() 59 | if #available(iOS 13.0, *) { 60 | self.view.backgroundColor = UIColor.init(dynamicProvider: { traitCollection in 61 | return (traitCollection.userInterfaceStyle == .dark) ? .black : .white 62 | }) 63 | } else { 64 | self.view.backgroundColor = .white 65 | } 66 | self.view.addSubview(self.tableView) 67 | makeConstraints() 68 | 69 | self.tableView.startHeaderRefreshing() 70 | } 71 | 72 | } 73 | 74 | extension CustomNoMoreDataController { 75 | func makeConstraints() { 76 | tableView.snp.makeConstraints { make in 77 | make.right.top.bottom.equalToSuperview() 78 | make.left.equalTo(100) 79 | } 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallScaleRipple.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NVActivityIndicatorAnimationBallScaleRipple.swift 3 | // NVActivityIndicatorView 4 | // 5 | // The MIT License (MIT) 6 | 7 | // Copyright (c) 2016 Vinh Nguyen 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 all 17 | // 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 THE 25 | // SOFTWARE. 26 | // 27 | 28 | #if canImport(UIKit) 29 | import UIKit 30 | 31 | class NVActivityIndicatorAnimationBallScaleRipple: NVActivityIndicatorAnimationDelegate { 32 | 33 | func setUpAnimation(in layer: CALayer, size: CGSize, color: UIColor) { 34 | let duration: CFTimeInterval = 1 35 | let timingFunction = CAMediaTimingFunction(controlPoints: 0.21, 0.53, 0.56, 0.8) 36 | 37 | // Scale animation 38 | let scaleAnimation = CAKeyframeAnimation(keyPath: "transform.scale") 39 | 40 | scaleAnimation.keyTimes = [0, 0.7] 41 | scaleAnimation.timingFunction = timingFunction 42 | scaleAnimation.values = [0.1, 1] 43 | scaleAnimation.duration = duration 44 | 45 | // Opacity animation 46 | let opacityAnimation = CAKeyframeAnimation(keyPath: "opacity") 47 | 48 | opacityAnimation.keyTimes = [0, 0.7, 1] 49 | opacityAnimation.timingFunctions = [timingFunction, timingFunction] 50 | opacityAnimation.values = [1, 0.7, 0] 51 | opacityAnimation.duration = duration 52 | 53 | // Animation 54 | let animation = CAAnimationGroup() 55 | 56 | animation.animations = [scaleAnimation, opacityAnimation] 57 | animation.duration = duration 58 | animation.repeatCount = HUGE 59 | animation.isRemovedOnCompletion = false 60 | 61 | // Draw circle 62 | let circle = NVActivityIndicatorShape.ring.layerWith(size: size, color: color) 63 | let frame = CGRect(x: (layer.bounds.size.width - size.width) / 2, 64 | y: (layer.bounds.size.height - size.height) / 2, 65 | width: size.width, 66 | height: size.height) 67 | 68 | circle.frame = frame 69 | circle.add(animation, forKey: "animation") 70 | layer.addSublayer(circle) 71 | } 72 | } 73 | #endif 74 | -------------------------------------------------------------------------------- /Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallPulseSync.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NVActivityIndicatorAnimationBallPulseSync.swift 3 | // NVActivityIndicatorView 4 | // 5 | // The MIT License (MIT) 6 | 7 | // Copyright (c) 2016 Vinh Nguyen 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 all 17 | // 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 THE 25 | // SOFTWARE. 26 | // 27 | 28 | #if canImport(UIKit) 29 | import UIKit 30 | 31 | class NVActivityIndicatorAnimationBallPulseSync: NVActivityIndicatorAnimationDelegate { 32 | 33 | func setUpAnimation(in layer: CALayer, size: CGSize, color: UIColor) { 34 | let circleSpacing: CGFloat = 2 35 | let circleSize = (size.width - circleSpacing * 2) / 3 36 | let x = (layer.bounds.size.width - size.width) / 2 37 | let y = (layer.bounds.size.height - circleSize) / 2 38 | let deltaY = (size.height / 2 - circleSize / 2) / 2 39 | let duration: CFTimeInterval = 0.6 40 | let beginTime = CACurrentMediaTime() 41 | let beginTimes: [CFTimeInterval] = [0.07, 0.14, 0.21] 42 | let timingFunciton = CAMediaTimingFunction(name: .easeInEaseOut) 43 | 44 | // Animation 45 | let animation = CAKeyframeAnimation(keyPath: "transform.translation.y") 46 | 47 | animation.keyTimes = [0, 0.33, 0.66, 1] 48 | animation.timingFunctions = [timingFunciton, timingFunciton, timingFunciton] 49 | animation.values = [0, deltaY, -deltaY, 0] 50 | animation.duration = duration 51 | animation.repeatCount = HUGE 52 | animation.isRemovedOnCompletion = false 53 | 54 | // Draw circles 55 | for i in 0 ..< 3 { 56 | let circle = NVActivityIndicatorShape.circle.layerWith(size: CGSize(width: circleSize, height: circleSize), color: color) 57 | let frame = CGRect(x: x + circleSize * CGFloat(i) + circleSpacing * CGFloat(i), 58 | y: y, 59 | width: circleSize, 60 | height: circleSize) 61 | 62 | animation.beginTime = beginTime + beginTimes[i] 63 | circle.frame = frame 64 | circle.add(animation, forKey: "animation") 65 | layer.addSublayer(circle) 66 | } 67 | } 68 | } 69 | #endif 70 | -------------------------------------------------------------------------------- /Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationAudioEqualizer.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NVActivityIndicatorAnimationAudioEqualizer.swift 3 | // NVActivityIndicatorView 4 | // 5 | // The MIT License (MIT) 6 | 7 | // Copyright (c) 2016 Vinh Nguyen 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 all 17 | // 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 THE 25 | // SOFTWARE. 26 | // 27 | 28 | #if canImport(UIKit) 29 | import UIKit 30 | 31 | class NVActivityIndicatorAnimationAudioEqualizer: NVActivityIndicatorAnimationDelegate { 32 | 33 | func setUpAnimation(in layer: CALayer, size: CGSize, color: UIColor) { 34 | let lineSize = size.width / 9 35 | let x = (layer.bounds.size.width - lineSize * 7) / 2 36 | let y = (layer.bounds.size.height - size.height) / 2 37 | let duration: [CFTimeInterval] = [4.3, 2.5, 1.7, 3.1] 38 | let values = [0, 0.7, 0.4, 0.05, 0.95, 0.3, 0.9, 0.4, 0.15, 0.18, 0.75, 0.01] 39 | 40 | // Draw lines 41 | for i in 0 ..< 4 { 42 | let animation = CAKeyframeAnimation() 43 | 44 | animation.keyPath = "path" 45 | animation.isAdditive = true 46 | animation.values = [] 47 | 48 | for j in 0 ..< values.count { 49 | let heightFactor = values[j] 50 | let height = size.height * CGFloat(heightFactor) 51 | let point = CGPoint(x: 0, y: size.height - height) 52 | let path = UIBezierPath(rect: CGRect(origin: point, size: CGSize(width: lineSize, height: height))) 53 | 54 | animation.values?.append(path.cgPath) 55 | } 56 | animation.duration = duration[i] 57 | animation.repeatCount = HUGE 58 | animation.isRemovedOnCompletion = false 59 | 60 | let line = NVActivityIndicatorShape.line.layerWith(size: CGSize(width: lineSize, height: size.height), color: color) 61 | let frame = CGRect(x: x + lineSize * 2 * CGFloat(i), 62 | y: y, 63 | width: lineSize, 64 | height: size.height) 65 | 66 | line.frame = frame 67 | line.add(animation, forKey: "animation") 68 | layer.addSublayer(line) 69 | } 70 | } 71 | } 72 | #endif 73 | -------------------------------------------------------------------------------- /MZRefresh/NormalRefreshController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NormalRefreshController.swift 3 | // MZRefresh 4 | // 5 | // Created by 曾龙 on 2022/1/11. 6 | // 7 | 8 | import UIKit 9 | import SnapKit 10 | 11 | class NormalRefreshController: UIViewController { 12 | 13 | var count: Int = 0 14 | 15 | lazy var scrollView: UIScrollView = { 16 | let scrollView = UIScrollView() 17 | scrollView.setRefreshHeader(MZRefreshNormalHeader(beginRefresh: { 18 | DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 2.0) { [weak self] in 19 | self?.loadNew(Int.random(in: 2...6)) 20 | } 21 | })) 22 | scrollView.setRefreshFooter(MZRefreshNormalFooter(beginRefresh: { 23 | DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 2.0) { [weak self] in 24 | self?.loadMore(Int.random(in: 0...5)) 25 | } 26 | })) 27 | return scrollView 28 | }() 29 | 30 | override func viewDidLoad() { 31 | super.viewDidLoad() 32 | if #available(iOS 13.0, *) { 33 | self.view.backgroundColor = UIColor.init(dynamicProvider: { traitCollection in 34 | return (traitCollection.userInterfaceStyle == .dark) ? .black : .white 35 | }) 36 | } else { 37 | self.view.backgroundColor = .white 38 | } 39 | self.view.addSubview(scrollView) 40 | makeConstraints() 41 | 42 | self.navigationItem.rightBarButtonItem = UIBarButtonItem.init(barButtonSystemItem: UIBarButtonItem.SystemItem.refresh, target: self, action: #selector(headerRefresh)) 43 | 44 | self.scrollView.startHeaderRefreshing(animated: false) 45 | } 46 | 47 | @objc func headerRefresh() { 48 | self.scrollView.startHeaderRefreshing(animated: true) 49 | } 50 | 51 | func loadNew(_ count: Int) { 52 | self.loadData(count, isNew: true) 53 | } 54 | 55 | func loadMore(_ count: Int) { 56 | self.loadData(count, isNew: false) 57 | } 58 | 59 | func loadData(_ count: Int, isNew: Bool) { 60 | 61 | if isNew { 62 | self.scrollView.subviews.forEach { subView in 63 | subView.removeFromSuperview() 64 | } 65 | } 66 | let start: Int = isNew ? 0 : self.count 67 | let end: Int = isNew ? count : self.count + count 68 | for i in start.. Int { 13 | return self.count 14 | } 15 | 16 | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { 17 | let cell = tableView.dequeueReusableCell(withIdentifier: "UITableViewCell") 18 | cell?.selectionStyle = .none 19 | cell?.textLabel?.text = "第\(indexPath.row + 1)行" 20 | return cell! 21 | } 22 | 23 | lazy var animationImages: [UIImage] = { 24 | var images = [UIImage]() 25 | for i in 1...6 { 26 | images.append(UIImage(named: "running\(i)")!) 27 | } 28 | return images 29 | }() 30 | 31 | 32 | lazy var tableView: UITableView = { 33 | let tableView = UITableView(frame: self.view.bounds, style: .plain) 34 | tableView.dataSource = self 35 | tableView.estimatedRowHeight = 50 36 | tableView.register(UITableViewCell.classForCoder(), forCellReuseIdentifier: "UITableViewCell") 37 | tableView.tableFooterView = UIView(frame: CGRect.zero) 38 | tableView.setRefreshHeader(MZRefreshGifHeader(images: animationImages, size: 60, beginRefresh: { 39 | DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 2) { [weak self] in 40 | self?.count = 10 41 | self?.tableView.reloadData() 42 | self?.tableView.stopHeaderRefreshing() 43 | } 44 | })) 45 | 46 | tableView.setRefreshFooter(MZRefreshGifFooter(images: animationImages, size: 60, beginRefresh: { 47 | DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 2) { [weak self] in 48 | self?.count += 10 49 | self?.tableView.reloadData() 50 | self?.tableView.stopFooterRefreshing() 51 | } 52 | })) 53 | 54 | // let path = Bundle.main.path(forResource: "1", ofType: "gif")! 55 | // let data = try! Data(contentsOf: URL(fileURLWithPath: path)) 56 | // tableView.setRefreshHeader(MZRefreshGifHeader(gifImage: data, beginRefresh: { 57 | // DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 2) { [weak self] in 58 | // self?.count = 10 59 | // self?.tableView.reloadData() 60 | // self?.tableView.stopHeaderRefreshing() 61 | // } 62 | // })) 63 | // 64 | // tableView.setRefreshFooter(MZRefreshGifFooter(gifImage: data, beginRefresh: { 65 | // DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 2) { [weak self] in 66 | // self?.count += 10 67 | // self?.tableView.reloadData() 68 | // self?.tableView.stopFooterRefreshing() 69 | // } 70 | // })) 71 | return tableView 72 | }() 73 | 74 | var count: Int = 0 75 | 76 | override func viewDidLoad() { 77 | super.viewDidLoad() 78 | if #available(iOS 13.0, *) { 79 | self.view.backgroundColor = UIColor.init(dynamicProvider: { traitCollection in 80 | return (traitCollection.userInterfaceStyle == .dark) ? .black : .white 81 | }) 82 | } else { 83 | self.view.backgroundColor = .white 84 | } 85 | self.view.addSubview(self.tableView) 86 | self.tableView.startHeaderRefreshing() 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /MZRefresh/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // MZRefresh 4 | // 5 | // Created by 曾龙 on 2022/1/10. 6 | // 7 | 8 | import UIKit 9 | 10 | let SCREEN_WIDTH = UIScreen.main.bounds.width 11 | let SCREEN_HEIGHT = UIScreen.main.bounds.height 12 | 13 | class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource { 14 | 15 | var dataSource: [String] = ["Normal-Scroll-Refresh", "Normal-TableView-Refresh", "Normal-CollectionView-Refresh", "Normal-Refresh-Type", "Gif-Refresh", "OnlyGif-Refresh", "Default-NoMoreData-Refresh", "Custom-NoMoreData-Refresh"] 16 | 17 | override func viewDidLoad() { 18 | super.viewDidLoad() 19 | if #available(iOS 13.0, *) { 20 | self.view.backgroundColor = UIColor.init(dynamicProvider: { traitCollection in 21 | return (traitCollection.userInterfaceStyle == .dark) ? .black : .white 22 | }) 23 | } else { 24 | self.view.backgroundColor = .white 25 | } 26 | self.title = "MZRefresh" 27 | self.config() 28 | } 29 | 30 | //MARK:- UITableViewDataSource 31 | func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 32 | return self.dataSource.count 33 | } 34 | 35 | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { 36 | let cell = UITableViewCell() 37 | cell.textLabel?.text = self.dataSource[indexPath.row] 38 | cell.selectionStyle = .none 39 | return cell 40 | } 41 | 42 | //MARK:- UITableViewDelegate 43 | func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { 44 | return 50 45 | } 46 | 47 | func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { 48 | var controller: UIViewController = UIViewController() 49 | switch indexPath.row { 50 | case 0: 51 | controller = NormalRefreshController() 52 | case 1: 53 | controller = TableViewRefreshController() 54 | case 2: 55 | controller = CollectionViewRefreshController() 56 | case 3: 57 | controller = RefreshTypeController() 58 | case 4: 59 | controller = GifRefreshController() 60 | case 5: 61 | controller = OnlyGifRefreshController() 62 | case 6: 63 | controller = DefaultNoMoreDataController() 64 | case 7: 65 | controller = CustomNoMoreDataController() 66 | default: 67 | break 68 | } 69 | controller.title = self.dataSource[indexPath.row] 70 | self.navigationController?.pushViewController(controller, animated: true) 71 | } 72 | 73 | func config() { 74 | if #available(iOS 15.0, *) { 75 | UITableView.appearance().sectionHeaderTopPadding = 0 76 | // UINavigationBarAppearance属性从iOS13开始 77 | let navBarAppearance = UINavigationBarAppearance() 78 | // 背景色 79 | navBarAppearance.backgroundColor = UIColor.brown 80 | // 去掉半透明效果 81 | navBarAppearance.backgroundEffect = nil 82 | // 去除导航栏阴影(如果不设置clear,导航栏底下会有一条阴影线) 83 | navBarAppearance.shadowColor = UIColor.clear 84 | // 字体颜色 85 | navBarAppearance.titleTextAttributes = [NSAttributedString.Key.foregroundColor: UIColor.white] 86 | self.navigationController?.navigationBar.standardAppearance = navBarAppearance 87 | self.navigationController?.navigationBar.scrollEdgeAppearance = navBarAppearance 88 | } 89 | } 90 | } 91 | 92 | -------------------------------------------------------------------------------- /Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallRotateChase.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NVActivityIndicatorAnimationBallRotateChase.swift 3 | // NVActivityIndicatorView 4 | // 5 | // The MIT License (MIT) 6 | 7 | // Copyright (c) 2016 Vinh Nguyen 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 all 17 | // 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 THE 25 | // SOFTWARE. 26 | // 27 | 28 | #if canImport(UIKit) 29 | import UIKit 30 | 31 | class NVActivityIndicatorAnimationBallRotateChase: NVActivityIndicatorAnimationDelegate { 32 | 33 | func setUpAnimation(in layer: CALayer, size: CGSize, color: UIColor) { 34 | let circleSize = size.width / 5 35 | 36 | // Draw circles 37 | for i in 0 ..< 5 { 38 | let factor = Float(i) * 1 / 5 39 | let circle = NVActivityIndicatorShape.circle.layerWith(size: CGSize(width: circleSize, height: circleSize), color: color) 40 | let animation = rotateAnimation(factor, x: layer.bounds.size.width / 2, y: layer.bounds.size.height / 2, size: CGSize(width: size.width - circleSize, height: size.height - circleSize)) 41 | 42 | circle.frame = CGRect(x: 0, y: 0, width: circleSize, height: circleSize) 43 | circle.add(animation, forKey: "animation") 44 | layer.addSublayer(circle) 45 | } 46 | } 47 | 48 | func rotateAnimation(_ rate: Float, x: CGFloat, y: CGFloat, size: CGSize) -> CAAnimationGroup { 49 | let duration: CFTimeInterval = 1.5 50 | let fromScale = 1 - rate 51 | let toScale = 0.2 + rate 52 | let timeFunc = CAMediaTimingFunction(controlPoints: 0.5, 0.15 + rate, 0.25, 1) 53 | 54 | // Scale animation 55 | let scaleAnimation = CABasicAnimation(keyPath: "transform.scale") 56 | scaleAnimation.duration = duration 57 | scaleAnimation.repeatCount = HUGE 58 | scaleAnimation.fromValue = fromScale 59 | scaleAnimation.toValue = toScale 60 | 61 | // Position animation 62 | let positionAnimation = CAKeyframeAnimation(keyPath: "position") 63 | positionAnimation.duration = duration 64 | positionAnimation.repeatCount = HUGE 65 | positionAnimation.path = UIBezierPath(arcCenter: CGPoint(x: x, y: y), radius: size.width / 2, startAngle: CGFloat(3 * Double.pi * 0.5), endAngle: CGFloat(3 * Double.pi * 0.5 + 2 * Double.pi), clockwise: true).cgPath 66 | 67 | // Aniamtion 68 | let animation = CAAnimationGroup() 69 | animation.animations = [scaleAnimation, positionAnimation] 70 | animation.timingFunction = timeFunc 71 | animation.duration = duration 72 | animation.repeatCount = HUGE 73 | animation.isRemovedOnCompletion = false 74 | 75 | return animation 76 | } 77 | } 78 | #endif 79 | -------------------------------------------------------------------------------- /MZRefresh/CollectionViewRefreshController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CollectionViewRefreshController.swift 3 | // MZRefresh 4 | // 5 | // Created by 曾龙 on 2022/1/13. 6 | // 7 | 8 | import UIKit 9 | 10 | class CollectionViewRefreshController: UIViewController, UICollectionViewDataSource { 11 | 12 | func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { 13 | return self.count 14 | } 15 | 16 | func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { 17 | let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "UICollectionViewCell", for: indexPath) 18 | cell.backgroundColor = .gray 19 | if cell.contentView.subviews.count == 0 { 20 | let label = UILabel() 21 | label.textColor = .white 22 | label.text = "第\(indexPath.row + 1)项" 23 | label.center = cell.contentView.center 24 | cell.contentView.addSubview(label) 25 | } else { 26 | if let label = cell.contentView.subviews.first as? UILabel { 27 | label.text = "第\(indexPath.row + 1)项" 28 | } 29 | } 30 | return cell 31 | } 32 | 33 | 34 | lazy var collectionView: UICollectionView = { 35 | let space: CGFloat = 15.0 36 | let itemWidth = (SCREEN_WIDTH - space * 3) / 2 37 | 38 | let layout = UICollectionViewFlowLayout() 39 | layout.itemSize = CGSize(width: itemWidth, height: itemWidth) 40 | layout.sectionInset = UIEdgeInsets(top: space, left: space, bottom: space, right: space) 41 | layout.minimumLineSpacing = space 42 | layout.minimumInteritemSpacing = space 43 | 44 | let collectionView = UICollectionView(frame: self.view.bounds, collectionViewLayout: layout) 45 | if #available(iOS 13.0, *) { 46 | collectionView.backgroundColor = UIColor.init(dynamicProvider: { traitCollection in 47 | return (traitCollection.userInterfaceStyle == .dark) ? .black : .white 48 | }) 49 | } else { 50 | collectionView.backgroundColor = .white 51 | } 52 | collectionView.dataSource = self 53 | collectionView.register(UICollectionViewCell.classForCoder(), forCellWithReuseIdentifier: "UICollectionViewCell") 54 | collectionView.setRefreshHeader(MZRefreshNormalHeader(type: .lineScaleParty, color: .brown, beginRefresh: { 55 | DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 2) { [weak self] in 56 | self?.count = 10 57 | self?.collectionView.reloadData() 58 | self?.collectionView.stopHeaderRefreshing() 59 | } 60 | })) 61 | collectionView.setRefreshFooter(MZRefreshNormalFooter(type: .lineScaleParty, color: .brown, beginRefresh: { 62 | DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 2) { [weak self] in 63 | self?.count += 10 64 | self?.collectionView.reloadData() 65 | self?.collectionView.stopFooterRefreshing() 66 | } 67 | })) 68 | return collectionView 69 | }() 70 | 71 | var count: Int = 0 72 | 73 | override func viewDidLoad() { 74 | super.viewDidLoad() 75 | if #available(iOS 13.0, *) { 76 | self.view.backgroundColor = UIColor.init(dynamicProvider: { traitCollection in 77 | return (traitCollection.userInterfaceStyle == .dark) ? .black : .white 78 | }) 79 | } else { 80 | self.view.backgroundColor = .white 81 | } 82 | self.view.addSubview(self.collectionView) 83 | self.collectionView.startHeaderRefreshing() 84 | } 85 | 86 | } 87 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-MZRefresh/Pods-MZRefresh-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | The MIT License (MIT) 18 | 19 | Copyright (c) 2016 Vinh Nguyen 20 | 21 | Permission is hereby granted, free of charge, to any person obtaining a copy 22 | of this software and associated documentation files (the "Software"), to deal 23 | in the Software without restriction, including without limitation the rights 24 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 25 | copies of the Software, and to permit persons to whom the Software is 26 | furnished to do so, subject to the following conditions: 27 | 28 | The above copyright notice and this permission notice shall be included in all 29 | copies or substantial portions of the Software. 30 | 31 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 32 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 33 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 34 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 35 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 36 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 37 | SOFTWARE. 38 | 39 | License 40 | MIT 41 | Title 42 | NVActivityIndicatorView 43 | Type 44 | PSGroupSpecifier 45 | 46 | 47 | FooterText 48 | Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 49 | 50 | Permission is hereby granted, free of charge, to any person obtaining a copy 51 | of this software and associated documentation files (the "Software"), to deal 52 | in the Software without restriction, including without limitation the rights 53 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 54 | copies of the Software, and to permit persons to whom the Software is 55 | furnished to do so, subject to the following conditions: 56 | 57 | The above copyright notice and this permission notice shall be included in 58 | all copies or substantial portions of the Software. 59 | 60 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 61 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 62 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 63 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 64 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 65 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 66 | THE SOFTWARE. 67 | 68 | License 69 | MIT 70 | Title 71 | SnapKit 72 | Type 73 | PSGroupSpecifier 74 | 75 | 76 | FooterText 77 | Generated by CocoaPods - https://cocoapods.org 78 | Title 79 | 80 | Type 81 | PSGroupSpecifier 82 | 83 | 84 | StringsTable 85 | Acknowledgements 86 | Title 87 | Acknowledgements 88 | 89 | 90 | --------------------------------------------------------------------------------