Repository: CoderMJLee/MJRefresh
Branch: master
Commit: 5647d82cd7e0
Files: 209
Total size: 364.5 KB
Directory structure:
gitextract_a133_7b3/
├── .github/
│ └── ISSUE_TEMPLATE/
│ ├── bug--.md
│ └── feature--.md
├── .gitignore
├── .travis.yml
├── Examples/
│ ├── MJRefreshExample/
│ │ ├── MJRefreshExample/
│ │ │ ├── Base.lproj/
│ │ │ │ ├── LaunchScreen.xib
│ │ │ │ └── Main.storyboard
│ │ │ ├── Classes/
│ │ │ │ ├── Category/
│ │ │ │ │ ├── UIViewController+Example.h
│ │ │ │ │ └── UIViewController+Example.m
│ │ │ │ ├── DIY/
│ │ │ │ │ ├── MJChiBaoZiFooter.h
│ │ │ │ │ ├── MJChiBaoZiFooter.m
│ │ │ │ │ ├── MJChiBaoZiFooter2.h
│ │ │ │ │ ├── MJChiBaoZiFooter2.m
│ │ │ │ │ ├── MJChiBaoZiHeader.h
│ │ │ │ │ ├── MJChiBaoZiHeader.m
│ │ │ │ │ ├── MJDIYAutoFooter.h
│ │ │ │ │ ├── MJDIYAutoFooter.m
│ │ │ │ │ ├── MJDIYBackFooter.h
│ │ │ │ │ ├── MJDIYBackFooter.m
│ │ │ │ │ ├── MJDIYHeader.h
│ │ │ │ │ └── MJDIYHeader.m
│ │ │ │ ├── First/
│ │ │ │ │ ├── MJExample.h
│ │ │ │ │ ├── MJExample.m
│ │ │ │ │ ├── MJExampleViewController.h
│ │ │ │ │ ├── MJExampleViewController.m
│ │ │ │ │ ├── MJExampleWindow.h
│ │ │ │ │ ├── MJExampleWindow.m
│ │ │ │ │ ├── MJSingleViewController.h
│ │ │ │ │ ├── MJSingleViewController.m
│ │ │ │ │ ├── MJTempViewController.h
│ │ │ │ │ └── MJTempViewController.m
│ │ │ │ ├── Other/
│ │ │ │ │ ├── AppDelegate.h
│ │ │ │ │ └── AppDelegate.m
│ │ │ │ ├── Second/
│ │ │ │ │ ├── MJCollectionViewController.h
│ │ │ │ │ ├── MJCollectionViewController.m
│ │ │ │ │ ├── MJHorizontalCollectionViewController.h
│ │ │ │ │ ├── MJHorizontalCollectionViewController.m
│ │ │ │ │ ├── MJPinHeaderCollectionViewController.swift
│ │ │ │ │ ├── MJTableViewController.h
│ │ │ │ │ ├── MJTableViewController.m
│ │ │ │ │ ├── MJTestViewController.h
│ │ │ │ │ ├── MJTestViewController.m
│ │ │ │ │ ├── MJTestViewController.xib
│ │ │ │ │ ├── MJWebViewViewController.h
│ │ │ │ │ ├── MJWebViewViewController.m
│ │ │ │ │ └── MJWebViewViewController.xib
│ │ │ │ ├── SwiftExample/
│ │ │ │ │ └── MJWKWebViewController.swift
│ │ │ │ └── i18n/
│ │ │ │ ├── CustomLanguages.bundle/
│ │ │ │ │ ├── en.lproj/
│ │ │ │ │ │ └── Localizable.strings
│ │ │ │ │ ├── ko.lproj/
│ │ │ │ │ │ └── Localizable.strings
│ │ │ │ │ ├── ru.lproj/
│ │ │ │ │ │ └── Localizable.strings
│ │ │ │ │ ├── uk.lproj/
│ │ │ │ │ │ └── Localizable.strings
│ │ │ │ │ ├── zh-Hans.lproj/
│ │ │ │ │ │ └── Localizable.strings
│ │ │ │ │ └── zh-Hant.lproj/
│ │ │ │ │ └── Localizable.strings
│ │ │ │ ├── I18NExampleViewController.swift
│ │ │ │ ├── ar.lproj/
│ │ │ │ │ └── MJRefresh_i18n.strings
│ │ │ │ ├── en.lproj/
│ │ │ │ │ └── MJRefresh_i18n.strings
│ │ │ │ ├── ko.lproj/
│ │ │ │ │ └── MJRefresh_i18n.strings
│ │ │ │ ├── ru.lproj/
│ │ │ │ │ └── MJRefresh_i18n.strings
│ │ │ │ ├── uk.lproj/
│ │ │ │ │ └── MJRefresh_i18n.strings
│ │ │ │ ├── zh-Hans.lproj/
│ │ │ │ │ └── MJRefresh_i18n.strings
│ │ │ │ └── zh-Hant.lproj/
│ │ │ │ └── MJRefresh_i18n.strings
│ │ │ ├── Images.xcassets/
│ │ │ │ ├── AppIcon.appiconset/
│ │ │ │ │ └── Contents.json
│ │ │ │ ├── Contents.json
│ │ │ │ ├── DianPing/
│ │ │ │ │ ├── dropdown_anim__0001.imageset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ ├── dropdown_anim__00010.imageset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ ├── dropdown_anim__00011.imageset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ ├── dropdown_anim__00012.imageset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ ├── dropdown_anim__00013.imageset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ ├── dropdown_anim__00014.imageset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ ├── dropdown_anim__00015.imageset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ ├── dropdown_anim__00016.imageset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ ├── dropdown_anim__00017.imageset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ ├── dropdown_anim__00018.imageset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ ├── dropdown_anim__00019.imageset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ ├── dropdown_anim__0002.imageset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ ├── dropdown_anim__00020.imageset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ ├── dropdown_anim__00021.imageset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ ├── dropdown_anim__00022.imageset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ ├── dropdown_anim__00023.imageset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ ├── dropdown_anim__00024.imageset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ ├── dropdown_anim__00025.imageset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ ├── dropdown_anim__00026.imageset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ ├── dropdown_anim__00027.imageset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ ├── dropdown_anim__00028.imageset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ ├── dropdown_anim__00029.imageset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ ├── dropdown_anim__0003.imageset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ ├── dropdown_anim__00030.imageset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ ├── dropdown_anim__00031.imageset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ ├── dropdown_anim__00032.imageset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ ├── dropdown_anim__00033.imageset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ ├── dropdown_anim__00034.imageset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ ├── dropdown_anim__00035.imageset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ ├── dropdown_anim__00036.imageset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ ├── dropdown_anim__00037.imageset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ ├── dropdown_anim__00038.imageset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ ├── dropdown_anim__00039.imageset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ ├── dropdown_anim__0004.imageset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ ├── dropdown_anim__00040.imageset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ ├── dropdown_anim__00041.imageset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ ├── dropdown_anim__00042.imageset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ ├── dropdown_anim__00043.imageset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ ├── dropdown_anim__00044.imageset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ ├── dropdown_anim__00045.imageset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ ├── dropdown_anim__00046.imageset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ ├── dropdown_anim__00047.imageset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ ├── dropdown_anim__00048.imageset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ ├── dropdown_anim__00049.imageset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ ├── dropdown_anim__0005.imageset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ ├── dropdown_anim__00050.imageset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ ├── dropdown_anim__00051.imageset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ ├── dropdown_anim__00052.imageset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ ├── dropdown_anim__00053.imageset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ ├── dropdown_anim__00054.imageset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ ├── dropdown_anim__00055.imageset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ ├── dropdown_anim__00056.imageset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ ├── dropdown_anim__00057.imageset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ ├── dropdown_anim__00058.imageset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ ├── dropdown_anim__00059.imageset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ ├── dropdown_anim__0006.imageset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ ├── dropdown_anim__00060.imageset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ ├── dropdown_anim__0007.imageset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ ├── dropdown_anim__0008.imageset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ ├── dropdown_anim__0009.imageset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ ├── dropdown_loading_01.imageset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ ├── dropdown_loading_02.imageset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ └── dropdown_loading_03.imageset/
│ │ │ │ │ └── Contents.json
│ │ │ │ ├── MJRefresh.imageset/
│ │ │ │ │ └── Contents.json
│ │ │ │ ├── NavBar.imageset/
│ │ │ │ │ └── Contents.json
│ │ │ │ ├── NavBar64.imageset/
│ │ │ │ │ └── Contents.json
│ │ │ │ └── logo.imageset/
│ │ │ │ └── Contents.json
│ │ │ ├── Info.plist
│ │ │ ├── MJRefreshExample-Bridging-Header.h
│ │ │ ├── PrefixHeader.pch
│ │ │ └── main.m
│ │ ├── MJRefreshExample.xcodeproj/
│ │ │ └── project.pbxproj
│ │ └── MJRefreshExampleTests/
│ │ ├── Info.plist
│ │ └── MJRefreshExampleTests.m
│ └── SPMTestExample/
│ ├── SPMTestExample/
│ │ ├── AppDelegate.swift
│ │ ├── Assets.xcassets/
│ │ │ ├── AccentColor.colorset/
│ │ │ │ └── Contents.json
│ │ │ ├── AppIcon.appiconset/
│ │ │ │ └── Contents.json
│ │ │ └── Contents.json
│ │ ├── Base.lproj/
│ │ │ ├── LaunchScreen.storyboard
│ │ │ └── Main.storyboard
│ │ ├── Info.plist
│ │ ├── SceneDelegate.swift
│ │ └── ViewController.swift
│ └── SPMTestExample.xcodeproj/
│ └── project.pbxproj
├── LICENSE
├── MJRefresh/
│ ├── Base/
│ │ ├── MJRefreshAutoFooter.h
│ │ ├── MJRefreshAutoFooter.m
│ │ ├── MJRefreshBackFooter.h
│ │ ├── MJRefreshBackFooter.m
│ │ ├── MJRefreshComponent.h
│ │ ├── MJRefreshComponent.m
│ │ ├── MJRefreshFooter.h
│ │ ├── MJRefreshFooter.m
│ │ ├── MJRefreshHeader.h
│ │ ├── MJRefreshHeader.m
│ │ ├── MJRefreshTrailer.h
│ │ └── MJRefreshTrailer.m
│ ├── Custom/
│ │ ├── Footer/
│ │ │ ├── Auto/
│ │ │ │ ├── MJRefreshAutoGifFooter.h
│ │ │ │ ├── MJRefreshAutoGifFooter.m
│ │ │ │ ├── MJRefreshAutoNormalFooter.h
│ │ │ │ ├── MJRefreshAutoNormalFooter.m
│ │ │ │ ├── MJRefreshAutoStateFooter.h
│ │ │ │ └── MJRefreshAutoStateFooter.m
│ │ │ └── Back/
│ │ │ ├── MJRefreshBackGifFooter.h
│ │ │ ├── MJRefreshBackGifFooter.m
│ │ │ ├── MJRefreshBackNormalFooter.h
│ │ │ ├── MJRefreshBackNormalFooter.m
│ │ │ ├── MJRefreshBackStateFooter.h
│ │ │ └── MJRefreshBackStateFooter.m
│ │ ├── Header/
│ │ │ ├── MJRefreshGifHeader.h
│ │ │ ├── MJRefreshGifHeader.m
│ │ │ ├── MJRefreshNormalHeader.h
│ │ │ ├── MJRefreshNormalHeader.m
│ │ │ ├── MJRefreshStateHeader.h
│ │ │ └── MJRefreshStateHeader.m
│ │ └── Trailer/
│ │ ├── MJRefreshNormalTrailer.h
│ │ ├── MJRefreshNormalTrailer.m
│ │ ├── MJRefreshStateTrailer.h
│ │ └── MJRefreshStateTrailer.m
│ ├── Info.plist
│ ├── MJRefresh.bundle/
│ │ ├── en.lproj/
│ │ │ └── Localizable.strings
│ │ ├── ko.lproj/
│ │ │ └── Localizable.strings
│ │ ├── ru.lproj/
│ │ │ └── Localizable.strings
│ │ ├── uk.lproj/
│ │ │ └── Localizable.strings
│ │ ├── zh-Hans.lproj/
│ │ │ └── Localizable.strings
│ │ └── zh-Hant.lproj/
│ │ └── Localizable.strings
│ ├── MJRefresh.h
│ ├── MJRefreshConfig.h
│ ├── MJRefreshConfig.m
│ ├── MJRefreshConst.h
│ ├── MJRefreshConst.m
│ ├── NSBundle+MJRefresh.h
│ ├── NSBundle+MJRefresh.m
│ ├── PrivacyInfo.xcprivacy
│ ├── UICollectionViewLayout+MJRefresh.h
│ ├── UICollectionViewLayout+MJRefresh.m
│ ├── UIScrollView+MJExtension.h
│ ├── UIScrollView+MJExtension.m
│ ├── UIScrollView+MJRefresh.h
│ ├── UIScrollView+MJRefresh.m
│ ├── UIView+MJExtension.h
│ └── UIView+MJExtension.m
├── MJRefresh.podspec
├── MJRefresh.xcodeproj/
│ ├── project.pbxproj
│ └── xcshareddata/
│ └── xcschemes/
│ └── MJRefresh.xcscheme
├── Package.swift
└── README.md
================================================
FILE CONTENTS
================================================
================================================
FILE: .github/ISSUE_TEMPLATE/bug--.md
================================================
---
name: Bug上报
about: 提交Bug让框架更加健壮
title: ''
labels: bug
assignees: ''
---
🥶🥶🥶🥶🥶🥶🥶🥶🥶🥶🥶🥶🥶🥶🥶🥶🥶🥶🥶🥶🥶🥶🥶🥶🥶🥶🥶🥶🥶
😁为了能够更好地复现问题和修复问题, 请提供 Demo 和详细的 bug 重现步骤😭
🥶🥶🥶🥶🥶🥶🥶🥶🥶🥶🥶🥶🥶🥶🥶🥶🥶🥶🥶🥶🥶🥶🥶🥶🥶🥶🥶🥶🥶
> 记得删除以上内容
**描述bug**
清晰简单地描述这个bug是啥
**必现/偶发?**
必现
**怎么样重现这个bug**
1. 显示哪个页面
2. 点击哪个位置
3. 滚动到哪个位置
4. 发生了什么错误
**你期望的结果是什么?**
你本来期望得到的正确结果是怎样的?就是解决bug之后的结果
**截图**
如果有必要的话,请上传几张截图
**运行环境**
- iPhone6
- iOS8.1
- Xcode10
**额外的**
最好能提供出现bug的Demo
================================================
FILE: .github/ISSUE_TEMPLATE/feature--.md
================================================
---
name: Feature建议
about: 为框架提供新功能建议
title: ''
labels: feature
assignees: ''
---
**你的新功能建议是否牵扯到某个常见的问题?**
比如,在开发中,经常遇到XXX问题,目前框架的功能不足以解决这个问题
**你希望达到的效果**
比如,我希望框架能够帮助我解决XXX问题,实现XXXX那样的效果
**你能考虑到的可选实现方案**
描述一下你认为要实现这个功能,有哪些可行的一些实现方案?
================================================
FILE: .gitignore
================================================
.DS_Store
# Xcode
build/*
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
*.xcworkspace
!default.xcworkspace
xcuserdata
profile
*.moved-aside
*.xcuserstate
================================================
FILE: .travis.yml
================================================
language: objective-c
xcode_project: MJRefreshExample.xcodeproj
xcode_scheme: MJRefresh
env:
global:
- FRAMEWORK_NAME=MJRefresh
before_install:
- gem install xcpretty
script:
- xcodebuild -project $xcode_project -scheme $FRAMEWORK_NAME build | xcpretty
- pod lib lint
- carthage build --no-skip-current
notifications:
email: false
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Base.lproj/LaunchScreen.xib
================================================
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Base.lproj/Main.storyboard
================================================
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Classes/Category/UIViewController+Example.h
================================================
//
// UIViewController+Example.h
// MJRefreshExample
//
// Created by MJ Lee on 15/3/12.
// Copyright (c) 2015年 小码哥. All rights reserved.
//
#import
@interface UIViewController (Example)
@property (copy, nonatomic) NSString *method;
@end
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Classes/Category/UIViewController+Example.m
================================================
//
// UIViewController+Example.m
// MJRefreshExample
//
// Created by MJ Lee on 15/3/12.
// Copyright (c) 2015年 小码哥. All rights reserved.
//
#import "UIViewController+Example.h"
#import
@implementation UIViewController (Example)
#pragma mark - swizzle
+ (void)load
{
Method method1 = class_getInstanceMethod([self class], NSSelectorFromString(@"dealloc"));
Method method2 = class_getInstanceMethod([self class], @selector(deallocSwizzle));
method_exchangeImplementations(method1, method2);
}
- (void)deallocSwizzle
{
NSLog(@"%@被销毁了", self);
[self deallocSwizzle];
}
static char MethodKey;
- (void)setMethod:(NSString *)method
{
objc_setAssociatedObject(self, &MethodKey, method, OBJC_ASSOCIATION_COPY_NONATOMIC);
}
- (NSString *)method
{
return objc_getAssociatedObject(self, &MethodKey);
}
@end
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Classes/DIY/MJChiBaoZiFooter.h
================================================
//
// MJChiBaoZiFooter.h
// MJRefreshExample
//
// Created by MJ Lee on 15/6/12.
// Copyright © 2015年 小码哥. All rights reserved.
//
@import MJRefresh;
@interface MJChiBaoZiFooter : MJRefreshAutoGifFooter
@end
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Classes/DIY/MJChiBaoZiFooter.m
================================================
//
// MJChiBaoZiFooter.m
// MJRefreshExample
//
// Created by MJ Lee on 15/6/12.
// Copyright © 2015年 小码哥. All rights reserved.
//
#import "MJChiBaoZiFooter.h"
@implementation MJChiBaoZiFooter
#pragma mark - 重写方法
#pragma mark 基本设置
- (void)prepare
{
[super prepare];
// 设置正在刷新状态的动画图片
NSMutableArray *refreshingImages = [NSMutableArray array];
for (NSUInteger i = 1; i<=3; i++) {
UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"dropdown_loading_0%zd", i]];
[refreshingImages addObject:image];
}
[self setImages:refreshingImages forState:MJRefreshStateRefreshing];
}
@end
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Classes/DIY/MJChiBaoZiFooter2.h
================================================
//
// MJChiBaoZiFooter2.h
// MJRefreshExample
//
// Created by MJ Lee on 15/6/12.
// Copyright © 2015年 小码哥. All rights reserved.
//
@import MJRefresh;
@interface MJChiBaoZiFooter2 : MJRefreshBackGifFooter
@end
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Classes/DIY/MJChiBaoZiFooter2.m
================================================
//
// MJChiBaoZiFooter2.m
// MJRefreshExample
//
// Created by MJ Lee on 15/6/12.
// Copyright © 2015年 小码哥. All rights reserved.
//
#import "MJChiBaoZiFooter2.h"
@implementation MJChiBaoZiFooter2
#pragma mark - 重写方法
#pragma mark 基本设置
- (void)prepare
{
[super prepare];
// 设置普通状态的动画图片
NSMutableArray *idleImages = [NSMutableArray array];
for (NSUInteger i = 1; i<=60; i++) {
UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"dropdown_anim__000%zd", i]];
[idleImages addObject:image];
}
[self setImages:idleImages forState:MJRefreshStateIdle];
// 设置即将刷新状态的动画图片(一松开就会刷新的状态)
NSMutableArray *refreshingImages = [NSMutableArray array];
for (NSUInteger i = 1; i<=3; i++) {
UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"dropdown_loading_0%zd", i]];
[refreshingImages addObject:image];
}
[self setImages:refreshingImages forState:MJRefreshStatePulling];
// 设置正在刷新状态的动画图片
[self setImages:refreshingImages forState:MJRefreshStateRefreshing];
}
@end
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Classes/DIY/MJChiBaoZiHeader.h
================================================
//
// MJChiBaoZiHeader.h
// MJRefreshExample
//
// Created by MJ Lee on 15/6/12.
// Copyright © 2015年 小码哥. All rights reserved.
// 吃包子效果的头部控件
@import MJRefresh;
@interface MJChiBaoZiHeader : MJRefreshGifHeader
@end
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Classes/DIY/MJChiBaoZiHeader.m
================================================
//
// MJChiBaoZiHeader.m
// MJRefreshExample
//
// Created by MJ Lee on 15/6/12.
// Copyright © 2015年 小码哥. All rights reserved.
//
#import "MJChiBaoZiHeader.h"
@implementation MJChiBaoZiHeader
#pragma mark - 重写方法
#pragma mark 基本设置
- (void)prepare
{
[super prepare];
// 设置普通状态的动画图片
NSMutableArray *idleImages = [NSMutableArray array];
for (NSUInteger i = 1; i<=60; i++) {
UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"dropdown_anim__000%zd", i]];
[idleImages addObject:image];
}
[self setImages:idleImages forState:MJRefreshStateIdle];
// 设置即将刷新状态的动画图片(一松开就会刷新的状态)
NSMutableArray *refreshingImages = [NSMutableArray array];
for (NSUInteger i = 1; i<=3; i++) {
UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"dropdown_loading_0%zd", i]];
[refreshingImages addObject:image];
}
[self setImages:refreshingImages forState:MJRefreshStatePulling];
// 设置正在刷新状态的动画图片
[self setImages:refreshingImages forState:MJRefreshStateRefreshing];
}
@end
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Classes/DIY/MJDIYAutoFooter.h
================================================
//
// MJDIYAutoFooter.h
// MJRefreshExample
//
// Created by MJ Lee on 15/6/13.
// Copyright © 2015年 小码哥. All rights reserved.
//
@import MJRefresh;
@interface MJDIYAutoFooter : MJRefreshAutoFooter
@end
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Classes/DIY/MJDIYAutoFooter.m
================================================
//
// MJDIYAutoFooter.m
// MJRefreshExample
//
// Created by MJ Lee on 15/6/13.
// Copyright © 2015年 小码哥. All rights reserved.
//
#import "MJDIYAutoFooter.h"
@interface MJDIYAutoFooter()
@property (weak, nonatomic) UILabel *label;
@property (weak, nonatomic) UISwitch *s;
@property (weak, nonatomic) UIActivityIndicatorView *loading;
@end
@implementation MJDIYAutoFooter
#pragma mark - 重写方法
#pragma mark 在这里做一些初始化配置(比如添加子控件)
- (void)prepare
{
[super prepare];
// 设置控件的高度
self.mj_h = 50;
// 添加label
UILabel *label = [[UILabel alloc] init];
label.textColor = [UIColor colorWithRed:1.0 green:0.5 blue:0.0 alpha:1.0];
label.font = [UIFont boldSystemFontOfSize:16];
label.textAlignment = NSTextAlignmentCenter;
[self addSubview:label];
self.label = label;
// 打酱油的开关
UISwitch *s = [[UISwitch alloc] init];
[self addSubview:s];
self.s = s;
// loading
UIActivityIndicatorView *loading = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
[self addSubview:loading];
self.loading = loading;
}
#pragma mark 在这里设置子控件的位置和尺寸
- (void)placeSubviews
{
[super placeSubviews];
self.label.frame = self.bounds;
self.s.center = CGPointMake(self.mj_w - 20, self.mj_h - 20);
self.loading.center = CGPointMake(30, self.mj_h * 0.5);
}
#pragma mark 监听scrollView的contentOffset改变
- (void)scrollViewContentOffsetDidChange:(NSDictionary *)change
{
[super scrollViewContentOffsetDidChange:change];
}
#pragma mark 监听scrollView的contentSize改变
- (void)scrollViewContentSizeDidChange:(NSDictionary *)change
{
[super scrollViewContentSizeDidChange:change];
}
#pragma mark 监听scrollView的拖拽状态改变
- (void)scrollViewPanStateDidChange:(NSDictionary *)change
{
[super scrollViewPanStateDidChange:change];
}
#pragma mark 监听控件的刷新状态
- (void)setState:(MJRefreshState)state
{
MJRefreshCheckState;
switch (state) {
case MJRefreshStateIdle:
self.label.text = @"赶紧上拉吖(开关是打酱油滴)";
[self.loading stopAnimating];
[self.s setOn:NO animated:YES];
break;
case MJRefreshStateRefreshing:
[self.s setOn:YES animated:YES];
self.label.text = @"加载数据中(开关是打酱油滴)";
[self.loading startAnimating];
break;
case MJRefreshStateNoMoreData:
self.label.text = @"木有数据了(开关是打酱油滴)";
[self.s setOn:NO animated:YES];
[self.loading stopAnimating];
break;
default:
break;
}
}
@end
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Classes/DIY/MJDIYBackFooter.h
================================================
//
// MJDIYBackFooter.h
// MJRefreshExample
//
// Created by MJ Lee on 15/6/13.
// Copyright © 2015年 小码哥. All rights reserved.
//
@import MJRefresh;
@interface MJDIYBackFooter : MJRefreshBackFooter
@end
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Classes/DIY/MJDIYBackFooter.m
================================================
//
// MJDIYBackFooter.m
// MJRefreshExample
//
// Created by MJ Lee on 15/6/13.
// Copyright © 2015年 小码哥. All rights reserved.
//
#import "MJDIYBackFooter.h"
@interface MJDIYBackFooter()
@property (weak, nonatomic) UILabel *label;
@property (weak, nonatomic) UISwitch *s;
@property (weak, nonatomic) UIImageView *logo;
@property (weak, nonatomic) UIActivityIndicatorView *loading;
@end
@implementation MJDIYBackFooter
#pragma mark - 重写方法
#pragma mark 在这里做一些初始化配置(比如添加子控件)
- (void)prepare
{
[super prepare];
// 设置控件的高度
self.mj_h = 50;
// 添加label
UILabel *label = [[UILabel alloc] init];
label.textColor = [UIColor colorWithRed:1.0 green:0.5 blue:0.0 alpha:1.0];
label.font = [UIFont boldSystemFontOfSize:16];
label.textAlignment = NSTextAlignmentCenter;
[self addSubview:label];
self.label = label;
// 打酱油的开关
UISwitch *s = [[UISwitch alloc] init];
[self addSubview:s];
self.s = s;
// logo
UIImageView *logo = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Logo"]];
logo.contentMode = UIViewContentModeScaleAspectFit;
[self addSubview:logo];
self.logo = logo;
// loading
UIActivityIndicatorView *loading = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
[self addSubview:loading];
self.loading = loading;
}
#pragma mark 在这里设置子控件的位置和尺寸
- (void)placeSubviews
{
[super placeSubviews];
self.label.frame = self.bounds;
self.logo.bounds = CGRectMake(0, 0, self.bounds.size.width, 100);
self.logo.center = CGPointMake(self.mj_w * 0.5, self.mj_h + self.logo.mj_h * 0.5);
self.loading.center = CGPointMake(self.mj_w - 30, self.mj_h * 0.5);
}
#pragma mark 监听scrollView的contentOffset改变
- (void)scrollViewContentOffsetDidChange:(NSDictionary *)change
{
[super scrollViewContentOffsetDidChange:change];
}
#pragma mark 监听scrollView的contentSize改变
- (void)scrollViewContentSizeDidChange:(NSDictionary *)change
{
[super scrollViewContentSizeDidChange:change];
}
#pragma mark 监听scrollView的拖拽状态改变
- (void)scrollViewPanStateDidChange:(NSDictionary *)change
{
[super scrollViewPanStateDidChange:change];
}
#pragma mark 监听控件的刷新状态
- (void)setState:(MJRefreshState)state
{
MJRefreshCheckState;
switch (state) {
case MJRefreshStateIdle:
[self.loading stopAnimating];
[self.s setOn:NO animated:YES];
self.label.text = @"赶紧上拉吖(开关是打酱油滴)";
break;
case MJRefreshStatePulling:
[self.loading stopAnimating];
[self.s setOn:YES animated:YES];
self.label.text = @"赶紧放开我吧(开关是打酱油滴)";
break;
case MJRefreshStateRefreshing:
[self.loading startAnimating];
[self.s setOn:YES animated:YES];
self.label.text = @"加载数据中(开关是打酱油滴)";
break;
case MJRefreshStateNoMoreData:
[self.loading stopAnimating];
self.label.text = @"木有数据了(开关是打酱油滴)";
[self.s setOn:NO animated:YES];
default:
break;
}
}
#pragma mark 监听拖拽比例(控件被拖出来的比例)
- (void)setPullingPercent:(CGFloat)pullingPercent
{
[super setPullingPercent:pullingPercent];
// 1.0 0.5 0.0
// 0.5 0.0 0.5
CGFloat red = 1.0 - pullingPercent * 0.5;
CGFloat green = 0.5 - 0.5 * pullingPercent;
CGFloat blue = 0.5 * pullingPercent;
self.label.textColor = [UIColor colorWithRed:red green:green blue:blue alpha:1.0];
}
@end
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Classes/DIY/MJDIYHeader.h
================================================
//
// MJDIYHeader.h
// MJRefreshExample
//
// Created by MJ Lee on 15/6/13.
// Copyright © 2015年 小码哥. All rights reserved.
//
@import MJRefresh;
@interface MJDIYHeader : MJRefreshHeader
@end
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Classes/DIY/MJDIYHeader.m
================================================
//
// MJDIYHeader.m
// MJRefreshExample
//
// Created by MJ Lee on 15/6/13.
// Copyright © 2015年 小码哥. All rights reserved.
//
#import "MJDIYHeader.h"
@interface MJDIYHeader()
@property (weak, nonatomic) UILabel *label;
@property (weak, nonatomic) UISwitch *s;
@property (weak, nonatomic) UIImageView *logo;
@property (weak, nonatomic) UIActivityIndicatorView *loading;
@end
@implementation MJDIYHeader
#pragma mark - 重写方法
#pragma mark 在这里做一些初始化配置(比如添加子控件)
- (void)prepare
{
[super prepare];
// 设置控件的高度
self.mj_h = 50;
// 添加label
UILabel *label = [[UILabel alloc] init];
label.textColor = [UIColor colorWithRed:1.0 green:0.5 blue:0.0 alpha:1.0];
label.font = [UIFont boldSystemFontOfSize:16];
label.textAlignment = NSTextAlignmentCenter;
[self addSubview:label];
self.label = label;
// 打酱油的开关
UISwitch *s = [[UISwitch alloc] init];
[self addSubview:s];
self.s = s;
// logo
UIImageView *logo = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Logo"]];
logo.contentMode = UIViewContentModeScaleAspectFit;
[self addSubview:logo];
self.logo = logo;
// loading
UIActivityIndicatorView *loading = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
[self addSubview:loading];
self.loading = loading;
}
#pragma mark 在这里设置子控件的位置和尺寸
- (void)placeSubviews
{
[super placeSubviews];
self.label.frame = self.bounds;
self.logo.bounds = CGRectMake(0, 0, self.bounds.size.width, 100);
self.logo.center = CGPointMake(self.mj_w * 0.5, - self.logo.mj_h + 20);
self.loading.center = CGPointMake(self.mj_w - 30, self.mj_h * 0.5);
}
#pragma mark 监听scrollView的contentOffset改变
- (void)scrollViewContentOffsetDidChange:(NSDictionary *)change
{
[super scrollViewContentOffsetDidChange:change];
}
#pragma mark 监听scrollView的contentSize改变
- (void)scrollViewContentSizeDidChange:(NSDictionary *)change
{
[super scrollViewContentSizeDidChange:change];
}
#pragma mark 监听scrollView的拖拽状态改变
- (void)scrollViewPanStateDidChange:(NSDictionary *)change
{
[super scrollViewPanStateDidChange:change];
}
#pragma mark 监听控件的刷新状态
- (void)setState:(MJRefreshState)state
{
MJRefreshCheckState;
switch (state) {
case MJRefreshStateIdle:
[self.loading stopAnimating];
[self.s setOn:NO animated:YES];
self.label.text = @"赶紧下拉吖(开关是打酱油滴)";
break;
case MJRefreshStatePulling:
[self.loading stopAnimating];
[self.s setOn:YES animated:YES];
self.label.text = @"赶紧放开我吧(开关是打酱油滴)";
break;
case MJRefreshStateRefreshing:
[self.s setOn:YES animated:YES];
self.label.text = @"加载数据中(开关是打酱油滴)";
[self.loading startAnimating];
break;
default:
break;
}
}
#pragma mark 监听拖拽比例(控件被拖出来的比例)
- (void)setPullingPercent:(CGFloat)pullingPercent
{
[super setPullingPercent:pullingPercent];
// 1.0 0.5 0.0
// 0.5 0.0 0.5
CGFloat red = 1.0 - pullingPercent * 0.5;
CGFloat green = 0.5 - 0.5 * pullingPercent;
CGFloat blue = 0.5 * pullingPercent;
self.label.textColor = [UIColor colorWithRed:red green:green blue:blue alpha:1.0];
}
@end
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Classes/First/MJExample.h
================================================
// 代码地址: https://github.com/CoderMJLee/MJRefresh
// MJExample.h
// MJRefreshExample
//
// Created by MJ Lee on 15/3/5.
// Copyright (c) 2015年 小码哥. All rights reserved.
//
#import
@interface MJExample : NSObject
@property (copy, nonatomic) NSString *header;
@property (strong, nonatomic) NSArray *titles;
@property (strong, nonatomic) NSArray *methods;
@property (strong, nonatomic) NSArray *vcClasses;
@end
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Classes/First/MJExample.m
================================================
// 代码地址: https://github.com/CoderMJLee/MJRefresh
// MJExample.m
// MJRefreshExample
//
// Created by MJ Lee on 15/3/5.
// Copyright (c) 2015年 小码哥. All rights reserved.
//
#import "MJExample.h"
@implementation MJExample
@end
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Classes/First/MJExampleViewController.h
================================================
// 代码地址: https://github.com/CoderMJLee/MJRefresh
// MJExampleViewController.h
// MJRefreshExample
//
// Created by MJ Lee on 15/3/5.
// Copyright (c) 2015年 小码哥. All rights reserved.
//
#import
@interface MJExampleViewController : UITableViewController
@end
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Classes/First/MJExampleViewController.m
================================================
// 代码地址: https://github.com/CoderMJLee/MJRefresh
// MJExampleViewController.m
// MJRefreshExample
//
// Created by MJ Lee on 15/3/5.
// Copyright (c) 2015年 小码哥. All rights reserved.
//
#import "MJExampleViewController.h"
#import "MJTableViewController.h"
#import "MJWebViewViewController.h"
#import "MJCollectionViewController.h"
#import "MJExample.h"
#import "UIViewController+Example.h"
#import "MJHorizontalCollectionViewController.h"
#import "MJRefreshExample-Swift.h"
@import MJRefresh;
static NSString *const MJExample00 = @"UITableView + 下拉刷新";
static NSString *const MJExample10 = @"UITableView + 上拉刷新";
static NSString *const MJExample20 = @"UICollectionView";
static NSString *const MJExample30 = @"UIWebView";
static NSString *const MJExample40 = @"WKWebView";
@interface MJExampleViewController()
@property (strong, nonatomic) NSArray *examples;
@end
@implementation MJExampleViewController
- (NSArray *)examples
{
if (!_examples) {
MJExample *exam0 = [[MJExample alloc] init];
exam0.header = MJExample00;
exam0.vcClasses = @[[MJTableViewController class]];
exam0.titles = @[@"默认", @"动画图片", @"隐藏时间", @"隐藏状态和时间", @"自定义文字", @"自定义刷新控件"];
exam0.methods = @[@"example01", @"example02", @"example03", @"example04", @"example05", @"example06"];
MJExample *exam1 = [[MJExample alloc] init];
exam1.header = MJExample10;
exam1.vcClasses = @[[MJTableViewController class]];
exam1.titles = @[@"默认", @"动画图片", @"隐藏刷新状态的文字", @"全部加载完毕", @"禁止自动加载", @"自定义文字", @"加载后隐藏", @"自动回弹的上拉01", @"自动回弹的上拉02", @"自定义刷新控件(自动刷新)", @"自定义刷新控件(自动回弹)"];
exam1.methods = @[@"example11", @"example12", @"example13", @"example14", @"example15", @"example16", @"example17", @"example18", @"example19", @"example20", @"example21"];
MJExample *exam2 = [[MJExample alloc] init];
exam2.header = MJExample20;
exam2.vcClasses = @[MJCollectionViewController.class, MJPinHeaderCollectionViewController.class, MJHorizontalCollectionViewController.class];
exam2.titles = @[@"上下拉刷新", @"上下拉刷新-PinHeader", @"左拉刷新"];
exam2.methods = @[@"example31", @"example31", @"example42"];
MJExample *exam3 = [[MJExample alloc] init];
exam3.header = MJExample30;
exam3.vcClasses = @[[MJWebViewViewController class]];
exam3.titles = @[@"下拉刷新"];
exam3.methods = @[@"example40"];
MJExample *exam4 = [[MJExample alloc] init];
exam4.header = MJExample40;
exam4.vcClasses = @[[MJWKWebViewController class]];
exam4.titles = @[@"下拉刷新"];
exam4.methods = @[@"example41"];
self.examples = @[exam0, exam1, exam2, exam3, exam4];
}
return _examples;
}
- (void)viewDidLoad
{
[super viewDidLoad];
__unsafe_unretained UITableView *tableView = self.tableView;
// 下拉刷新
tableView.mj_header= [MJRefreshNormalHeader headerWithRefreshingBlock:^{
// 模拟延迟加载数据,因此2秒后才调用(真实开发中,可以移除这段gcd代码)
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
// 结束刷新
[tableView.mj_header endRefreshing];
});
}];
// 设置自动切换透明度(在导航栏下面自动隐藏)
tableView.mj_header.automaticallyChangeAlpha = YES;
// 上拉刷新
tableView.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{
// 模拟延迟加载数据,因此2秒后才调用(真实开发中,可以移除这段gcd代码)
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
// 结束刷新
[tableView.mj_footer endRefreshing];
});
}];
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return self.examples.count;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
MJExample *exam = self.examples[section];
return exam.titles.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *ID = @"example";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
MJExample *exam = self.examples[indexPath.section];
cell.textLabel.text = exam.titles[indexPath.row];
NSInteger classRow = indexPath.row;
if (classRow > exam.vcClasses.count - 1) {
classRow = exam.vcClasses.count - 1;
}
cell.detailTextLabel.text = [NSString stringWithFormat:@"%@ - %@", exam.vcClasses[classRow], exam.methods[indexPath.row]];
return cell;
}
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
{
MJExample *exam = self.examples[section];
return exam.header;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
MJExample *exam = self.examples[indexPath.section];
NSInteger classRow = indexPath.row;
if (classRow > exam.vcClasses.count - 1) {
classRow = exam.vcClasses.count - 1;
}
UIViewController *vc = [[exam.vcClasses[classRow] alloc] init];
vc.title = exam.titles[indexPath.row];
[vc setValue:exam.methods[indexPath.row] forKeyPath:@"method"];
[self.navigationController pushViewController:vc animated:YES];
}
@end
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Classes/First/MJExampleWindow.h
================================================
//
// MJExampleWindow.h
// MJRefreshExample
//
// Created by MJ Lee on 15/8/17.
// Copyright (c) 2015年 小码哥. All rights reserved.
//
#import
@interface MJExampleWindow : UIWindow
+ (void)show;
@end
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Classes/First/MJExampleWindow.m
================================================
//
// MJExampleWindow.m
// MJRefreshExample
//
// Created by MJ Lee on 15/8/17.
// Copyright (c) 2015年 小码哥. All rights reserved.
//
#import "MJExampleWindow.h"
#import "MJTempViewController.h"
@implementation MJExampleWindow
static UIWindow *window_;
+ (void)show
{
window_ = [[UIWindow alloc] init];
CGFloat width = 150;
CGFloat x = [UIScreen mainScreen].bounds.size.width - width - 10;
CGFloat y = 0;
if (@available(iOS 11.0, *)) {
UIEdgeInsets safeInsets = UIApplication.sharedApplication.windows.firstObject.safeAreaInsets;
y = safeInsets.top;
}
window_.frame = CGRectMake(x, y, width, 25);
window_.windowLevel = UIWindowLevelAlert;
window_.hidden = NO;
window_.alpha = 0.5;
window_.rootViewController = [[MJTempViewController alloc] init];
window_.backgroundColor = [UIColor clearColor];
}
@end
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Classes/First/MJSingleViewController.h
================================================
//
// MJSingleViewController.h
// MJRefreshExample
//
// Created by MJ Lee on 15/6/13.
// Copyright © 2015年 小码哥. All rights reserved.
//
#import
@interface MJSingleViewController : UITableViewController
@end
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Classes/First/MJSingleViewController.m
================================================
//
// MJSingleViewController.m
// MJRefreshExample
//
// Created by MJ Lee on 15/6/13.
// Copyright © 2015年 小码哥. All rights reserved.
//
#import "MJSingleViewController.h"
#import "MJTestViewController.h"
@import MJRefresh;
@interface MJSingleViewController ()
@property (assign, nonatomic) int count;
@end
@implementation MJSingleViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.count = 0;
__unsafe_unretained typeof(self) weakSelf = self;
__unsafe_unretained UITableView *tableView = self.tableView;
tableView.mj_header= [MJRefreshNormalHeader headerWithRefreshingBlock:^{
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
weakSelf.count += 12;
[tableView reloadData];
[tableView.mj_header endRefreshing];
});
}];
tableView.mj_header.automaticallyChangeAlpha = YES;
MJRefreshAutoNormalFooter *footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
weakSelf.count += 5;
[tableView reloadData];
[tableView.mj_footer endRefreshing];
});
}];
footer.hidden = YES;
tableView.mj_footer = footer;
}
- (NSInteger)tableView:(nonnull UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return self.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *ID = @"cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:ID];
}
if (indexPath.row % 2 && self.navigationController) {
cell.textLabel.text = @"push";
} else {
cell.textLabel.text = @"modal";
}
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
MJTestViewController *test = [[MJTestViewController alloc] init];
if (indexPath.row % 2 && self.navigationController) {
test.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:test animated:YES];
} else {
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:test];
[self presentViewController:nav animated:YES completion:nil];
}
}
@end
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Classes/First/MJTempViewController.h
================================================
//
// MJTempViewController.h
// MJRefreshExample
//
// Created by MJ Lee on 15/9/22.
// Copyright © 2015年 小码哥. All rights reserved.
//
#import
@interface MJTempViewController : UIViewController
+ (instancetype)sharedInstance;
@property (assign, nonatomic) UIStatusBarStyle statusBarStyle;
@property (assign, nonatomic) BOOL statusBarHidden;
@end
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Classes/First/MJTempViewController.m
================================================
//
// MJTempViewController.m
// MJRefreshExample
//
// Created by MJ Lee on 15/9/22.
// Copyright © 2015年 小码哥. All rights reserved.
//
#import "MJTempViewController.h"
@interface MJTempViewController ()
@end
@implementation MJTempViewController
#pragma mark - 单例
static id instance_;
+ (instancetype)sharedInstance
{
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
instance_ = [[self alloc] init];
});
return instance_;
}
+ (instancetype)allocWithZone:(struct _NSZone *)zone
{
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
instance_ = [super allocWithZone:zone];
});
return instance_;
}
#pragma mark - 初始化
- (void)viewDidLoad {
[super viewDidLoad];
self.statusBarStyle = UIStatusBarStyleLightContent;
self.view.backgroundColor = [UIColor clearColor];
UISegmentedControl *control = [[UISegmentedControl alloc] initWithItems:@[@"示例1", @"i18n", @"示例3"]];
control.tintColor = [UIColor orangeColor];
control.frame = self.view.bounds;
control.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
control.selectedSegmentIndex = 0;
[control addTarget:self action:@selector(contorlSelect:) forControlEvents:UIControlEventValueChanged];
[self.view addSubview:control];
}
- (void)contorlSelect:(UISegmentedControl *)control
{
UIWindow *keyWindow = [UIApplication sharedApplication].windows.firstObject;
keyWindow.rootViewController = [keyWindow.rootViewController.storyboard instantiateViewControllerWithIdentifier:[NSString stringWithFormat:@"%zd", control.selectedSegmentIndex]];
if (control.selectedSegmentIndex == 0) {
self.statusBarStyle = UIStatusBarStyleLightContent;
self.statusBarHidden = NO;
} else if (control.selectedSegmentIndex == 1) {
self.statusBarHidden = YES;
} else if (control.selectedSegmentIndex == 2) {
self.statusBarStyle = UIStatusBarStyleDefault;
self.statusBarHidden = NO;
}
}
- (UIStatusBarStyle)preferredStatusBarStyle
{
return self.statusBarStyle;
}
- (BOOL)prefersStatusBarHidden
{
return self.statusBarHidden;
}
- (void)setStatusBarHidden:(BOOL)statusBarHidden
{
_statusBarHidden = statusBarHidden;
[self setNeedsStatusBarAppearanceUpdate];
}
- (void)setStatusBarStyle:(UIStatusBarStyle)statusBarStyle
{
_statusBarStyle = statusBarStyle;
[self setNeedsStatusBarAppearanceUpdate];
}
@end
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Classes/Other/AppDelegate.h
================================================
// 代码地址: https://github.com/CoderMJLee/MJRefresh
// AppDelegate.h
// MJRefreshExample
//
// Created by MJ Lee on 15/3/4.
// Copyright (c) 2015年 小码哥. All rights reserved.
//
#import
@interface AppDelegate : UIResponder
@property (strong, nonatomic) UIWindow *window;
@end
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Classes/Other/AppDelegate.m
================================================
// 代码地址: https://github.com/CoderMJLee/MJRefresh
// AppDelegate.m
// MJRefreshExample
//
// Created by MJ Lee on 15/3/4.
// Copyright (c) 2015年 小码哥. All rights reserved.
//
#import "AppDelegate.h"
#import "MJExampleWindow.h"
@interface AppDelegate ()
@end
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[self setupNavigationBarAppearance];
return YES;
}
- (void)applicationDidBecomeActive:(UIApplication *)application {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
[MJExampleWindow show];
});
}
- (void)setupNavigationBarAppearance {
// 1.取出设置主题的对象
UINavigationBar *navBar = [UINavigationBar appearanceWhenContainedInInstancesOfClasses:@[UINavigationController.class]];
// 2.设置导航栏的背景图片
UIImage *backgroundImage = [UIImage imageNamed:@"NavBar64"];
NSDictionary *titleTextAttributes = @{NSForegroundColorAttributeName : [UIColor whiteColor]};
if (@available(iOS 13.0, *)) {
UINavigationBarAppearance *appearance = [UINavigationBarAppearance new];
appearance.backgroundImage = backgroundImage;
appearance.backgroundImageContentMode = UIViewContentModeScaleToFill;
appearance.titleTextAttributes = titleTextAttributes;
navBar.scrollEdgeAppearance = appearance;
navBar.standardAppearance = appearance;
} else {
[[UINavigationBar appearance] setBackgroundImage:backgroundImage forBarMetrics:UIBarMetricsDefault];
// 3.标题
[[UINavigationBar appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName : [UIColor whiteColor]}];
}
}
@end
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Classes/Second/MJCollectionViewController.h
================================================
// 代码地址: https://github.com/CoderMJLee/MJRefresh
// MJCollectionViewController.h
// MJRefreshExample
//
// Created by MJ Lee on 15/3/6.
// Copyright (c) 2015年 小码哥. All rights reserved.
//
#import
@interface MJCollectionViewController : UICollectionViewController
- (void)example31;
@end
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Classes/Second/MJCollectionViewController.m
================================================
// 代码地址: https://github.com/CoderMJLee/MJRefresh
// MJCollectionViewController.m
// MJRefreshExample
//
// Created by MJ Lee on 15/3/6.
// Copyright (c) 2015年 小码哥. All rights reserved.
//
#import "MJCollectionViewController.h"
#import "MJTestViewController.h"
#import "UIViewController+Example.h"
#import "MJChiBaoziHeader.h"
@import MJRefresh;
static const CGFloat MJDuration = 2.0;
/**
* 随机色
*/
#define MJRandomColor [UIColor colorWithRed:arc4random_uniform(255)/255.0 green:arc4random_uniform(255)/255.0 blue:arc4random_uniform(255)/255.0 alpha:1]
@interface MJCollectionViewController()
/** 存放假数据 */
@property (strong, nonatomic) NSMutableArray *colors;
@end
@implementation MJCollectionViewController
#pragma mark - 示例
#pragma mark UICollectionView 上下拉刷新
- (void)example31
{
__weak __typeof(self) weakSelf = self;
// 下拉刷新
[[MJRefreshNormalHeader headerWithRefreshingBlock:^{
// 增加5条假数据
for (int i = 0; i<10; i++) {
[weakSelf.colors insertObject:MJRandomColor atIndex:0];
}
// 模拟延迟加载数据,因此2秒后才调用(真实开发中,可以移除这段gcd代码)
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(MJDuration * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[weakSelf.collectionView reloadData];
// 结束刷新
[weakSelf.collectionView.mj_header endRefreshing];
});
}] linkTo:self.collectionView];
self.collectionView.mj_header.isCollectionViewAnimationBug = YES;
// 简单粗暴版本
// [self.collectionView.mj_header setAnimationDisabled];
// 上拉刷新
[[[[MJRefreshBackNormalFooter footerWithRefreshingBlock:^{
// 增加5条假数据
for (int i = 0; i<5; i++) {
[weakSelf.colors addObject:MJRandomColor];
}
// 模拟延迟加载数据,因此2秒后才调用(真实开发中,可以移除这段gcd代码)
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(MJDuration * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
// [weakSelf.collectionView reloadData];
// [weakSelf.collectionView.mj_footer endRefreshing];
[weakSelf.collectionView performBatchUpdates:^{
[weakSelf.collectionView reloadSections:[NSIndexSet indexSetWithIndex:0]];
} completion:^(BOOL finished) {
// 结束刷新
[weakSelf.collectionView.mj_footer endRefreshing];
}];
});
}] setAnimationDisabled]
autoChangeTransparency:YES]
linkTo:self.collectionView];
[self.collectionView.mj_header beginRefreshing];
}
#pragma mark - 数据相关
- (NSMutableArray *)colors
{
if (!_colors) {
self.colors = [NSMutableArray array];
}
return _colors;
}
#pragma mark - 其他
/**
* 初始化
*/
- (id)init
{
// UICollectionViewFlowLayout的初始化(与刷新控件无关)
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
layout.itemSize = CGSizeMake(80, 80);
layout.sectionInset = UIEdgeInsetsMake(20, 20, 20, 20);
layout.minimumInteritemSpacing = 20;
layout.minimumLineSpacing = 20;
layout.headerReferenceSize = CGSizeMake(100, 30);
return [self initWithCollectionViewLayout:layout];
}
static NSString *const MJCollectionViewCellIdentifier = @"color";
- (void)viewDidLoad
{
[super viewDidLoad];
MJPerformSelectorLeakWarning(
[self performSelector:NSSelectorFromString(self.method) withObject:nil];
);
[self.collectionView registerClass:[UICollectionViewCell class] forCellWithReuseIdentifier:MJCollectionViewCellIdentifier];
[self.collectionView registerClass:[UICollectionReusableView class] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"header"];
}
#pragma mark - collection数据源代理
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
{
// 设置尾部控件的显示和隐藏
self.collectionView.mj_footer.hidden = self.colors.count == 0;
return self.colors.count;
}
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:MJCollectionViewCellIdentifier forIndexPath:indexPath];
cell.backgroundColor = self.colors[indexPath.row];
return cell;
}
- (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath {
UICollectionReusableView *view = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"header" forIndexPath:indexPath];
view.backgroundColor = UIColor.systemPurpleColor;
return view;
}
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
{
MJTestViewController *test = [[MJTestViewController alloc] init];
if (indexPath.row % 2) {
[self.navigationController pushViewController:test animated:YES];
} else {
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:test];
[self presentViewController:nav animated:YES completion:nil];
}
}
@end
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Classes/Second/MJHorizontalCollectionViewController.h
================================================
//
// MJHorizontalCollectionViewController.h
// MJRefreshExample
//
// Created by libin14 on 2020/9/13.
// Copyright © 2020 小码哥. All rights reserved.
//
#import
NS_ASSUME_NONNULL_BEGIN
@interface MJHorizontalCollectionViewController : UICollectionViewController
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Classes/Second/MJHorizontalCollectionViewController.m
================================================
// 代码地址: https://github.com/CoderMJLee/MJRefresh
// MJHorizontalCollectionViewController.m
// MJRefreshExample
//
// Created by MJ Lee on 15/3/6.
// Copyright (c) 2015年 小码哥. All rights reserved.
//
#import "MJHorizontalCollectionViewController.h"
#import "MJTestViewController.h"
#import "UIViewController+Example.h"
@import MJRefresh;
/**
* 随机色
*/
#define MJRandomColor [UIColor colorWithRed:arc4random_uniform(255)/255.0 green:arc4random_uniform(255)/255.0 blue:arc4random_uniform(255)/255.0 alpha:1]
@interface MJHorizontalCollectionViewController()
/** 存放假数据 */
@property (strong, nonatomic) NSMutableArray *colors;
@end
@implementation MJHorizontalCollectionViewController
#pragma mark - 示例
#pragma mark UICollectionView 左拉刷新
- (void)example42 {
__weak __typeof(self) weakSelf = self;
// 左拉刷新
self.collectionView.mj_trailer = [MJRefreshNormalTrailer trailerWithRefreshingBlock:^{
MJTestViewController *test = [[MJTestViewController alloc] init];
[weakSelf.navigationController pushViewController:test animated:YES];
[weakSelf.collectionView.mj_trailer endRefreshing];
}];
}
#pragma mark - 数据相关
- (NSMutableArray *)colors {
if (!_colors) {
self.colors = [NSMutableArray array];
for (int i = 0; i < 5; i++) {
[self.colors addObject:MJRandomColor];
}
}
return _colors;
}
#pragma mark - 其他
/**
* 初始化
*/
- (instancetype)init {
// UICollectionViewFlowLayout的初始化(与刷新控件无关)
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
layout.itemSize = CGSizeMake(UIScreen.mainScreen.bounds.size.width, 200);
layout.minimumInteritemSpacing = 0;
layout.minimumLineSpacing = 0;
layout.scrollDirection = UICollectionViewScrollDirectionHorizontal;
return [self initWithCollectionViewLayout:layout];
}
static NSString *const MJCollectionViewCellIdentifier = @"color";
- (void)viewDidLoad {
[super viewDidLoad];
self.view.backgroundColor = [UIColor whiteColor];
self.collectionView.frame = CGRectMake(0, 150, UIScreen.mainScreen.bounds.size.width, 200);
self.collectionView.pagingEnabled = YES;
self.collectionView.backgroundColor = [UIColor whiteColor];
MJPerformSelectorLeakWarning([self performSelector:NSSelectorFromString(self.method) withObject:nil];);
[self.collectionView registerClass:[UICollectionViewCell class] forCellWithReuseIdentifier:MJCollectionViewCellIdentifier];
}
#pragma mark - collection数据源代理
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
return self.colors.count;
}
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:MJCollectionViewCellIdentifier forIndexPath:indexPath];
cell.backgroundColor = self.colors[indexPath.row];
return cell;
}
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
MJTestViewController *test = [[MJTestViewController alloc] init];
if (indexPath.row % 2) {
[self.navigationController pushViewController:test animated:YES];
} else {
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:test];
[self presentViewController:nav animated:YES completion:nil];
}
}
@end
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Classes/Second/MJPinHeaderCollectionViewController.swift
================================================
//
// MJPinHeaderCollectionViewController.swift
// MJRefreshExample
//
// Created by Frank on 2023/9/18.
// Copyright © 2023 小码哥. All rights reserved.
//
import UIKit
@objcMembers
class MJPinHeaderCollectionViewController: MJCollectionViewController {
convenience init() {
let pinHeaderLayout = PinHeaderFlowLayout()
pinHeaderLayout.itemSize = CGSizeMake(80, 80)
pinHeaderLayout.sectionInset = UIEdgeInsets(top: 20, left: 20, bottom: 20, right: 20)
pinHeaderLayout.minimumInteritemSpacing = 20
pinHeaderLayout.minimumLineSpacing = 20
pinHeaderLayout.headerReferenceSize = CGSize(width: 100, height: 30)
self.init(collectionViewLayout: pinHeaderLayout)
}
override func viewDidLoad() {
super.viewDidLoad()
}
}
@objcMembers
class PinHeaderFlowLayout: UICollectionViewFlowLayout {
override var flipsHorizontallyInOppositeLayoutDirection: Bool {
true
}
override func layoutAttributesForSupplementaryView(ofKind elementKind: String, at indexPath: IndexPath) -> UICollectionViewLayoutAttributes? {
let attributes = UICollectionViewLayoutAttributes(forSupplementaryViewOfKind: UICollectionView.elementKindSectionHeader, with: indexPath)
// TODO: Implementation of PinHeader
return attributes
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Classes/Second/MJTableViewController.h
================================================
// 代码地址: https://github.com/CoderMJLee/MJRefresh
// MJTableViewController.h
// MJRefreshExample
//
// Created by MJ Lee on 15/3/4.
// Copyright (c) 2015年 小码哥. All rights reserved.
//
#import
@interface MJTableViewController : UITableViewController
@end
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Classes/Second/MJTableViewController.m
================================================
// 代码地址: https://github.com/CoderMJLee/MJRefresh
// MJTableViewController.m
// MJRefreshExample
//
// Created by MJ Lee on 15/3/4.
// Copyright (c) 2015年 小码哥. All rights reserved.
//
#import "MJTableViewController.h"
#import "MJTestViewController.h"
#import "UIViewController+Example.h"
@import MJRefresh;
// 自定义的header
#import "MJChiBaoZiHeader.h"
#import "MJChiBaoZiFooter.h"
#import "MJChiBaoZiFooter2.h"
#import "MJDIYHeader.h"
#import "MJDIYAutoFooter.h"
#import "MJDIYBackFooter.h"
static const CGFloat MJDuration = 0.5;
/**
* 随机数据
*/
#define MJRandomData [NSString stringWithFormat:@"随机数据---%d", arc4random_uniform(1000000)]
@interface MJTableViewController()
/** 用来显示的假数据 */
@property (strong, nonatomic) NSMutableArray *data;
@end
@implementation MJTableViewController
#pragma mark - 示例代码
#pragma mark UITableView + 下拉刷新 默认
- (void)example01
{
__weak __typeof(self) weakSelf = self;
// 设置回调(一旦进入刷新状态就会调用这个refreshingBlock)
self.tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
[weakSelf loadNewData];
}];
// 马上进入刷新状态
[self.tableView.mj_header beginRefreshing];
}
#pragma mark UITableView + 下拉刷新 动画图片
- (void)example02
{
// 设置回调(一旦进入刷新状态,就调用target的action,也就是调用self的loadNewData方法)
self.tableView.mj_header = [MJChiBaoZiHeader headerWithRefreshingTarget:self refreshingAction:@selector(loadNewData)];
// 马上进入刷新状态
[self.tableView.mj_header beginRefreshing];
}
#pragma mark UITableView + 下拉刷新 隐藏时间
- (void)example03
{
// 设置回调(一旦进入刷新状态,就调用target的action,也就是调用self的loadNewData方法)
MJRefreshNormalHeader *header = [MJRefreshNormalHeader headerWithRefreshingTarget:self refreshingAction:@selector(loadNewData)];
// 设置自动切换透明度(在导航栏下面自动隐藏)
header.automaticallyChangeAlpha = YES;
// 隐藏时间
header.lastUpdatedTimeLabel.hidden = YES;
// 马上进入刷新状态
[header beginRefreshing];
// 设置header
self.tableView.mj_header = header;
}
#pragma mark UITableView + 下拉刷新 隐藏状态和时间
- (void)example04
{
// 设置回调(一旦进入刷新状态,就调用target的action,也就是调用self的loadNewData方法)
MJChiBaoZiHeader *header = [MJChiBaoZiHeader headerWithRefreshingTarget:self refreshingAction:@selector(loadNewData)];
// 隐藏时间
header.lastUpdatedTimeLabel.hidden = YES;
// 隐藏状态
header.stateLabel.hidden = YES;
// 马上进入刷新状态
[header beginRefreshing];
// 设置header
self.tableView.mj_header = header;
}
#pragma mark UITableView + 下拉刷新 自定义文字
- (void)example05
{
// 设置回调(一旦进入刷新状态,就调用target的action,也就是调用self的loadNewData方法)
MJRefreshNormalHeader *header = [MJRefreshNormalHeader headerWithRefreshingTarget:self refreshingAction:@selector(loadNewData)];
// 设置文字
[header setTitle:@"Pull down to refresh" forState:MJRefreshStateIdle];
[header setTitle:@"Release to refresh" forState:MJRefreshStatePulling];
[header setTitle:@"Loading ..." forState:MJRefreshStateRefreshing];
// 设置字体
header.stateLabel.font = [UIFont systemFontOfSize:15];
header.lastUpdatedTimeLabel.font = [UIFont systemFontOfSize:14];
// 设置颜色
header.stateLabel.textColor = [UIColor redColor];
header.lastUpdatedTimeLabel.textColor = [UIColor blueColor];
// 马上进入刷新状态
[header beginRefreshing];
// 设置刷新控件
self.tableView.mj_header = header;
}
#pragma mark UITableView + 下拉刷新 自定义刷新控件
- (void)example06
{
// 设置回调(一旦进入刷新状态,就调用target的action,也就是调用self的loadNewData方法)
self.tableView.mj_header = [MJDIYHeader headerWithRefreshingTarget:self refreshingAction:@selector(loadNewData)];
[self.tableView.mj_header beginRefreshing];
}
#pragma mark UITableView + 上拉刷新 默认
- (void)example11
{
[self example01];
__weak __typeof(self) weakSelf = self;
// 设置回调(一旦进入刷新状态就会调用这个refreshingBlock)
self.tableView.mj_footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{
[weakSelf loadMoreData];
}];
// ((MJRefreshAutoFooter *)self.tableView.mj_footer).onlyRefreshPerDrag = YES;
}
#pragma mark UITableView + 上拉刷新 动画图片
- (void)example12
{
[self example01];
// 设置回调(一旦进入刷新状态,就调用target的action,也就是调用self的loadMoreData方法)
self.tableView.mj_footer = [MJChiBaoZiFooter footerWithRefreshingTarget:self refreshingAction:@selector(loadMoreData)];
}
#pragma mark UITableView + 上拉刷新 隐藏刷新状态的文字
- (void)example13
{
[self example01];
// 设置回调(一旦进入刷新状态,就调用target的action,也就是调用self的loadMoreData方法)
MJChiBaoZiFooter *footer = [MJChiBaoZiFooter footerWithRefreshingTarget:self refreshingAction:@selector(loadMoreData)];
// 当上拉刷新控件出现50%时(出现一半),就会自动刷新。这个值默认是1.0(也就是上拉刷新100%出现时,才会自动刷新)
// footer.triggerAutomaticallyRefreshPercent = 0.5;
// 隐藏刷新状态的文字
footer.refreshingTitleHidden = YES;
// 设置footer
self.tableView.mj_footer = footer;
}
#pragma mark UITableView + 上拉刷新 全部加载完毕
- (void)example14
{
[self example01];
// 设置回调(一旦进入刷新状态,就调用target的action,也就是调用self的loadLastData方法)
self.tableView.mj_footer = [MJRefreshAutoNormalFooter footerWithRefreshingTarget:self refreshingAction:@selector(loadLastData)];
// 其他
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"恢复数据加载" style:UIBarButtonItemStyleDone target:self action:@selector(reset)];
}
- (void)reset
{
[self.tableView.mj_footer setRefreshingTarget:self refreshingAction:@selector(loadMoreData)];
[self.tableView.mj_footer resetNoMoreData];
}
#pragma mark UITableView + 上拉刷新 禁止自动加载
- (void)example15
{
[self example01];
// 设置回调(一旦进入刷新状态,就调用target的action,也就是调用self的loadMoreData方法)
MJRefreshAutoNormalFooter *footer = [MJRefreshAutoNormalFooter footerWithRefreshingTarget:self refreshingAction:@selector(loadMoreData)];
// 禁止自动加载
footer.automaticallyRefresh = NO;
// 设置footer
self.tableView.mj_footer = footer;
}
#pragma mark UITableView + 上拉刷新 自定义文字
- (void)example16
{
[self example01];
// 添加默认的上拉刷新
// 设置回调(一旦进入刷新状态,就调用target的action,也就是调用self的loadMoreData方法)
MJRefreshAutoNormalFooter *footer = [MJRefreshAutoNormalFooter footerWithRefreshingTarget:self refreshingAction:@selector(loadMoreData)];
// 设置文字
[footer setTitle:@"Click or drag up to refresh" forState:MJRefreshStateIdle];
[footer setTitle:@"Loading more ..." forState:MJRefreshStateRefreshing];
[footer setTitle:@"No more data" forState:MJRefreshStateNoMoreData];
// 设置字体
footer.stateLabel.font = [UIFont systemFontOfSize:17];
// 设置颜色
footer.stateLabel.textColor = [UIColor blueColor];
// 设置footer
self.tableView.mj_footer = footer;
}
#pragma mark UITableView + 上拉刷新 加载后隐藏
- (void)example17
{
[self example01];
// 设置回调(一旦进入刷新状态,就调用target的action,也就是调用self的loadOnceData方法)
self.tableView.mj_footer = [MJRefreshAutoNormalFooter footerWithRefreshingTarget:self refreshingAction:@selector(loadOnceData)];
}
#pragma mark UITableView + 上拉刷新 自动回弹的上拉01
- (void)example18
{
[self example01];
// 设置回调(一旦进入刷新状态,就调用target的action,也就是调用self的loadMoreData方法)
self.tableView.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingTarget:self refreshingAction:@selector(loadMoreData)];
// 设置了底部inset
self.tableView.contentInset = UIEdgeInsetsMake(0, 0, 30, 0);
// 忽略掉底部inset
self.tableView.mj_footer.ignoredScrollViewContentInsetBottom = 30;
}
#pragma mark UITableView + 上拉刷新 自动回弹的上拉02
- (void)example19
{
[self example01];
// 设置回调(一旦进入刷新状态,就调用target的action,也就是调用self的loadLastData方法)
self.tableView.mj_footer = [MJChiBaoZiFooter2 footerWithRefreshingTarget:self refreshingAction:@selector(loadLastData)];
self.tableView.mj_footer.automaticallyChangeAlpha = YES;
}
#pragma mark UITableView + 上拉刷新 自定义刷新控件(自动刷新)
- (void)example20
{
[self example01];
// 设置回调(一旦进入刷新状态,就调用target的action,也就是调用self的loadMoreData方法)
MJDIYAutoFooter *footer = [MJDIYAutoFooter footerWithRefreshingTarget:self refreshingAction:@selector(loadMoreData)];
footer.autoTriggerTimes = 2;
self.tableView.mj_footer = footer;
}
#pragma mark UITableView + 上拉刷新 自定义刷新控件(自动回弹)
- (void)example21
{
[self example01];
// 设置回调(一旦进入刷新状态,就调用target的action,也就是调用self的loadMoreData方法)
self.tableView.mj_footer = [MJDIYBackFooter footerWithRefreshingTarget:self refreshingAction:@selector(loadMoreData)];
}
#pragma mark - 数据处理相关
#pragma mark 下拉刷新数据
- (void)loadNewData
{
// 1.添加假数据
for (int i = 0; i<5; i++) {
[self.data insertObject:MJRandomData atIndex:0];
}
// 2.模拟2秒后刷新表格UI(真实开发中,可以移除这段gcd代码)
__weak UITableView *tableView = self.tableView;
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(MJDuration * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
// 刷新表格
[tableView reloadData];
// 拿到当前的下拉刷新控件,结束刷新状态
[tableView.mj_header endRefreshing];
});
}
#pragma mark 上拉加载更多数据
- (void)loadMoreData
{
// 1.添加假数据
for (int i = 0; i<1; i++) {
[self.data addObject:MJRandomData];
}
// 2.模拟2秒后刷新表格UI(真实开发中,可以移除这段gcd代码)
__weak UITableView *tableView = self.tableView;
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(MJDuration * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
// 刷新表格
[tableView reloadData];
// 拿到当前的上拉刷新控件,结束刷新状态
[tableView.mj_footer endRefreshing];
});
}
#pragma mark 加载最后一份数据
- (void)loadLastData
{
// 1.添加假数据
for (int i = 0; i<5; i++) {
[self.data addObject:MJRandomData];
}
// 2.模拟2秒后刷新表格UI(真实开发中,可以移除这段gcd代码)
__weak UITableView *tableView = self.tableView;
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(MJDuration * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
// 刷新表格
[tableView reloadData];
// 拿到当前的上拉刷新控件,变为没有更多数据的状态
[tableView.mj_footer endRefreshingWithNoMoreData];
});
}
#pragma mark 只加载一次数据
- (void)loadOnceData
{
// 1.添加假数据
for (int i = 0; i<5; i++) {
[self.data addObject:MJRandomData];
}
// 2.模拟2秒后刷新表格UI(真实开发中,可以移除这段gcd代码)
__weak UITableView *tableView = self.tableView;
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(MJDuration * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
// 刷新表格
[tableView reloadData];
// 隐藏当前的上拉刷新控件
tableView.mj_footer.hidden = YES;
});
}
- (NSMutableArray *)data
{
if (!_data) {
self.data = [NSMutableArray array];
for (int i = 0; i<5; i++) {
[self.data addObject:MJRandomData];
}
}
return _data;
}
#pragma mark - 其他
- (void)viewDidLoad
{
[super viewDidLoad];
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
[self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"cell"];
MJPerformSelectorLeakWarning(
[self performSelector:NSSelectorFromString(self.method) withObject:nil];
);
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return self.data.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *ID = @"cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:ID];
}
cell.textLabel.text = [NSString stringWithFormat:@"%@ - %@", indexPath.row % 2?@"push":@"modal", self.data[indexPath.row]];
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
MJTestViewController *test = [[MJTestViewController alloc] init];
if (indexPath.row % 2) {
[self.navigationController pushViewController:test animated:YES];
} else {
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:test];
[self presentViewController:nav animated:YES completion:nil];
}
}
@end
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Classes/Second/MJTestViewController.h
================================================
// 代码地址: https://github.com/CoderMJLee/MJRefresh
// MJTestViewController.h
// MJRefreshExample
//
// Created by MJ Lee on 14-5-28.
// Copyright (c) 2014年 小码哥. All rights reserved.
//
#import
#define MJPerformSelectorLeakWarning(Stuff) \
do { \
_Pragma("clang diagnostic push") \
_Pragma("clang diagnostic ignored \"-Warc-performSelector-leaks\"") \
Stuff; \
_Pragma("clang diagnostic pop") \
} while (0)
@interface MJTestViewController : UIViewController
@end
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Classes/Second/MJTestViewController.m
================================================
// 代码地址: https://github.com/CoderMJLee/MJRefresh
// MJTestViewController.m
// MJRefreshExample
//
// Created by MJ Lee on 14-5-28.
// Copyright (c) 2014年 小码哥. All rights reserved.
//
#import "MJTestViewController.h"
@interface MJTestViewController ()
@end
@implementation MJTestViewController
- (void)viewDidLoad
{
[super viewDidLoad];
self.title = @"测试控制器";
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"关闭" style:UIBarButtonItemStyleDone target:self action:@selector(close)];
}
- (void)close
{
if (self.presentingViewController) {
[self dismissViewControllerAnimated:YES completion:nil];
} else {
[self.navigationController popViewControllerAnimated:YES];
}
}
@end
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Classes/Second/MJTestViewController.xib
================================================
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Classes/Second/MJWebViewViewController.h
================================================
//
// MJWebViewViewController.h
// MJRefreshExample
//
// Created by MJ Lee on 15/3/12.
// Copyright (c) 2015年 小码哥. All rights reserved.
//
#import
@interface MJWebViewViewController : UIViewController
@end
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Classes/Second/MJWebViewViewController.m
================================================
//
// MJWebViewViewController.m
// MJRefreshExample
//
// Created by MJ Lee on 15/3/12.
// Copyright (c) 2015年 小码哥. All rights reserved.
//
#import "MJWebViewViewController.h"
#import "UIViewController+Example.h"
#import "MJChiBaoZiHeader.h"
@import MJRefresh;
@interface MJWebViewViewController ()
@property (weak, nonatomic) IBOutlet UIWebView *webView;
@end
@implementation MJWebViewViewController
#pragma mark - 示例
- (void)example40
{
__weak UIWebView *webView = self.webView;
webView.delegate = self;
__weak UIScrollView *scrollView = self.webView.scrollView;
// 添加下拉刷新控件
[[[MJChiBaoZiHeader headerWithRefreshingBlock:^{
[webView reload];
}]
linkTo:scrollView]
autoChangeTransparency:YES];
// 如果是上拉刷新,就以此类推
[scrollView.mj_header beginRefreshing];
}
#pragma mark - webViewDelegate
- (void)webViewDidFinishLoad:(nonnull UIWebView *)webView
{
[self.webView.scrollView.mj_header endRefreshing];
}
#pragma mark - 其他
- (void)viewDidLoad {
[super viewDidLoad];
// 加载页面
[self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://weibo.com/exceptions"]]];
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
[self performSelector:NSSelectorFromString(self.method) withObject:nil];
#pragma clang diagnostic pop
}
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
[self.navigationController setNavigationBarHidden:YES animated:YES];
[self setNeedsStatusBarAppearanceUpdate];
}
- (void)viewWillDisappear:(BOOL)animated
{
[super viewWillDisappear:animated];
[self.navigationController setNavigationBarHidden:NO animated:YES];
}
- (BOOL)prefersStatusBarHidden
{
return YES;
}
- (IBAction)back {
[self.navigationController popViewControllerAnimated:YES];
}
@end
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Classes/Second/MJWebViewViewController.xib
================================================
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Classes/SwiftExample/MJWKWebViewController.swift
================================================
//
// MJWKWebViewController.swift
// MJRefreshExample
//
// Created by Frank on 2021/3/3.
// Copyright © 2021 小码哥. All rights reserved.
//
import UIKit
import WebKit
// 在实际的工程中, 使用以下 Import module 即可
//import MJRefresh
@objc
class MJWKWebViewController: UIViewController {
var webView: WKWebView!
func example41() {
MJChiBaoZiHeader { [weak self] in
self?.webView.reload()
}.autoChangeTransparency(true)
.link(to: webView.scrollView)
webView.scrollView.mj_header?.beginRefreshing()
}
}
// MARK: 🌈 无关例子的样式构建方法
extension MJWKWebViewController {
override func viewDidLoad() {
super.viewDidLoad()
constructViews()
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
navigationController?.setNavigationBarHidden(true, animated: true)
setNeedsStatusBarAppearanceUpdate()
}
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
navigationController?.setNavigationBarHidden(false, animated: true)
}
override var prefersStatusBarHidden: Bool {
true
}
private func constructViews() {
webView = WKWebView(frame: view.frame)
webView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
view.addSubview(webView)
webView.navigationDelegate = self
let size = view.frame.size
let warningLabel = UILabel(frame: CGRect(x: size.width - 210, y: size.height - 160, width: 200, height: 50))
warningLabel.text = "注意,这不是原生界面,是个网页:http://weibo.com/excepptions"
warningLabel.adjustsFontSizeToFitWidth = true
warningLabel.textColor = .black
warningLabel.backgroundColor = UIColor.lightGray.withAlphaComponent(0.3)
warningLabel.numberOfLines = 0
let mask: UIView.AutoresizingMask = [.flexibleRightMargin, .flexibleBottomMargin]
warningLabel.autoresizingMask = mask
webView.addSubview(warningLabel)
let backButton = UIButton(frame: CGRect(x: size.width - 210, y: size.height - 100, width: 200, height: 50))
backButton.setTitle("回到上一页", for: .normal)
backButton.backgroundColor = .red
backButton.autoresizingMask = mask
backButton.addTarget(self, action: #selector(back), for: .touchUpInside)
webView.addSubview(backButton)
webView.load(URLRequest(url: URL(string: "http://weibo.com/exceptions")!))
example41()
}
@objc
func back() {
navigationController?.popViewController(animated: true)
}
}
extension MJWKWebViewController: WKNavigationDelegate {
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
webView.scrollView.mj_header?.endRefreshing()
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Classes/i18n/I18NExampleViewController.swift
================================================
//
// I18NExampleViewController.swift
// MJRefreshExample
//
// Created by Frank on 2021/7/5.
// Copyright © 2021 小码哥. All rights reserved.
//
import UIKit
class I18NExampleViewController: UITableViewController {
var languages = [
"zh-Hans", "zh-Hant", "en", "ru", "ko", "uk"
]
var customBundles = [
"zh-Hans", "zh-Hant", "en", "ru", "ko", "uk"
]
override func viewDidLoad() {
super.viewDidLoad()
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "Cell")
MJRefreshNormalHeader {
DispatchQueue.main.asyncAfter(deadline: .now() + 2) { [weak self] in
guard let self = self else { return }
self.tableView.mj_header?.endRefreshing()
}
}.autoChangeTransparency(true).link(to: tableView)
MJRefreshAutoNormalFooter {
DispatchQueue.main.asyncAfter(deadline: .now() + 2) { [weak self] in
guard let self = self else { return }
self.tableView.mj_footer?.endRefreshing()
}
}.link(to: tableView)
}
override func numberOfSections(in tableView: UITableView) -> Int {
return 3
}
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return languages.count
}
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "Cell")!
cell.textLabel?.text = languages[indexPath.row]
return cell
}
override func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
switch section {
case 0:
return "MJRefresh 系统包或 MainBundle 中默认语言包"
case 1:
return "🍬自定义语言包文件(MJRefresh_i18n.strings)"
case 2:
return "♿️自定义语言包 bundle(CustomLanguages.bundle)"
default:
return nil
}
}
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
switch indexPath.section {
case 1:
MJRefreshConfig.default.i18nFilename = "MJRefresh_i18n"
MJRefreshConfig.default.languageCode = nil
MJRefreshConfig.default.i18nBundle = nil
case 2:
MJRefreshConfig.default.i18nFilename = nil
MJRefreshConfig.default.languageCode = nil
MJRefreshConfig.default.i18nBundle = Bundle(path: Bundle.main.path(forResource: "CustomLanguages", ofType: "bundle")!)
default:
MJRefreshConfig.default.i18nFilename = nil
MJRefreshConfig.default.languageCode = nil
MJRefreshConfig.default.i18nBundle = nil
}
MJRefreshConfig.default.languageCode = languages[indexPath.row]
let alertC = UIAlertController(title: "⚠️", message: "language changed to '\(languages[indexPath.row])'", preferredStyle: .alert)
alertC.addAction(UIAlertAction(title: "🎉", style: .destructive))
present(alertC, animated: true)
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/AppIcon.appiconset/Contents.json
================================================
{
"images" : [
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "ipad-20x20@2x.png",
"scale" : "2x"
},
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "iphone-20x20@3x.png",
"scale" : "3x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "ipad-29x29.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "ipad-29x29@2x.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "iphone-29x29@3x.png",
"scale" : "3x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "ipad-40x40@2x.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "iphone-40x40@3x.png",
"scale" : "3x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "iphone-60x60@2x.png",
"scale" : "2x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "iphone-60x60@3x.png",
"scale" : "3x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "ipad-20x20.png",
"scale" : "1x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "iphone-20x20@2x.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "ipad-29x29-1.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "iphone-29x29@2x.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "ipad-40x40.png",
"scale" : "1x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "iphone-40x40@2x.png",
"scale" : "2x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "ipad-76x76.png",
"scale" : "1x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "ipad-76x76@2x.png",
"scale" : "2x"
},
{
"size" : "83.5x83.5",
"idiom" : "ipad",
"filename" : "ipad-83.5x83.5@2x.png",
"scale" : "2x"
},
{
"size" : "1024x1024",
"idiom" : "ios-marketing",
"filename" : "ios-marketing-1024x1024.png",
"scale" : "1x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/Contents.json
================================================
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/DianPing/dropdown_anim__0001.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "dropdown_anim__0001@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/DianPing/dropdown_anim__00010.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "dropdown_anim__00010@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/DianPing/dropdown_anim__00011.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "dropdown_anim__00011@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/DianPing/dropdown_anim__00012.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "dropdown_anim__00012@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/DianPing/dropdown_anim__00013.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "dropdown_anim__00013@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/DianPing/dropdown_anim__00014.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "dropdown_anim__00014@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/DianPing/dropdown_anim__00015.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "dropdown_anim__00015@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/DianPing/dropdown_anim__00016.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "dropdown_anim__00016@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/DianPing/dropdown_anim__00017.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "dropdown_anim__00017@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/DianPing/dropdown_anim__00018.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "dropdown_anim__00018@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/DianPing/dropdown_anim__00019.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "dropdown_anim__00019@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/DianPing/dropdown_anim__0002.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "dropdown_anim__0002@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/DianPing/dropdown_anim__00020.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "dropdown_anim__00020@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/DianPing/dropdown_anim__00021.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "dropdown_anim__00021@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/DianPing/dropdown_anim__00022.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "dropdown_anim__00022@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/DianPing/dropdown_anim__00023.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "dropdown_anim__00023@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/DianPing/dropdown_anim__00024.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "dropdown_anim__00024@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/DianPing/dropdown_anim__00025.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "dropdown_anim__00025@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/DianPing/dropdown_anim__00026.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "dropdown_anim__00026@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/DianPing/dropdown_anim__00027.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "dropdown_anim__00027@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/DianPing/dropdown_anim__00028.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "dropdown_anim__00028@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/DianPing/dropdown_anim__00029.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "dropdown_anim__00029@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/DianPing/dropdown_anim__0003.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "dropdown_anim__0003@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/DianPing/dropdown_anim__00030.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "dropdown_anim__00030@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/DianPing/dropdown_anim__00031.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "dropdown_anim__00031@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/DianPing/dropdown_anim__00032.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "dropdown_anim__00032@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/DianPing/dropdown_anim__00033.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "dropdown_anim__00033@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/DianPing/dropdown_anim__00034.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "dropdown_anim__00034@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/DianPing/dropdown_anim__00035.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "dropdown_anim__00035@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/DianPing/dropdown_anim__00036.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "dropdown_anim__00036@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/DianPing/dropdown_anim__00037.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "dropdown_anim__00037@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/DianPing/dropdown_anim__00038.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "dropdown_anim__00038@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/DianPing/dropdown_anim__00039.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "dropdown_anim__00039@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/DianPing/dropdown_anim__0004.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "dropdown_anim__0004@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/DianPing/dropdown_anim__00040.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "dropdown_anim__00040@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/DianPing/dropdown_anim__00041.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "dropdown_anim__00041@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/DianPing/dropdown_anim__00042.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "dropdown_anim__00042@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/DianPing/dropdown_anim__00043.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "dropdown_anim__00043@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/DianPing/dropdown_anim__00044.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "dropdown_anim__00044@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/DianPing/dropdown_anim__00045.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "dropdown_anim__00045@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/DianPing/dropdown_anim__00046.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "dropdown_anim__00046@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/DianPing/dropdown_anim__00047.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "dropdown_anim__00047@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/DianPing/dropdown_anim__00048.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "dropdown_anim__00048@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/DianPing/dropdown_anim__00049.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "dropdown_anim__00049@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/DianPing/dropdown_anim__0005.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "dropdown_anim__0005@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/DianPing/dropdown_anim__00050.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "dropdown_anim__00050@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/DianPing/dropdown_anim__00051.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "dropdown_anim__00051@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/DianPing/dropdown_anim__00052.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "dropdown_anim__00052@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/DianPing/dropdown_anim__00053.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "dropdown_anim__00053@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/DianPing/dropdown_anim__00054.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "dropdown_anim__00054@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/DianPing/dropdown_anim__00055.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "dropdown_anim__00055@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/DianPing/dropdown_anim__00056.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "dropdown_anim__00056@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/DianPing/dropdown_anim__00057.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "dropdown_anim__00057@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/DianPing/dropdown_anim__00058.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "dropdown_anim__00058@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/DianPing/dropdown_anim__00059.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "dropdown_anim__00059@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/DianPing/dropdown_anim__0006.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "dropdown_anim__0006@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/DianPing/dropdown_anim__00060.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "dropdown_anim__00060@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/DianPing/dropdown_anim__0007.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "dropdown_anim__0007@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/DianPing/dropdown_anim__0008.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "dropdown_anim__0008@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/DianPing/dropdown_anim__0009.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "dropdown_anim__0009@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/DianPing/dropdown_loading_01.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "dropdown_loading_01@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/DianPing/dropdown_loading_02.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "dropdown_loading_02@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/DianPing/dropdown_loading_03.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "dropdown_loading_03@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/MJRefresh.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"filename" : "MJRefresh.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/NavBar.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "NavBar@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/NavBar64.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "NavBar64@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Images.xcassets/logo.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"filename" : "logo.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "logo@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/Info.plist
================================================
CFBundleDevelopmentRegion
en
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
MJRefresh
CFBundlePackageType
APPL
CFBundleShortVersionString
1.0
CFBundleSignature
????
CFBundleVersion
1
LSRequiresIPhoneOS
NSAppTransportSecurity
NSAllowsArbitraryLoads
UILaunchStoryboardName
LaunchScreen
UIMainStoryboardFile
Main
UIRequiredDeviceCapabilities
armv7
UISupportedInterfaceOrientations
UIInterfaceOrientationPortrait
UIInterfaceOrientationLandscapeLeft
UIInterfaceOrientationLandscapeRight
UISupportedInterfaceOrientations~ipad
UIInterfaceOrientationPortrait
UIInterfaceOrientationPortraitUpsideDown
UIInterfaceOrientationLandscapeLeft
UIInterfaceOrientationLandscapeRight
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/MJRefreshExample-Bridging-Header.h
================================================
//
// Use this file to import your target's public headers that you would like to expose to Swift.
//
#import "MJChiBaoZiHeader.h"
#import "MJCollectionViewController.h"
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/PrefixHeader.pch
================================================
//
// PrefixHeader.pch
// MJRefreshExample
//
// Created by MJ Lee on 15/9/22.
// Copyright © 2015年 小码哥. All rights reserved.
//
#ifndef PrefixHeader_pch
#define PrefixHeader_pch
#import "MJTempViewController.h"
#endif /* PrefixHeader_pch */
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample/main.m
================================================
//
// main.m
// MJRefreshExample
//
// Created by MJ Lee on 15/3/4.
// Copyright (c) 2015年 小码哥. All rights reserved.
//
#import
#import "AppDelegate.h"
int main(int argc, char * argv[]) {
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExample.xcodeproj/project.pbxproj
================================================
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objects = {
/* Begin PBXBuildFile section */
0133FBBF2693FA8E00E98F66 /* CustomLanguages.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 0133FBBE2693FA8E00E98F66 /* CustomLanguages.bundle */; };
013557022AB7F252001BB573 /* MJPinHeaderCollectionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 013557012AB7F252001BB573 /* MJPinHeaderCollectionViewController.swift */; };
018C0838274787B6002D968E /* MJRefresh.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 018C083427478732002D968E /* MJRefresh.framework */; };
018C0839274787B6002D968E /* MJRefresh.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 018C083427478732002D968E /* MJRefresh.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
0193FF132692E99500B52B11 /* I18NExampleViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0193FF122692E99500B52B11 /* I18NExampleViewController.swift */; };
0193FF162692F8EB00B52B11 /* MJRefresh_i18n.strings in Resources */ = {isa = PBXBuildFile; fileRef = 0193FF182692F8EB00B52B11 /* MJRefresh_i18n.strings */; };
01A5EB2B25EF62B80091554E /* MJWKWebViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01A5EB2A25EF62B80091554E /* MJWKWebViewController.swift */; };
2D9BEB091BB15F4A00AED473 /* UIViewController+Example.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D9BEAE01BB15F4A00AED473 /* UIViewController+Example.m */; };
2D9BEB0A1BB15F4A00AED473 /* MJChiBaoZiFooter.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D9BEAE31BB15F4A00AED473 /* MJChiBaoZiFooter.m */; };
2D9BEB0B1BB15F4A00AED473 /* MJChiBaoZiFooter2.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D9BEAE51BB15F4A00AED473 /* MJChiBaoZiFooter2.m */; };
2D9BEB0C1BB15F4A00AED473 /* MJChiBaoZiHeader.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D9BEAE71BB15F4A00AED473 /* MJChiBaoZiHeader.m */; };
2D9BEB0D1BB15F4A00AED473 /* MJDIYAutoFooter.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D9BEAE91BB15F4A00AED473 /* MJDIYAutoFooter.m */; };
2D9BEB0E1BB15F4A00AED473 /* MJDIYBackFooter.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D9BEAEB1BB15F4A00AED473 /* MJDIYBackFooter.m */; };
2D9BEB0F1BB15F4A00AED473 /* MJDIYHeader.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D9BEAED1BB15F4A00AED473 /* MJDIYHeader.m */; };
2D9BEB101BB15F4A00AED473 /* MJExample.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D9BEAF01BB15F4A00AED473 /* MJExample.m */; };
2D9BEB111BB15F4A00AED473 /* MJExampleViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D9BEAF21BB15F4A00AED473 /* MJExampleViewController.m */; };
2D9BEB121BB15F4A00AED473 /* MJExampleWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D9BEAF41BB15F4A00AED473 /* MJExampleWindow.m */; };
2D9BEB141BB15F4A00AED473 /* MJSingleViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D9BEAF81BB15F4A00AED473 /* MJSingleViewController.m */; };
2D9BEB151BB15F4A00AED473 /* MJTempViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D9BEAFA1BB15F4A00AED473 /* MJTempViewController.m */; };
2D9BEB161BB15F4A00AED473 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D9BEAFD1BB15F4A00AED473 /* AppDelegate.m */; };
2D9BEB171BB15F4A00AED473 /* MJCollectionViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D9BEB001BB15F4A00AED473 /* MJCollectionViewController.m */; };
2D9BEB181BB15F4A00AED473 /* MJTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D9BEB021BB15F4A00AED473 /* MJTableViewController.m */; };
2D9BEB191BB15F4A00AED473 /* MJTestViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D9BEB041BB15F4A00AED473 /* MJTestViewController.m */; };
2D9BEB1A1BB15F4A00AED473 /* MJTestViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2D9BEB051BB15F4A00AED473 /* MJTestViewController.xib */; };
2D9BEB1B1BB15F4A00AED473 /* MJWebViewViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D9BEB071BB15F4A00AED473 /* MJWebViewViewController.m */; };
2D9BEB1C1BB15F4A00AED473 /* MJWebViewViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2D9BEB081BB15F4A00AED473 /* MJWebViewViewController.xib */; };
2DA7F92B1AA6B4C4005627AB /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DA7F92A1AA6B4C4005627AB /* main.m */; };
2DA7F9341AA6B4C4005627AB /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2DA7F9321AA6B4C4005627AB /* Main.storyboard */; };
2DA7F9361AA6B4C4005627AB /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2DA7F9351AA6B4C4005627AB /* Images.xcassets */; };
2DA7F9391AA6B4C4005627AB /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2DA7F9371AA6B4C4005627AB /* LaunchScreen.xib */; };
2DA7F9451AA6B4C4005627AB /* MJRefreshExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DA7F9441AA6B4C4005627AB /* MJRefreshExampleTests.m */; };
6B8FB1A9250E610D00AF64B7 /* MJHorizontalCollectionViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B8FB1A8250E610D00AF64B7 /* MJHorizontalCollectionViewController.m */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
018C083327478732002D968E /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 018C082F27478732002D968E /* MJRefresh.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 2D9DF4521F7CE29B0042D6DD;
remoteInfo = MJRefresh;
};
2DA7F93F1AA6B4C4005627AB /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 2DA7F91D1AA6B4C4005627AB /* Project object */;
proxyType = 1;
remoteGlobalIDString = 2DA7F9241AA6B4C4005627AB;
remoteInfo = MJRefreshExample;
};
/* End PBXContainerItemProxy section */
/* Begin PBXCopyFilesBuildPhase section */
2D9DF3EC1F7CD8F50042D6DD /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
018C0839274787B6002D968E /* MJRefresh.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
012CECBB2CF80CF8002C71E3 /* ar */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ar; path = ar.lproj/MJRefresh_i18n.strings; sourceTree = ""; };
0133FBB82693F7E200E98F66 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/MJRefresh_i18n.strings"; sourceTree = ""; };
0133FBB92693F7EA00E98F66 /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/MJRefresh_i18n.strings"; sourceTree = ""; };
0133FBBB2693F80400E98F66 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/MJRefresh_i18n.strings; sourceTree = ""; };
0133FBBC2693F81700E98F66 /* uk */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = uk; path = uk.lproj/MJRefresh_i18n.strings; sourceTree = ""; };
0133FBBD2693F81F00E98F66 /* ko */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ko; path = ko.lproj/MJRefresh_i18n.strings; sourceTree = ""; };
0133FBBE2693FA8E00E98F66 /* CustomLanguages.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = CustomLanguages.bundle; sourceTree = ""; };
013557012AB7F252001BB573 /* MJPinHeaderCollectionViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MJPinHeaderCollectionViewController.swift; sourceTree = ""; };
018C082F27478732002D968E /* MJRefresh.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = MJRefresh.xcodeproj; path = ../../MJRefresh.xcodeproj; sourceTree = ""; };
0193FF122692E99500B52B11 /* I18NExampleViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = I18NExampleViewController.swift; sourceTree = ""; };
0193FF172692F8EB00B52B11 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/MJRefresh_i18n.strings; sourceTree = ""; };
01A5EB2925EF62B80091554E /* MJRefreshExample-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "MJRefreshExample-Bridging-Header.h"; sourceTree = ""; };
01A5EB2A25EF62B80091554E /* MJWKWebViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MJWKWebViewController.swift; sourceTree = ""; };
2D9BEADF1BB15F4A00AED473 /* UIViewController+Example.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIViewController+Example.h"; sourceTree = ""; };
2D9BEAE01BB15F4A00AED473 /* UIViewController+Example.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIViewController+Example.m"; sourceTree = ""; };
2D9BEAE21BB15F4A00AED473 /* MJChiBaoZiFooter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MJChiBaoZiFooter.h; sourceTree = ""; };
2D9BEAE31BB15F4A00AED473 /* MJChiBaoZiFooter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MJChiBaoZiFooter.m; sourceTree = ""; };
2D9BEAE41BB15F4A00AED473 /* MJChiBaoZiFooter2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MJChiBaoZiFooter2.h; sourceTree = ""; };
2D9BEAE51BB15F4A00AED473 /* MJChiBaoZiFooter2.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MJChiBaoZiFooter2.m; sourceTree = ""; };
2D9BEAE61BB15F4A00AED473 /* MJChiBaoZiHeader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MJChiBaoZiHeader.h; sourceTree = ""; };
2D9BEAE71BB15F4A00AED473 /* MJChiBaoZiHeader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MJChiBaoZiHeader.m; sourceTree = ""; };
2D9BEAE81BB15F4A00AED473 /* MJDIYAutoFooter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MJDIYAutoFooter.h; sourceTree = ""; };
2D9BEAE91BB15F4A00AED473 /* MJDIYAutoFooter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MJDIYAutoFooter.m; sourceTree = ""; };
2D9BEAEA1BB15F4A00AED473 /* MJDIYBackFooter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MJDIYBackFooter.h; sourceTree = ""; };
2D9BEAEB1BB15F4A00AED473 /* MJDIYBackFooter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MJDIYBackFooter.m; sourceTree = ""; };
2D9BEAEC1BB15F4A00AED473 /* MJDIYHeader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MJDIYHeader.h; sourceTree = ""; };
2D9BEAED1BB15F4A00AED473 /* MJDIYHeader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MJDIYHeader.m; sourceTree = ""; };
2D9BEAEF1BB15F4A00AED473 /* MJExample.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MJExample.h; sourceTree = ""; };
2D9BEAF01BB15F4A00AED473 /* MJExample.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MJExample.m; sourceTree = ""; };
2D9BEAF11BB15F4A00AED473 /* MJExampleViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MJExampleViewController.h; sourceTree = ""; };
2D9BEAF21BB15F4A00AED473 /* MJExampleViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MJExampleViewController.m; sourceTree = ""; };
2D9BEAF31BB15F4A00AED473 /* MJExampleWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MJExampleWindow.h; sourceTree = ""; };
2D9BEAF41BB15F4A00AED473 /* MJExampleWindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MJExampleWindow.m; sourceTree = ""; };
2D9BEAF71BB15F4A00AED473 /* MJSingleViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MJSingleViewController.h; sourceTree = ""; };
2D9BEAF81BB15F4A00AED473 /* MJSingleViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MJSingleViewController.m; sourceTree = ""; };
2D9BEAF91BB15F4A00AED473 /* MJTempViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MJTempViewController.h; sourceTree = ""; };
2D9BEAFA1BB15F4A00AED473 /* MJTempViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MJTempViewController.m; sourceTree = ""; };
2D9BEAFC1BB15F4A00AED473 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; };
2D9BEAFD1BB15F4A00AED473 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; };
2D9BEAFF1BB15F4A00AED473 /* MJCollectionViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MJCollectionViewController.h; sourceTree = ""; };
2D9BEB001BB15F4A00AED473 /* MJCollectionViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MJCollectionViewController.m; sourceTree = ""; };
2D9BEB011BB15F4A00AED473 /* MJTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MJTableViewController.h; sourceTree = ""; };
2D9BEB021BB15F4A00AED473 /* MJTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MJTableViewController.m; sourceTree = ""; };
2D9BEB031BB15F4A00AED473 /* MJTestViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MJTestViewController.h; sourceTree = ""; };
2D9BEB041BB15F4A00AED473 /* MJTestViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MJTestViewController.m; sourceTree = ""; };
2D9BEB051BB15F4A00AED473 /* MJTestViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MJTestViewController.xib; sourceTree = ""; };
2D9BEB061BB15F4A00AED473 /* MJWebViewViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MJWebViewViewController.h; sourceTree = ""; };
2D9BEB071BB15F4A00AED473 /* MJWebViewViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MJWebViewViewController.m; sourceTree = ""; };
2D9BEB081BB15F4A00AED473 /* MJWebViewViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MJWebViewViewController.xib; sourceTree = ""; };
2DA7F9251AA6B4C4005627AB /* MJRefreshExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MJRefreshExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
2DA7F9291AA6B4C4005627AB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
2DA7F92A1AA6B4C4005627AB /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
2DA7F9331AA6B4C4005627AB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
2DA7F9351AA6B4C4005627AB /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; };
2DA7F9381AA6B4C4005627AB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; };
2DA7F93E1AA6B4C4005627AB /* MJRefreshExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MJRefreshExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
2DA7F9431AA6B4C4005627AB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
2DA7F9441AA6B4C4005627AB /* MJRefreshExampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MJRefreshExampleTests.m; sourceTree = ""; };
2DAA837B1BB1685300B62152 /* PrefixHeader.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PrefixHeader.pch; sourceTree = ""; };
6B8FB1A7250E610D00AF64B7 /* MJHorizontalCollectionViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MJHorizontalCollectionViewController.h; sourceTree = ""; };
6B8FB1A8250E610D00AF64B7 /* MJHorizontalCollectionViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MJHorizontalCollectionViewController.m; sourceTree = ""; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
2DA7F9221AA6B4C4005627AB /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
018C0838274787B6002D968E /* MJRefresh.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
2DA7F93B1AA6B4C4005627AB /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
018C083027478732002D968E /* Products */ = {
isa = PBXGroup;
children = (
018C083427478732002D968E /* MJRefresh.framework */,
);
name = Products;
sourceTree = "";
};
018C0836274787B6002D968E /* Frameworks */ = {
isa = PBXGroup;
children = (
);
name = Frameworks;
sourceTree = "";
};
0193FF112692E86200B52B11 /* i18n */ = {
isa = PBXGroup;
children = (
0193FF122692E99500B52B11 /* I18NExampleViewController.swift */,
0193FF182692F8EB00B52B11 /* MJRefresh_i18n.strings */,
0133FBBE2693FA8E00E98F66 /* CustomLanguages.bundle */,
);
path = i18n;
sourceTree = "";
};
01A5EB2825EF62930091554E /* SwiftExample */ = {
isa = PBXGroup;
children = (
01A5EB2A25EF62B80091554E /* MJWKWebViewController.swift */,
);
path = SwiftExample;
sourceTree = "";
};
2D9BEADE1BB15F4A00AED473 /* Category */ = {
isa = PBXGroup;
children = (
2D9BEADF1BB15F4A00AED473 /* UIViewController+Example.h */,
2D9BEAE01BB15F4A00AED473 /* UIViewController+Example.m */,
);
path = Category;
sourceTree = "";
};
2D9BEAE11BB15F4A00AED473 /* DIY */ = {
isa = PBXGroup;
children = (
2D9BEAE21BB15F4A00AED473 /* MJChiBaoZiFooter.h */,
2D9BEAE31BB15F4A00AED473 /* MJChiBaoZiFooter.m */,
2D9BEAE41BB15F4A00AED473 /* MJChiBaoZiFooter2.h */,
2D9BEAE51BB15F4A00AED473 /* MJChiBaoZiFooter2.m */,
2D9BEAE61BB15F4A00AED473 /* MJChiBaoZiHeader.h */,
2D9BEAE71BB15F4A00AED473 /* MJChiBaoZiHeader.m */,
2D9BEAE81BB15F4A00AED473 /* MJDIYAutoFooter.h */,
2D9BEAE91BB15F4A00AED473 /* MJDIYAutoFooter.m */,
2D9BEAEA1BB15F4A00AED473 /* MJDIYBackFooter.h */,
2D9BEAEB1BB15F4A00AED473 /* MJDIYBackFooter.m */,
2D9BEAEC1BB15F4A00AED473 /* MJDIYHeader.h */,
2D9BEAED1BB15F4A00AED473 /* MJDIYHeader.m */,
);
path = DIY;
sourceTree = "";
};
2D9BEAEE1BB15F4A00AED473 /* First */ = {
isa = PBXGroup;
children = (
2D9BEAEF1BB15F4A00AED473 /* MJExample.h */,
2D9BEAF01BB15F4A00AED473 /* MJExample.m */,
2D9BEAF11BB15F4A00AED473 /* MJExampleViewController.h */,
2D9BEAF21BB15F4A00AED473 /* MJExampleViewController.m */,
2D9BEAF31BB15F4A00AED473 /* MJExampleWindow.h */,
2D9BEAF41BB15F4A00AED473 /* MJExampleWindow.m */,
2D9BEAF71BB15F4A00AED473 /* MJSingleViewController.h */,
2D9BEAF81BB15F4A00AED473 /* MJSingleViewController.m */,
2D9BEAF91BB15F4A00AED473 /* MJTempViewController.h */,
2D9BEAFA1BB15F4A00AED473 /* MJTempViewController.m */,
);
path = First;
sourceTree = "";
};
2D9BEAFB1BB15F4A00AED473 /* Other */ = {
isa = PBXGroup;
children = (
2D9BEAFC1BB15F4A00AED473 /* AppDelegate.h */,
2D9BEAFD1BB15F4A00AED473 /* AppDelegate.m */,
);
path = Other;
sourceTree = "";
};
2D9BEAFE1BB15F4A00AED473 /* Second */ = {
isa = PBXGroup;
children = (
2D9BEAFF1BB15F4A00AED473 /* MJCollectionViewController.h */,
2D9BEB001BB15F4A00AED473 /* MJCollectionViewController.m */,
013557012AB7F252001BB573 /* MJPinHeaderCollectionViewController.swift */,
6B8FB1A7250E610D00AF64B7 /* MJHorizontalCollectionViewController.h */,
6B8FB1A8250E610D00AF64B7 /* MJHorizontalCollectionViewController.m */,
2D9BEB011BB15F4A00AED473 /* MJTableViewController.h */,
2D9BEB021BB15F4A00AED473 /* MJTableViewController.m */,
2D9BEB031BB15F4A00AED473 /* MJTestViewController.h */,
2D9BEB041BB15F4A00AED473 /* MJTestViewController.m */,
2D9BEB051BB15F4A00AED473 /* MJTestViewController.xib */,
2D9BEB061BB15F4A00AED473 /* MJWebViewViewController.h */,
2D9BEB071BB15F4A00AED473 /* MJWebViewViewController.m */,
2D9BEB081BB15F4A00AED473 /* MJWebViewViewController.xib */,
);
path = Second;
sourceTree = "";
};
2DA7F91C1AA6B4C4005627AB = {
isa = PBXGroup;
children = (
018C082F27478732002D968E /* MJRefresh.xcodeproj */,
2DA7F9271AA6B4C4005627AB /* MJRefreshExample */,
2DA7F9411AA6B4C4005627AB /* MJRefreshExampleTests */,
2DA7F9261AA6B4C4005627AB /* Products */,
018C0836274787B6002D968E /* Frameworks */,
);
sourceTree = "";
};
2DA7F9261AA6B4C4005627AB /* Products */ = {
isa = PBXGroup;
children = (
2DA7F9251AA6B4C4005627AB /* MJRefreshExample.app */,
2DA7F93E1AA6B4C4005627AB /* MJRefreshExampleTests.xctest */,
);
name = Products;
sourceTree = "";
};
2DA7F9271AA6B4C4005627AB /* MJRefreshExample */ = {
isa = PBXGroup;
children = (
2DA7F94E1AA6B51C005627AB /* Classes */,
01A5EB2925EF62B80091554E /* MJRefreshExample-Bridging-Header.h */,
2DA7F9281AA6B4C4005627AB /* Supporting Files */,
);
path = MJRefreshExample;
sourceTree = "";
};
2DA7F9281AA6B4C4005627AB /* Supporting Files */ = {
isa = PBXGroup;
children = (
2DA7F9321AA6B4C4005627AB /* Main.storyboard */,
2DA7F9351AA6B4C4005627AB /* Images.xcassets */,
2DA7F9371AA6B4C4005627AB /* LaunchScreen.xib */,
2DA7F9291AA6B4C4005627AB /* Info.plist */,
2DA7F92A1AA6B4C4005627AB /* main.m */,
2DAA837B1BB1685300B62152 /* PrefixHeader.pch */,
);
name = "Supporting Files";
sourceTree = "";
};
2DA7F9411AA6B4C4005627AB /* MJRefreshExampleTests */ = {
isa = PBXGroup;
children = (
2DA7F9441AA6B4C4005627AB /* MJRefreshExampleTests.m */,
2DA7F9421AA6B4C4005627AB /* Supporting Files */,
);
path = MJRefreshExampleTests;
sourceTree = "";
};
2DA7F9421AA6B4C4005627AB /* Supporting Files */ = {
isa = PBXGroup;
children = (
2DA7F9431AA6B4C4005627AB /* Info.plist */,
);
name = "Supporting Files";
sourceTree = "";
};
2DA7F94E1AA6B51C005627AB /* Classes */ = {
isa = PBXGroup;
children = (
2D9BEADE1BB15F4A00AED473 /* Category */,
2D9BEAFB1BB15F4A00AED473 /* Other */,
2D9BEAE11BB15F4A00AED473 /* DIY */,
2D9BEAEE1BB15F4A00AED473 /* First */,
2D9BEAFE1BB15F4A00AED473 /* Second */,
0193FF112692E86200B52B11 /* i18n */,
01A5EB2825EF62930091554E /* SwiftExample */,
);
path = Classes;
sourceTree = "";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
2DA7F9241AA6B4C4005627AB /* MJRefreshExample */ = {
isa = PBXNativeTarget;
buildConfigurationList = 2DA7F9481AA6B4C4005627AB /* Build configuration list for PBXNativeTarget "MJRefreshExample" */;
buildPhases = (
2DA7F9211AA6B4C4005627AB /* Sources */,
2DA7F9221AA6B4C4005627AB /* Frameworks */,
2DA7F9231AA6B4C4005627AB /* Resources */,
2D9DF3EC1F7CD8F50042D6DD /* Embed Frameworks */,
);
buildRules = (
);
dependencies = (
);
name = MJRefreshExample;
productName = MJRefreshExample;
productReference = 2DA7F9251AA6B4C4005627AB /* MJRefreshExample.app */;
productType = "com.apple.product-type.application";
};
2DA7F93D1AA6B4C4005627AB /* MJRefreshExampleTests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 2DA7F94B1AA6B4C4005627AB /* Build configuration list for PBXNativeTarget "MJRefreshExampleTests" */;
buildPhases = (
2DA7F93A1AA6B4C4005627AB /* Sources */,
2DA7F93B1AA6B4C4005627AB /* Frameworks */,
2DA7F93C1AA6B4C4005627AB /* Resources */,
);
buildRules = (
);
dependencies = (
2DA7F9401AA6B4C4005627AB /* PBXTargetDependency */,
);
name = MJRefreshExampleTests;
productName = MJRefreshExampleTests;
productReference = 2DA7F93E1AA6B4C4005627AB /* MJRefreshExampleTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
2DA7F91D1AA6B4C4005627AB /* Project object */ = {
isa = PBXProject;
attributes = {
CLASSPREFIX = MJ;
LastUpgradeCheck = 1220;
ORGANIZATIONNAME = "小码哥";
TargetAttributes = {
2DA7F9241AA6B4C4005627AB = {
CreatedOnToolsVersion = 6.1;
LastSwiftMigration = 1220;
};
2DA7F93D1AA6B4C4005627AB = {
CreatedOnToolsVersion = 6.1;
TestTargetID = 2DA7F9241AA6B4C4005627AB;
};
};
};
buildConfigurationList = 2DA7F9201AA6B4C4005627AB /* Build configuration list for PBXProject "MJRefreshExample" */;
compatibilityVersion = "Xcode 9.3";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
"zh-Hans",
"zh-Hant",
ru,
uk,
ko,
ar,
);
mainGroup = 2DA7F91C1AA6B4C4005627AB;
productRefGroup = 2DA7F9261AA6B4C4005627AB /* Products */;
projectDirPath = "";
projectReferences = (
{
ProductGroup = 018C083027478732002D968E /* Products */;
ProjectRef = 018C082F27478732002D968E /* MJRefresh.xcodeproj */;
},
);
projectRoot = "";
targets = (
2DA7F9241AA6B4C4005627AB /* MJRefreshExample */,
2DA7F93D1AA6B4C4005627AB /* MJRefreshExampleTests */,
);
};
/* End PBXProject section */
/* Begin PBXReferenceProxy section */
018C083427478732002D968E /* MJRefresh.framework */ = {
isa = PBXReferenceProxy;
fileType = wrapper.framework;
path = MJRefresh.framework;
remoteRef = 018C083327478732002D968E /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
/* End PBXReferenceProxy section */
/* Begin PBXResourcesBuildPhase section */
2DA7F9231AA6B4C4005627AB /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
0133FBBF2693FA8E00E98F66 /* CustomLanguages.bundle in Resources */,
2DA7F9341AA6B4C4005627AB /* Main.storyboard in Resources */,
2D9BEB1C1BB15F4A00AED473 /* MJWebViewViewController.xib in Resources */,
2DA7F9391AA6B4C4005627AB /* LaunchScreen.xib in Resources */,
0193FF162692F8EB00B52B11 /* MJRefresh_i18n.strings in Resources */,
2D9BEB1A1BB15F4A00AED473 /* MJTestViewController.xib in Resources */,
2DA7F9361AA6B4C4005627AB /* Images.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
2DA7F93C1AA6B4C4005627AB /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
2DA7F9211AA6B4C4005627AB /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
2D9BEB0F1BB15F4A00AED473 /* MJDIYHeader.m in Sources */,
2D9BEB181BB15F4A00AED473 /* MJTableViewController.m in Sources */,
2D9BEB0A1BB15F4A00AED473 /* MJChiBaoZiFooter.m in Sources */,
2D9BEB121BB15F4A00AED473 /* MJExampleWindow.m in Sources */,
0193FF132692E99500B52B11 /* I18NExampleViewController.swift in Sources */,
2D9BEB0E1BB15F4A00AED473 /* MJDIYBackFooter.m in Sources */,
2D9BEB161BB15F4A00AED473 /* AppDelegate.m in Sources */,
2D9BEB141BB15F4A00AED473 /* MJSingleViewController.m in Sources */,
2D9BEB0D1BB15F4A00AED473 /* MJDIYAutoFooter.m in Sources */,
2D9BEB1B1BB15F4A00AED473 /* MJWebViewViewController.m in Sources */,
2D9BEB101BB15F4A00AED473 /* MJExample.m in Sources */,
01A5EB2B25EF62B80091554E /* MJWKWebViewController.swift in Sources */,
2DA7F92B1AA6B4C4005627AB /* main.m in Sources */,
2D9BEB091BB15F4A00AED473 /* UIViewController+Example.m in Sources */,
6B8FB1A9250E610D00AF64B7 /* MJHorizontalCollectionViewController.m in Sources */,
2D9BEB111BB15F4A00AED473 /* MJExampleViewController.m in Sources */,
013557022AB7F252001BB573 /* MJPinHeaderCollectionViewController.swift in Sources */,
2D9BEB0C1BB15F4A00AED473 /* MJChiBaoZiHeader.m in Sources */,
2D9BEB191BB15F4A00AED473 /* MJTestViewController.m in Sources */,
2D9BEB151BB15F4A00AED473 /* MJTempViewController.m in Sources */,
2D9BEB171BB15F4A00AED473 /* MJCollectionViewController.m in Sources */,
2D9BEB0B1BB15F4A00AED473 /* MJChiBaoZiFooter2.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
2DA7F93A1AA6B4C4005627AB /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
2DA7F9451AA6B4C4005627AB /* MJRefreshExampleTests.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
2DA7F9401AA6B4C4005627AB /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 2DA7F9241AA6B4C4005627AB /* MJRefreshExample */;
targetProxy = 2DA7F93F1AA6B4C4005627AB /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
0193FF182692F8EB00B52B11 /* MJRefresh_i18n.strings */ = {
isa = PBXVariantGroup;
children = (
0193FF172692F8EB00B52B11 /* en */,
0133FBB82693F7E200E98F66 /* zh-Hans */,
0133FBB92693F7EA00E98F66 /* zh-Hant */,
0133FBBB2693F80400E98F66 /* ru */,
0133FBBC2693F81700E98F66 /* uk */,
0133FBBD2693F81F00E98F66 /* ko */,
012CECBB2CF80CF8002C71E3 /* ar */,
);
name = MJRefresh_i18n.strings;
sourceTree = "";
};
2DA7F9321AA6B4C4005627AB /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
2DA7F9331AA6B4C4005627AB /* Base */,
);
name = Main.storyboard;
sourceTree = "";
};
2DA7F9371AA6B4C4005627AB /* LaunchScreen.xib */ = {
isa = PBXVariantGroup;
children = (
2DA7F9381AA6B4C4005627AB /* Base */,
);
name = LaunchScreen.xib;
sourceTree = "";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
2DA7F9461AA6B4C4005627AB /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
2DA7F9471AA6B4C4005627AB /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
2DA7F9491AA6B4C4005627AB /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
DEVELOPMENT_TEAM = "";
GCC_PREFIX_HEADER = MJRefreshExample/PrefixHeader.pch;
INFOPLIST_FILE = MJRefreshExample/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.mj.MJRefresh;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "MJRefreshExample/MJRefreshExample-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
};
name = Debug;
};
2DA7F94A1AA6B4C4005627AB /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
DEVELOPMENT_TEAM = "";
GCC_PREFIX_HEADER = MJRefreshExample/PrefixHeader.pch;
INFOPLIST_FILE = MJRefreshExample/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.mj.MJRefresh;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "MJRefreshExample/MJRefreshExample-Bridging-Header.h";
SWIFT_VERSION = 5.0;
};
name = Release;
};
2DA7F94C1AA6B4C4005627AB /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
BUNDLE_LOADER = "$(TEST_HOST)";
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/System/Library/Frameworks",
"$(inherited)",
);
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
INFOPLIST_FILE = MJRefreshExampleTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = "com.mj.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/MJRefreshExample.app/MJRefreshExample";
};
name = Debug;
};
2DA7F94D1AA6B4C4005627AB /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
BUNDLE_LOADER = "$(TEST_HOST)";
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/System/Library/Frameworks",
"$(inherited)",
);
INFOPLIST_FILE = MJRefreshExampleTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = "com.mj.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/MJRefreshExample.app/MJRefreshExample";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
2DA7F9201AA6B4C4005627AB /* Build configuration list for PBXProject "MJRefreshExample" */ = {
isa = XCConfigurationList;
buildConfigurations = (
2DA7F9461AA6B4C4005627AB /* Debug */,
2DA7F9471AA6B4C4005627AB /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
2DA7F9481AA6B4C4005627AB /* Build configuration list for PBXNativeTarget "MJRefreshExample" */ = {
isa = XCConfigurationList;
buildConfigurations = (
2DA7F9491AA6B4C4005627AB /* Debug */,
2DA7F94A1AA6B4C4005627AB /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
2DA7F94B1AA6B4C4005627AB /* Build configuration list for PBXNativeTarget "MJRefreshExampleTests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
2DA7F94C1AA6B4C4005627AB /* Debug */,
2DA7F94D1AA6B4C4005627AB /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 2DA7F91D1AA6B4C4005627AB /* Project object */;
}
================================================
FILE: Examples/MJRefreshExample/MJRefreshExampleTests/Info.plist
================================================
CFBundleDevelopmentRegion
en
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
$(PRODUCT_NAME)
CFBundlePackageType
BNDL
CFBundleShortVersionString
1.0
CFBundleSignature
????
CFBundleVersion
1
================================================
FILE: Examples/MJRefreshExample/MJRefreshExampleTests/MJRefreshExampleTests.m
================================================
//
// MJRefreshExampleTests.m
// MJRefreshExampleTests
//
// Created by MJ Lee on 15/3/4.
// Copyright (c) 2015年 小码哥. All rights reserved.
//
#import
#import
@interface MJRefreshExampleTests : XCTestCase
@end
@implementation MJRefreshExampleTests
- (void)setUp {
[super setUp];
// Put setup code here. This method is called before the invocation of each test method in the class.
}
- (void)tearDown {
// Put teardown code here. This method is called after the invocation of each test method in the class.
[super tearDown];
}
- (void)testExample {
// This is an example of a functional test case.
XCTAssert(YES, @"Pass");
}
- (void)testPerformanceExample {
// This is an example of a performance test case.
[self measureBlock:^{
// Put the code you want to measure the time of here.
}];
}
@end
================================================
FILE: Examples/SPMTestExample/SPMTestExample/AppDelegate.swift
================================================
//
// AppDelegate.swift
// SPMTestExample
//
// Created by Frank on 2021/11/19.
//
import UIKit
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}
// MARK: UISceneSession Lifecycle
func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
// Called when a new scene session is being created.
// Use this method to select a configuration to create the new scene with.
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
}
func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) {
// Called when the user discards a scene session.
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
}
}
================================================
FILE: Examples/SPMTestExample/SPMTestExample/Assets.xcassets/AccentColor.colorset/Contents.json
================================================
{
"colors" : [
{
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
================================================
FILE: Examples/SPMTestExample/SPMTestExample/Assets.xcassets/AppIcon.appiconset/Contents.json
================================================
{
"images" : [
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "20x20"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "20x20"
},
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "29x29"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "29x29"
},
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "40x40"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "40x40"
},
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "60x60"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "60x60"
},
{
"idiom" : "ipad",
"scale" : "1x",
"size" : "20x20"
},
{
"idiom" : "ipad",
"scale" : "2x",
"size" : "20x20"
},
{
"idiom" : "ipad",
"scale" : "1x",
"size" : "29x29"
},
{
"idiom" : "ipad",
"scale" : "2x",
"size" : "29x29"
},
{
"idiom" : "ipad",
"scale" : "1x",
"size" : "40x40"
},
{
"idiom" : "ipad",
"scale" : "2x",
"size" : "40x40"
},
{
"idiom" : "ipad",
"scale" : "1x",
"size" : "76x76"
},
{
"idiom" : "ipad",
"scale" : "2x",
"size" : "76x76"
},
{
"idiom" : "ipad",
"scale" : "2x",
"size" : "83.5x83.5"
},
{
"idiom" : "ios-marketing",
"scale" : "1x",
"size" : "1024x1024"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
================================================
FILE: Examples/SPMTestExample/SPMTestExample/Assets.xcassets/Contents.json
================================================
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
================================================
FILE: Examples/SPMTestExample/SPMTestExample/Base.lproj/LaunchScreen.storyboard
================================================
================================================
FILE: Examples/SPMTestExample/SPMTestExample/Base.lproj/Main.storyboard
================================================
================================================
FILE: Examples/SPMTestExample/SPMTestExample/Info.plist
================================================
UIApplicationSceneManifest
UIApplicationSupportsMultipleScenes
UISceneConfigurations
UIWindowSceneSessionRoleApplication
UISceneConfigurationName
Default Configuration
UISceneDelegateClassName
$(PRODUCT_MODULE_NAME).SceneDelegate
UISceneStoryboardFile
Main
================================================
FILE: Examples/SPMTestExample/SPMTestExample/SceneDelegate.swift
================================================
//
// SceneDelegate.swift
// SPMTestExample
//
// Created by Frank on 2021/11/19.
//
import UIKit
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
// Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
// If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
// This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
guard let _ = (scene as? UIWindowScene) else { return }
}
func sceneDidDisconnect(_ scene: UIScene) {
// Called as the scene is being released by the system.
// This occurs shortly after the scene enters the background, or when its session is discarded.
// Release any resources associated with this scene that can be re-created the next time the scene connects.
// The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead).
}
func sceneDidBecomeActive(_ scene: UIScene) {
// Called when the scene has moved from an inactive state to an active state.
// Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
}
func sceneWillResignActive(_ scene: UIScene) {
// Called when the scene will move from an active state to an inactive state.
// This may occur due to temporary interruptions (ex. an incoming phone call).
}
func sceneWillEnterForeground(_ scene: UIScene) {
// Called as the scene transitions from the background to the foreground.
// Use this method to undo the changes made on entering the background.
}
func sceneDidEnterBackground(_ scene: UIScene) {
// Called as the scene transitions from the foreground to the background.
// Use this method to save data, release shared resources, and store enough scene-specific state information
// to restore the scene back to its current state.
}
}
================================================
FILE: Examples/SPMTestExample/SPMTestExample/ViewController.swift
================================================
//
// ViewController.swift
// SPMTestExample
//
// Created by Frank on 2021/11/19.
//
import UIKit
import MJRefresh
class ViewController: UITableViewController {
var itemsCount = 5
override func viewDidLoad() {
super.viewDidLoad()
MJRefreshNormalHeader {
DispatchQueue.main.asyncAfter(deadline: .now() + 1.5) { [weak self] in
guard let self = self else { return }
self.itemsCount += Int.random(in: 1...5)
self.tableView.reloadData()
self.tableView.mj_header?.endRefreshing()
}
}.autoChangeTransparency(true).link(to: self.tableView)
}
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return itemsCount
}
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "Cell")!
cell.textLabel?.text = "\(indexPath.row)"
return cell
}
}
================================================
FILE: Examples/SPMTestExample/SPMTestExample.xcodeproj/project.pbxproj
================================================
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 55;
objects = {
/* Begin PBXBuildFile section */
01A5B83227474A2300E9395F /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01A5B83127474A2300E9395F /* AppDelegate.swift */; };
01A5B83427474A2300E9395F /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01A5B83327474A2300E9395F /* SceneDelegate.swift */; };
01A5B83627474A2300E9395F /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01A5B83527474A2300E9395F /* ViewController.swift */; };
01A5B83927474A2300E9395F /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 01A5B83727474A2300E9395F /* Main.storyboard */; };
01A5B83B27474A2400E9395F /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 01A5B83A27474A2400E9395F /* Assets.xcassets */; };
01A5B83E27474A2400E9395F /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 01A5B83C27474A2400E9395F /* LaunchScreen.storyboard */; };
01BCAEF327474BBD00F6FEE3 /* MJRefresh in Frameworks */ = {isa = PBXBuildFile; productRef = 01BCAEF227474BBD00F6FEE3 /* MJRefresh */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
01A5B82E27474A2300E9395F /* SPMTestExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SPMTestExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
01A5B83127474A2300E9395F /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
01A5B83327474A2300E9395F /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; };
01A5B83527474A2300E9395F /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; };
01A5B83827474A2300E9395F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
01A5B83A27474A2400E9395F /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
01A5B83D27474A2400E9395F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
01A5B83F27474A2400E9395F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
01BCAEF027474AFD00F6FEE3 /* MJRefresh */ = {isa = PBXFileReference; lastKnownFileType = folder; name = MJRefresh; path = ../..; sourceTree = ""; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
01A5B82B27474A2300E9395F /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
01BCAEF327474BBD00F6FEE3 /* MJRefresh in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
01A5B82527474A2300E9395F = {
isa = PBXGroup;
children = (
01BCAEEF27474AFC00F6FEE3 /* Packages */,
01A5B83027474A2300E9395F /* SPMTestExample */,
01A5B82F27474A2300E9395F /* Products */,
01BCAEF127474BBD00F6FEE3 /* Frameworks */,
);
sourceTree = "";
};
01A5B82F27474A2300E9395F /* Products */ = {
isa = PBXGroup;
children = (
01A5B82E27474A2300E9395F /* SPMTestExample.app */,
);
name = Products;
sourceTree = "";
};
01A5B83027474A2300E9395F /* SPMTestExample */ = {
isa = PBXGroup;
children = (
01A5B83127474A2300E9395F /* AppDelegate.swift */,
01A5B83327474A2300E9395F /* SceneDelegate.swift */,
01A5B83527474A2300E9395F /* ViewController.swift */,
01A5B83727474A2300E9395F /* Main.storyboard */,
01A5B83A27474A2400E9395F /* Assets.xcassets */,
01A5B83C27474A2400E9395F /* LaunchScreen.storyboard */,
01A5B83F27474A2400E9395F /* Info.plist */,
);
path = SPMTestExample;
sourceTree = "";
};
01BCAEEF27474AFC00F6FEE3 /* Packages */ = {
isa = PBXGroup;
children = (
01BCAEF027474AFD00F6FEE3 /* MJRefresh */,
);
name = Packages;
sourceTree = "";
};
01BCAEF127474BBD00F6FEE3 /* Frameworks */ = {
isa = PBXGroup;
children = (
);
name = Frameworks;
sourceTree = "";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
01A5B82D27474A2300E9395F /* SPMTestExample */ = {
isa = PBXNativeTarget;
buildConfigurationList = 01A5B84227474A2400E9395F /* Build configuration list for PBXNativeTarget "SPMTestExample" */;
buildPhases = (
01A5B82A27474A2300E9395F /* Sources */,
01A5B82B27474A2300E9395F /* Frameworks */,
01A5B82C27474A2300E9395F /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = SPMTestExample;
packageProductDependencies = (
01BCAEF227474BBD00F6FEE3 /* MJRefresh */,
);
productName = SPMTestExample;
productReference = 01A5B82E27474A2300E9395F /* SPMTestExample.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
01A5B82627474A2300E9395F /* Project object */ = {
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = 1;
LastSwiftUpdateCheck = 1310;
LastUpgradeCheck = 1310;
TargetAttributes = {
01A5B82D27474A2300E9395F = {
CreatedOnToolsVersion = 13.1;
};
};
};
buildConfigurationList = 01A5B82927474A2300E9395F /* Build configuration list for PBXProject "SPMTestExample" */;
compatibilityVersion = "Xcode 13.0";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 01A5B82527474A2300E9395F;
productRefGroup = 01A5B82F27474A2300E9395F /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
01A5B82D27474A2300E9395F /* SPMTestExample */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
01A5B82C27474A2300E9395F /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
01A5B83E27474A2400E9395F /* LaunchScreen.storyboard in Resources */,
01A5B83B27474A2400E9395F /* Assets.xcassets in Resources */,
01A5B83927474A2300E9395F /* Main.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
01A5B82A27474A2300E9395F /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
01A5B83627474A2300E9395F /* ViewController.swift in Sources */,
01A5B83227474A2300E9395F /* AppDelegate.swift in Sources */,
01A5B83427474A2300E9395F /* SceneDelegate.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
01A5B83727474A2300E9395F /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
01A5B83827474A2300E9395F /* Base */,
);
name = Main.storyboard;
sourceTree = "";
};
01A5B83C27474A2400E9395F /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
01A5B83D27474A2400E9395F /* Base */,
);
name = LaunchScreen.storyboard;
sourceTree = "";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
01A5B84027474A2400E9395F /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
};
name = Debug;
};
01A5B84127474A2400E9395F /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
01A5B84327474A2400E9395F /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = SPMTestExample/Info.plist;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen;
INFOPLIST_KEY_UIMainStoryboardFile = Main;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.MJRefresh.SPMTestExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
01A5B84427474A2400E9395F /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = SPMTestExample/Info.plist;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen;
INFOPLIST_KEY_UIMainStoryboardFile = Main;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.MJRefresh.SPMTestExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
01A5B82927474A2300E9395F /* Build configuration list for PBXProject "SPMTestExample" */ = {
isa = XCConfigurationList;
buildConfigurations = (
01A5B84027474A2400E9395F /* Debug */,
01A5B84127474A2400E9395F /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
01A5B84227474A2400E9395F /* Build configuration list for PBXNativeTarget "SPMTestExample" */ = {
isa = XCConfigurationList;
buildConfigurations = (
01A5B84327474A2400E9395F /* Debug */,
01A5B84427474A2400E9395F /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
/* Begin XCSwiftPackageProductDependency section */
01BCAEF227474BBD00F6FEE3 /* MJRefresh */ = {
isa = XCSwiftPackageProductDependency;
productName = MJRefresh;
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = 01A5B82627474A2300E9395F /* Project object */;
}
================================================
FILE: LICENSE
================================================
Copyright (c) 2013-2015 MJRefresh (https://github.com/CoderMJLee/MJRefresh)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
================================================
FILE: MJRefresh/Base/MJRefreshAutoFooter.h
================================================
//
// MJRefreshAutoFooter.h
// MJRefresh
//
// Created by MJ Lee on 15/4/24.
// Copyright (c) 2015年 小码哥. All rights reserved.
//
#if __has_include()
#import
#else
#import "MJRefreshFooter.h"
#endif
NS_ASSUME_NONNULL_BEGIN
@interface MJRefreshAutoFooter : MJRefreshFooter
/** 是否自动刷新(默认为YES) */
@property (assign, nonatomic, getter=isAutomaticallyRefresh) BOOL automaticallyRefresh;
/** 当底部控件出现多少时就自动刷新(默认为1.0,也就是底部控件完全出现时,才会自动刷新) */
@property (assign, nonatomic) CGFloat triggerAutomaticallyRefreshPercent;
/** 自动触发次数, 默认为 1, 仅在拖拽 ScrollView 时才生效,
如果为 -1, 则为无限触发
*/
@property (nonatomic) NSInteger autoTriggerTimes;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: MJRefresh/Base/MJRefreshAutoFooter.m
================================================
//
// MJRefreshAutoFooter.m
// MJRefresh
//
// Created by MJ Lee on 15/4/24.
// Copyright (c) 2015年 小码哥. All rights reserved.
//
#import "MJRefreshAutoFooter.h"
#import "NSBundle+MJRefresh.h"
#import "UIView+MJExtension.h"
#import "UIScrollView+MJExtension.h"
#import "UIScrollView+MJRefresh.h"
@interface MJRefreshAutoFooter()
/** 一个新的拖拽 */
@property (nonatomic) BOOL triggerByDrag;
@property (nonatomic) NSInteger leftTriggerTimes;
@end
@implementation MJRefreshAutoFooter
#pragma mark - 初始化
- (void)willMoveToSuperview:(UIView *)newSuperview
{
[super willMoveToSuperview:newSuperview];
if (newSuperview) { // 新的父控件
if (self.hidden == NO) {
self.scrollView.mj_insetB += self.mj_h;
}
// 设置位置
self.mj_y = _scrollView.mj_contentH + self.ignoredScrollViewContentInsetBottom;
} else { // 被移除了
if (self.hidden == NO) {
self.scrollView.mj_insetB -= self.mj_h;
}
}
}
#pragma mark - 实现父类的方法
- (void)prepare
{
[super prepare];
// 默认底部控件100%出现时才会自动刷新
self.triggerAutomaticallyRefreshPercent = 1.0;
// 设置为默认状态
self.automaticallyRefresh = YES;
self.autoTriggerTimes = 1;
}
- (void)scrollViewContentSizeDidChange:(NSDictionary *)change
{
[super scrollViewContentSizeDidChange:change];
CGSize size = [change[NSKeyValueChangeNewKey] CGSizeValue];
CGFloat contentHeight = size.height == 0 ? self.scrollView.mj_contentH : size.height;
// 设置位置
CGFloat y = contentHeight + self.ignoredScrollViewContentInsetBottom;
if (self.mj_y != y) {
self.mj_y = y;
}
}
- (void)scrollViewContentOffsetDidChange:(NSDictionary *)change
{
[super scrollViewContentOffsetDidChange:change];
if (self.state != MJRefreshStateIdle || !self.automaticallyRefresh || self.mj_y == 0) return;
if (_scrollView.mj_insetT + _scrollView.mj_contentH > _scrollView.mj_h) { // 内容超过一个屏幕
// 这里的_scrollView.mj_contentH替换掉self.mj_y更为合理
if (_scrollView.mj_offsetY >= _scrollView.mj_contentH - _scrollView.mj_h + self.mj_h * self.triggerAutomaticallyRefreshPercent + _scrollView.mj_insetB - self.mj_h) {
// 防止手松开时连续调用
CGPoint old = [change[@"old"] CGPointValue];
CGPoint new = [change[@"new"] CGPointValue];
if (new.y <= old.y) return;
if (_scrollView.isDragging) {
self.triggerByDrag = YES;
}
// 当底部刷新控件完全出现时,才刷新
[self beginRefreshing];
}
}
}
- (void)scrollViewPanStateDidChange:(NSDictionary *)change
{
[super scrollViewPanStateDidChange:change];
if (self.state != MJRefreshStateIdle) return;
UIGestureRecognizerState panState = _scrollView.panGestureRecognizer.state;
switch (panState) {
// 手松开
case UIGestureRecognizerStateEnded: {
if (_scrollView.mj_insetT + _scrollView.mj_contentH <= _scrollView.mj_h) { // 不够一个屏幕
if (_scrollView.mj_offsetY >= - _scrollView.mj_insetT) { // 向上拽
self.triggerByDrag = YES;
[self beginRefreshing];
}
} else { // 超出一个屏幕
if (_scrollView.mj_offsetY >= _scrollView.mj_contentH + _scrollView.mj_insetB - _scrollView.mj_h) {
self.triggerByDrag = YES;
[self beginRefreshing];
}
}
}
break;
case UIGestureRecognizerStateBegan: {
[self resetTriggerTimes];
}
break;
default:
break;
}
}
- (BOOL)unlimitedTrigger {
return self.leftTriggerTimes == -1;
}
- (void)beginRefreshing
{
if (self.triggerByDrag && self.leftTriggerTimes <= 0 && !self.unlimitedTrigger) {
return;
}
[super beginRefreshing];
}
- (void)setState:(MJRefreshState)state
{
MJRefreshCheckState
if (state == MJRefreshStateRefreshing) {
[self executeRefreshingCallback];
} else if (state == MJRefreshStateNoMoreData || state == MJRefreshStateIdle) {
if (self.triggerByDrag) {
if (!self.unlimitedTrigger) {
self.leftTriggerTimes -= 1;
}
self.triggerByDrag = NO;
}
if (MJRefreshStateRefreshing == oldState) {
if (self.scrollView.pagingEnabled) {
CGPoint offset = self.scrollView.contentOffset;
offset.y -= self.scrollView.mj_insetB;
[UIView animateWithDuration:self.slowAnimationDuration animations:^{
self.scrollView.contentOffset = offset;
if (self.endRefreshingAnimationBeginAction) {
self.endRefreshingAnimationBeginAction();
}
} completion:^(BOOL finished) {
if (self.endRefreshingCompletionBlock) {
self.endRefreshingCompletionBlock();
}
}];
return;
}
if (self.endRefreshingCompletionBlock) {
self.endRefreshingCompletionBlock();
}
}
}
}
- (void)resetTriggerTimes {
self.leftTriggerTimes = self.autoTriggerTimes;
}
- (void)setHidden:(BOOL)hidden
{
BOOL lastHidden = self.isHidden;
[super setHidden:hidden];
if (!lastHidden && hidden) {
self.state = MJRefreshStateIdle;
self.scrollView.mj_insetB -= self.mj_h;
} else if (lastHidden && !hidden) {
self.scrollView.mj_insetB += self.mj_h;
// 设置位置
self.mj_y = _scrollView.mj_contentH + self.ignoredScrollViewContentInsetBottom;
}
}
- (void)setAutoTriggerTimes:(NSInteger)autoTriggerTimes {
_autoTriggerTimes = autoTriggerTimes;
self.leftTriggerTimes = autoTriggerTimes;
}
@end
================================================
FILE: MJRefresh/Base/MJRefreshBackFooter.h
================================================
//
// MJRefreshBackFooter.h
// MJRefresh
//
// Created by MJ Lee on 15/4/24.
// Copyright (c) 2015年 小码哥. All rights reserved.
//
#if __has_include()
#import
#else
#import "MJRefreshFooter.h"
#endif
NS_ASSUME_NONNULL_BEGIN
@interface MJRefreshBackFooter : MJRefreshFooter
@end
NS_ASSUME_NONNULL_END
================================================
FILE: MJRefresh/Base/MJRefreshBackFooter.m
================================================
//
// MJRefreshBackFooter.m
// MJRefresh
//
// Created by MJ Lee on 15/4/24.
// Copyright (c) 2015年 小码哥. All rights reserved.
//
#import "MJRefreshBackFooter.h"
#import "NSBundle+MJRefresh.h"
#import "UIView+MJExtension.h"
#import "UIScrollView+MJExtension.h"
#import "UIScrollView+MJRefresh.h"
@interface MJRefreshBackFooter()
@property (assign, nonatomic) NSInteger lastRefreshCount;
@property (assign, nonatomic) CGFloat lastBottomDelta;
@end
@implementation MJRefreshBackFooter
#pragma mark - 初始化
- (void)willMoveToSuperview:(UIView *)newSuperview
{
[super willMoveToSuperview:newSuperview];
[self scrollViewContentSizeDidChange:nil];
}
#pragma mark - 实现父类的方法
- (void)scrollViewContentOffsetDidChange:(NSDictionary *)change
{
[super scrollViewContentOffsetDidChange:change];
// 如果正在刷新,直接返回
if (self.state == MJRefreshStateRefreshing) return;
_scrollViewOriginalInset = self.scrollView.mj_inset;
// 当前的contentOffset
CGFloat currentOffsetY = self.scrollView.mj_offsetY;
// 尾部控件刚好出现的offsetY
CGFloat happenOffsetY = [self happenOffsetY];
// 如果是向下滚动到看不见尾部控件,直接返回
if (currentOffsetY <= happenOffsetY) return;
CGFloat pullingPercent = (currentOffsetY - happenOffsetY) / self.mj_h;
// 如果已全部加载,仅设置pullingPercent,然后返回
if (self.state == MJRefreshStateNoMoreData) {
self.pullingPercent = pullingPercent;
return;
}
if (self.scrollView.isDragging) {
self.pullingPercent = pullingPercent;
// 普通 和 即将刷新 的临界点
CGFloat normal2pullingOffsetY = happenOffsetY + self.mj_h;
if (self.state == MJRefreshStateIdle && currentOffsetY > normal2pullingOffsetY) {
// 转为即将刷新状态
self.state = MJRefreshStatePulling;
} else if (self.state == MJRefreshStatePulling && currentOffsetY <= normal2pullingOffsetY) {
// 转为普通状态
self.state = MJRefreshStateIdle;
}
} else if (self.state == MJRefreshStatePulling) {// 即将刷新 && 手松开
// 开始刷新
[self beginRefreshing];
} else if (pullingPercent < 1) {
self.pullingPercent = pullingPercent;
}
}
- (void)scrollViewContentSizeDidChange:(NSDictionary *)change
{
[super scrollViewContentSizeDidChange:change];
CGSize size = [change[NSKeyValueChangeNewKey] CGSizeValue];
CGFloat contentHeight = size.height == 0 ? self.scrollView.mj_contentH : size.height;
// 内容的高度
contentHeight += self.ignoredScrollViewContentInsetBottom;
// 表格的高度
CGFloat scrollHeight = self.scrollView.mj_h - self.scrollViewOriginalInset.top - self.scrollViewOriginalInset.bottom + self.ignoredScrollViewContentInsetBottom;
// 设置位置
CGFloat y = MAX(contentHeight, scrollHeight);
if (self.mj_y != y) {
self.mj_y = y;
}
}
- (void)setState:(MJRefreshState)state
{
MJRefreshCheckState
// 根据状态来设置属性
if (state == MJRefreshStateNoMoreData || state == MJRefreshStateIdle) {
// 刷新完毕
if (MJRefreshStateRefreshing == oldState) {
[UIView animateWithDuration:self.slowAnimationDuration animations:^{
if (self.endRefreshingAnimationBeginAction) {
self.endRefreshingAnimationBeginAction();
}
self.scrollView.mj_insetB -= self.lastBottomDelta;
// 自动调整透明度
if (self.isAutomaticallyChangeAlpha) self.alpha = 0.0;
} completion:^(BOOL finished) {
self.pullingPercent = 0.0;
if (self.endRefreshingCompletionBlock) {
self.endRefreshingCompletionBlock();
}
}];
}
CGFloat deltaH = [self heightForContentBreakView];
// 刚刷新完毕
if (MJRefreshStateRefreshing == oldState && deltaH > 0 && self.scrollView.mj_totalDataCount != self.lastRefreshCount) {
self.scrollView.mj_offsetY = self.scrollView.mj_offsetY;
}
} else if (state == MJRefreshStateRefreshing) {
// 记录刷新前的数量
self.lastRefreshCount = self.scrollView.mj_totalDataCount;
[UIView animateWithDuration:self.fastAnimationDuration animations:^{
CGFloat bottom = self.mj_h + self.scrollViewOriginalInset.bottom;
CGFloat deltaH = [self heightForContentBreakView];
if (deltaH < 0) { // 如果内容高度小于view的高度
bottom -= deltaH;
}
self.lastBottomDelta = bottom - self.scrollView.mj_insetB;
self.scrollView.mj_insetB = bottom;
self.scrollView.mj_offsetY = [self happenOffsetY] + self.mj_h;
} completion:^(BOOL finished) {
[self executeRefreshingCallback];
}];
}
}
#pragma mark - 私有方法
#pragma mark 获得scrollView的内容 超出 view 的高度
- (CGFloat)heightForContentBreakView
{
CGFloat h = self.scrollView.frame.size.height - self.scrollViewOriginalInset.bottom - self.scrollViewOriginalInset.top;
return self.scrollView.contentSize.height - h;
}
#pragma mark 刚好看到上拉刷新控件时的contentOffset.y
- (CGFloat)happenOffsetY
{
CGFloat deltaH = [self heightForContentBreakView];
if (deltaH > 0) {
return deltaH - self.scrollViewOriginalInset.top;
} else {
return - self.scrollViewOriginalInset.top;
}
}
@end
================================================
FILE: MJRefresh/Base/MJRefreshComponent.h
================================================
// 代码地址: https://github.com/CoderMJLee/MJRefresh
// MJRefreshComponent.h
// MJRefresh
//
// Created by MJ Lee on 15/3/4.
// Copyright (c) 2015年 小码哥. All rights reserved.
// 刷新控件的基类
#import
#if __has_include()
#import
#else
#import "MJRefreshConst.h"
#endif
NS_ASSUME_NONNULL_BEGIN
/** 刷新控件的状态 */
typedef NS_ENUM(NSInteger, MJRefreshState) {
/** 普通闲置状态 */
MJRefreshStateIdle = 1,
/** 松开就可以进行刷新的状态 */
MJRefreshStatePulling,
/** 正在刷新中的状态 */
MJRefreshStateRefreshing,
/** 即将刷新的状态 */
MJRefreshStateWillRefresh,
/** 所有数据加载完毕,没有更多的数据了 */
MJRefreshStateNoMoreData
};
/** 进入刷新状态的回调 */
typedef void (^MJRefreshComponentRefreshingBlock)(void) MJRefreshDeprecated("first deprecated in 3.3.0 - Use `MJRefreshComponentAction` instead");
/** 开始刷新后的回调(进入刷新状态后的回调) */
typedef void (^MJRefreshComponentBeginRefreshingCompletionBlock)(void) MJRefreshDeprecated("first deprecated in 3.3.0 - Use `MJRefreshComponentAction` instead");
/** 结束刷新后的回调 */
typedef void (^MJRefreshComponentEndRefreshingCompletionBlock)(void) MJRefreshDeprecated("first deprecated in 3.3.0 - Use `MJRefreshComponentAction` instead");
/** 刷新用到的回调类型 */
typedef void (^MJRefreshComponentAction)(void);
/** 刷新控件的基类 */
@interface MJRefreshComponent : UIView
{
/** 记录scrollView刚开始的inset */
UIEdgeInsets _scrollViewOriginalInset;
/** 父控件 */
__weak UIScrollView *_scrollView;
}
#pragma mark - 刷新动画时间控制
/** 快速动画时间(一般用在刷新开始的回弹动画), 默认 0.25 */
@property (nonatomic) NSTimeInterval fastAnimationDuration;
/** 慢速动画时间(一般用在刷新结束后的回弹动画), 默认 0.4*/
@property (nonatomic) NSTimeInterval slowAnimationDuration;
/** 关闭全部默认动画效果, 可以简单粗暴地解决 CollectionView 的回弹动画 bug */
- (instancetype)setAnimationDisabled;
#pragma mark - 刷新回调
/** 正在刷新的回调 */
@property (copy, nonatomic, nullable) MJRefreshComponentAction refreshingBlock;
/** 设置回调对象和回调方法 */
- (void)setRefreshingTarget:(id)target refreshingAction:(SEL)action;
/** 回调对象 */
@property (weak, nonatomic) id refreshingTarget;
/** 回调方法 */
@property (assign, nonatomic) SEL refreshingAction;
/** 触发回调(交给子类去调用) */
- (void)executeRefreshingCallback;
#pragma mark - 刷新状态控制
/** 进入刷新状态 */
- (void)beginRefreshing;
- (void)beginRefreshingWithCompletionBlock:(void (^)(void))completionBlock;
/** 开始刷新后的回调(进入刷新状态后的回调) */
@property (copy, nonatomic, nullable) MJRefreshComponentAction beginRefreshingCompletionBlock;
/** 带动画的结束刷新的回调 */
@property (copy, nonatomic, nullable) MJRefreshComponentAction endRefreshingAnimateCompletionBlock MJRefreshDeprecated("first deprecated in 3.3.0 - Use `endRefreshingAnimationBeginAction` instead");
@property (copy, nonatomic, nullable) MJRefreshComponentAction endRefreshingAnimationBeginAction;
/** 结束刷新的回调 */
@property (copy, nonatomic, nullable) MJRefreshComponentAction endRefreshingCompletionBlock;
/** 结束刷新状态 */
- (void)endRefreshing;
- (void)endRefreshingWithCompletionBlock:(void (^)(void))completionBlock;
/** 是否正在刷新 */
@property (assign, nonatomic, readonly, getter=isRefreshing) BOOL refreshing;
/** 刷新状态 一般交给子类内部实现 */
@property (assign, nonatomic) MJRefreshState state;
#pragma mark - 交给子类去访问
/** 记录scrollView刚开始的inset */
@property (assign, nonatomic, readonly) UIEdgeInsets scrollViewOriginalInset;
/** 父控件 */
@property (weak, nonatomic, readonly) UIScrollView *scrollView;
/// 当在 CollectionView 中使用 CollectionViewLayout 中的 flipsHorizontallyInOppositeLayoutDirection 时, 会反向 View 内容. 这里列出的 view 会被自动反向回来.
@property (nonatomic, readonly) NSArray *flipsHorizontallyInOppositeLayoutDirectionViews;
/// 当在 CollectionView 中使用 CollectionViewLayout 中的 flipsHorizontallyInOppositeLayoutDirection 时, 会反向 View 内容. 这里列出的 view 会被自动反向回来. 默认为空
/// - Attention: 增量内容, 不会覆盖 MJRefresh 中的 flipsHorizontallyInOppositeLayoutDirectionViews
@property (nonatomic, readonly) NSArray *additionalFlipsViews;
#pragma mark - 交给子类们去实现
/** 初始化 */
- (void)prepare NS_REQUIRES_SUPER;
/** 摆放子控件frame */
- (void)placeSubviews NS_REQUIRES_SUPER;
/** 当scrollView的contentOffset发生改变的时候调用 */
- (void)scrollViewContentOffsetDidChange:(nullable NSDictionary *)change NS_REQUIRES_SUPER;
/** 当scrollView的contentSize发生改变的时候调用 */
- (void)scrollViewContentSizeDidChange:(nullable NSDictionary *)change NS_REQUIRES_SUPER;
/** 当scrollView的拖拽状态发生改变的时候调用 */
- (void)scrollViewPanStateDidChange:(nullable NSDictionary *)change NS_REQUIRES_SUPER;
/** 多语言配置 language 发生变化时调用
`MJRefreshConfig.defaultConfig.language` 发生改变时调用.
⚠️ 父类会调用 `placeSubviews` 方法, 请勿在 placeSubviews 中调用本方法, 造成死循环. 子类在需要重新布局时, 在配置完修改后, 最后再调用 super 方法, 否则可能导致配置修改后, 定位先于修改执行.
*/
- (void)i18nDidChange NS_REQUIRES_SUPER;
#pragma mark - 其他
/** 拉拽的百分比(交给子类重写) */
@property (assign, nonatomic) CGFloat pullingPercent;
/** 根据拖拽比例自动切换透明度 */
@property (assign, nonatomic, getter=isAutoChangeAlpha) BOOL autoChangeAlpha MJRefreshDeprecated("请使用automaticallyChangeAlpha属性");
/** 根据拖拽比例自动切换透明度 */
@property (assign, nonatomic, getter=isAutomaticallyChangeAlpha) BOOL automaticallyChangeAlpha;
@end
@interface UILabel(MJRefresh)
+ (instancetype)mj_label;
- (CGFloat)mj_textWidth;
@end
@interface MJRefreshComponent (ChainingGrammar)
#pragma mark - <<< 为 Swift 扩展链式语法 >>> -
/// 自动变化透明度
- (instancetype)autoChangeTransparency:(BOOL)isAutoChange;
/// 刷新开始后立即调用的回调
- (instancetype)afterBeginningAction:(MJRefreshComponentAction)action;
/// 刷新动画开始后立即调用的回调
- (instancetype)endingAnimationBeginningAction:(MJRefreshComponentAction)action;
/// 刷新结束后立即调用的回调
- (instancetype)afterEndingAction:(MJRefreshComponentAction)action;
/// 需要子类必须实现
/// @param scrollView 赋值给的 ScrollView 的 Header/Footer/Trailer
- (instancetype)linkTo:(UIScrollView *)scrollView;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: MJRefresh/Base/MJRefreshComponent.m
================================================
// 代码地址: https://github.com/CoderMJLee/MJRefresh
// MJRefreshComponent.m
// MJRefresh
//
// Created by MJ Lee on 15/3/4.
// Copyright (c) 2015年 小码哥. All rights reserved.
//
#import "MJRefreshComponent.h"
#import "MJRefreshConst.h"
#import "MJRefreshConfig.h"
#import "UIView+MJExtension.h"
#import "UIScrollView+MJExtension.h"
#import "UIScrollView+MJRefresh.h"
#import "NSBundle+MJRefresh.h"
@interface MJRefreshComponent()
@property (strong, nonatomic) UIPanGestureRecognizer *pan;
@end
@implementation MJRefreshComponent
#pragma mark - 初始化
- (instancetype)initWithFrame:(CGRect)frame
{
if (self = [super initWithFrame:frame]) {
// 准备工作
[self prepare];
// 默认是普通状态
self.state = MJRefreshStateIdle;
self.fastAnimationDuration = 0.25;
self.slowAnimationDuration = 0.4;
}
return self;
}
- (void)prepare
{
// 基本属性
self.autoresizingMask = UIViewAutoresizingFlexibleWidth;
self.backgroundColor = [UIColor clearColor];
}
- (void)layoutSubviews
{
[self placeSubviews];
[super layoutSubviews];
mj_cguard([self.scrollView isKindOfClass:UICollectionView.class]) else { return; }
UICollectionView *collectionView = (UICollectionView *)self.scrollView;
mj_cguard(collectionView.collectionViewLayout.flipsHorizontallyInOppositeLayoutDirection) else { return; }
CGAffineTransform flipTransform = CGAffineTransformMakeScale(-1, 1);
for (UIView *view in self.flipsHorizontallyInOppositeLayoutDirectionViews) {
view.transform = flipTransform;
}
for (UIView *view in self.additionalFlipsViews) {
view.transform = flipTransform;
}
}
- (void)placeSubviews{}
- (void)willMoveToSuperview:(UIView *)newSuperview
{
[super willMoveToSuperview:newSuperview];
// 如果不是UIScrollView,不做任何事情
if (newSuperview && ![newSuperview isKindOfClass:[UIScrollView class]]) return;
// 旧的父控件移除监听
[self removeObservers];
if (newSuperview) { // 新的父控件
// 记录UIScrollView
_scrollView = (UIScrollView *)newSuperview;
// 设置宽度
self.mj_w = _scrollView.mj_w;
// 设置位置
self.mj_x = -_scrollView.mj_insetL;
// 设置永远支持垂直弹簧效果
_scrollView.alwaysBounceVertical = YES;
// 记录UIScrollView最开始的contentInset
_scrollViewOriginalInset = _scrollView.mj_inset;
// 添加监听
[self addObservers];
}
}
- (void)drawRect:(CGRect)rect
{
[super drawRect:rect];
if (self.state == MJRefreshStateWillRefresh) {
// 预防view还没显示出来就调用了beginRefreshing
self.state = MJRefreshStateRefreshing;
}
}
#pragma mark - KVO监听
- (void)addObservers
{
NSKeyValueObservingOptions options = NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld;
[self.scrollView addObserver:self forKeyPath:MJRefreshKeyPathContentOffset options:options context:nil];
[self.scrollView addObserver:self forKeyPath:MJRefreshKeyPathContentSize options:options context:nil];
self.pan = self.scrollView.panGestureRecognizer;
[self.pan addObserver:self forKeyPath:MJRefreshKeyPathPanState options:options context:nil];
[NSNotificationCenter.defaultCenter addObserver:self selector:@selector(i18nDidChange) name:MJRefreshDidChangeLanguageNotification object:MJRefreshConfig.defaultConfig];
}
- (void)removeObservers
{
[self.superview removeObserver:self forKeyPath:MJRefreshKeyPathContentOffset];
[self.superview removeObserver:self forKeyPath:MJRefreshKeyPathContentSize];
[self.pan removeObserver:self forKeyPath:MJRefreshKeyPathPanState];
self.pan = nil;
}
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
{
// 遇到这些情况就直接返回
if (!self.userInteractionEnabled) return;
// 这个就算看不见也需要处理
if ([keyPath isEqualToString:MJRefreshKeyPathContentSize]) {
[self scrollViewContentSizeDidChange:change];
}
// 看不见
if (self.hidden) return;
if ([keyPath isEqualToString:MJRefreshKeyPathContentOffset]) {
[self scrollViewContentOffsetDidChange:change];
} else if ([keyPath isEqualToString:MJRefreshKeyPathPanState]) {
[self scrollViewPanStateDidChange:change];
}
}
- (void)scrollViewContentOffsetDidChange:(NSDictionary *)change{}
- (void)scrollViewContentSizeDidChange:(NSDictionary *)change{}
- (void)scrollViewPanStateDidChange:(NSDictionary *)change{}
- (void)i18nDidChange {
[self placeSubviews];
}
#pragma mark - 公共方法
#pragma mark 设置回调对象和回调方法
- (void)setRefreshingTarget:(id)target refreshingAction:(SEL)action
{
self.refreshingTarget = target;
self.refreshingAction = action;
}
- (void)setState:(MJRefreshState)state
{
_state = state;
// 加入主队列的目的是等setState:方法调用完毕、设置完文字后再去布局子控件
MJRefreshDispatchAsyncOnMainQueue([self setNeedsLayout];)
}
#pragma mark 进入刷新状态
- (void)beginRefreshing
{
[UIView animateWithDuration:self.fastAnimationDuration animations:^{
self.alpha = 1.0;
}];
self.pullingPercent = 1.0;
// 只要正在刷新,就完全显示
if (self.window) {
self.state = MJRefreshStateRefreshing;
} else {
// 预防正在刷新中时,调用本方法使得header inset回置失败
if (self.state != MJRefreshStateRefreshing) {
self.state = MJRefreshStateWillRefresh;
// 刷新(预防从另一个控制器回到这个控制器的情况,回来要重新刷新一下)
[self setNeedsDisplay];
}
}
}
- (void)beginRefreshingWithCompletionBlock:(void (^)(void))completionBlock
{
self.beginRefreshingCompletionBlock = completionBlock;
[self beginRefreshing];
}
#pragma mark 结束刷新状态
- (void)endRefreshing
{
MJRefreshDispatchAsyncOnMainQueue(self.state = MJRefreshStateIdle;)
}
- (void)endRefreshingWithCompletionBlock:(void (^)(void))completionBlock
{
self.endRefreshingCompletionBlock = completionBlock;
[self endRefreshing];
}
#pragma mark 是否正在刷新
- (BOOL)isRefreshing
{
return self.state == MJRefreshStateRefreshing || self.state == MJRefreshStateWillRefresh;
}
#pragma mark 自动切换透明度
- (void)setAutoChangeAlpha:(BOOL)autoChangeAlpha
{
self.automaticallyChangeAlpha = autoChangeAlpha;
}
- (BOOL)isAutoChangeAlpha
{
return self.isAutomaticallyChangeAlpha;
}
- (void)setAutomaticallyChangeAlpha:(BOOL)automaticallyChangeAlpha
{
_automaticallyChangeAlpha = automaticallyChangeAlpha;
if (self.isRefreshing) return;
if (automaticallyChangeAlpha) {
self.alpha = self.pullingPercent;
} else {
self.alpha = 1.0;
}
}
#pragma mark 根据拖拽进度设置透明度
- (void)setPullingPercent:(CGFloat)pullingPercent
{
_pullingPercent = pullingPercent;
if (self.isRefreshing) return;
if (self.isAutomaticallyChangeAlpha) {
self.alpha = pullingPercent;
}
}
#pragma mark - 内部方法
- (void)executeRefreshingCallback
{
if (self.refreshingBlock) {
self.refreshingBlock();
}
if ([self.refreshingTarget respondsToSelector:self.refreshingAction]) {
MJRefreshMsgSend(MJRefreshMsgTarget(self.refreshingTarget), self.refreshingAction, self);
}
if (self.beginRefreshingCompletionBlock) {
self.beginRefreshingCompletionBlock();
}
}
#pragma mark - 刷新动画时间控制
- (instancetype)setAnimationDisabled {
self.fastAnimationDuration = 0;
self.slowAnimationDuration = 0;
return self;
}
#pragma mark - <<< Deprecation compatible function >>> -
- (void)setEndRefreshingAnimateCompletionBlock:(MJRefreshComponentEndRefreshingCompletionBlock)endRefreshingAnimateCompletionBlock {
_endRefreshingAnimationBeginAction = endRefreshingAnimateCompletionBlock;
}
@end
@implementation UILabel(MJRefresh)
+ (instancetype)mj_label
{
UILabel *label = [[self alloc] init];
label.font = MJRefreshLabelFont;
label.textColor = MJRefreshLabelTextColor;
label.autoresizingMask = UIViewAutoresizingFlexibleWidth;
label.textAlignment = NSTextAlignmentCenter;
label.backgroundColor = [UIColor clearColor];
return label;
}
- (CGFloat)mj_textWidth {
CGFloat stringWidth = 0;
CGSize size = CGSizeMake(MAXFLOAT, MAXFLOAT);
if (self.attributedText) {
if (self.attributedText.length == 0) { return 0; }
stringWidth = [self.attributedText boundingRectWithSize:size
options:NSStringDrawingUsesLineFragmentOrigin
context:nil].size.width;
} else {
if (self.text.length == 0) { return 0; }
NSAssert(self.font != nil, @"请检查 mj_label's `font` 是否设置正确");
stringWidth = [self.text boundingRectWithSize:size
options:NSStringDrawingUsesLineFragmentOrigin
attributes:@{NSFontAttributeName:self.font}
context:nil].size.width;
}
return stringWidth;
}
@end
#pragma mark - <<< 为 Swift 扩展链式语法 >>> -
@implementation MJRefreshComponent (ChainingGrammar)
- (instancetype)autoChangeTransparency:(BOOL)isAutoChange {
self.automaticallyChangeAlpha = isAutoChange;
return self;
}
- (instancetype)afterBeginningAction:(MJRefreshComponentAction)action {
self.beginRefreshingCompletionBlock = action;
return self;
}
- (instancetype)endingAnimationBeginningAction:(MJRefreshComponentAction)action {
self.endRefreshingAnimationBeginAction = action;
return self;
}
- (instancetype)afterEndingAction:(MJRefreshComponentAction)action {
self.endRefreshingCompletionBlock = action;
return self;
}
- (instancetype)linkTo:(UIScrollView *)scrollView {
return self;
}
@end
================================================
FILE: MJRefresh/Base/MJRefreshFooter.h
================================================
// 代码地址: https://github.com/CoderMJLee/MJRefresh
// MJRefreshFooter.h
// MJRefresh
//
// Created by MJ Lee on 15/3/5.
// Copyright (c) 2015年 小码哥. All rights reserved.
// 上拉刷新控件
#if __has_include()
#import
#else
#import "MJRefreshComponent.h"
#endif
NS_ASSUME_NONNULL_BEGIN
@interface MJRefreshFooter : MJRefreshComponent
/** 创建footer */
+ (instancetype)footerWithRefreshingBlock:(MJRefreshComponentAction)refreshingBlock;
/** 创建footer */
+ (instancetype)footerWithRefreshingTarget:(id)target refreshingAction:(SEL)action;
/** 提示没有更多的数据 */
- (void)endRefreshingWithNoMoreData;
- (void)noticeNoMoreData MJRefreshDeprecated("使用endRefreshingWithNoMoreData");
/** 重置没有更多的数据(消除没有更多数据的状态) */
- (void)resetNoMoreData;
/** 忽略多少scrollView的contentInset的bottom */
@property (assign, nonatomic) CGFloat ignoredScrollViewContentInsetBottom;
/** 自动根据有无数据来显示和隐藏(有数据就显示,没有数据隐藏。默认是NO) */
@property (assign, nonatomic, getter=isAutomaticallyHidden) BOOL automaticallyHidden MJRefreshDeprecated("已废弃此属性,开发者请自行控制footer的显示和隐藏");
@end
NS_ASSUME_NONNULL_END
================================================
FILE: MJRefresh/Base/MJRefreshFooter.m
================================================
// 代码地址: https://github.com/CoderMJLee/MJRefresh
// MJRefreshFooter.m
// MJRefresh
//
// Created by MJ Lee on 15/3/5.
// Copyright (c) 2015年 小码哥. All rights reserved.
//
#import "MJRefreshFooter.h"
#import "UIScrollView+MJRefresh.h"
#import "UIView+MJExtension.h"
@interface MJRefreshFooter()
@end
@implementation MJRefreshFooter
#pragma mark - 构造方法
+ (instancetype)footerWithRefreshingBlock:(MJRefreshComponentAction)refreshingBlock
{
MJRefreshFooter *cmp = [[self alloc] init];
cmp.refreshingBlock = refreshingBlock;
return cmp;
}
+ (instancetype)footerWithRefreshingTarget:(id)target refreshingAction:(SEL)action
{
MJRefreshFooter *cmp = [[self alloc] init];
[cmp setRefreshingTarget:target refreshingAction:action];
return cmp;
}
#pragma mark - 重写父类的方法
- (void)prepare
{
[super prepare];
// 设置自己的高度
self.mj_h = MJRefreshFooterHeight;
// 默认不会自动隐藏
// self.automaticallyHidden = NO;
}
#pragma mark . 链式语法部分 .
- (instancetype)linkTo:(UIScrollView *)scrollView {
scrollView.mj_footer = self;
return self;
}
#pragma mark - 公共方法
- (void)endRefreshingWithNoMoreData
{
MJRefreshDispatchAsyncOnMainQueue(self.state = MJRefreshStateNoMoreData;)
}
- (void)noticeNoMoreData
{
[self endRefreshingWithNoMoreData];
}
- (void)resetNoMoreData
{
MJRefreshDispatchAsyncOnMainQueue(self.state = MJRefreshStateIdle;)
}
- (void)setAutomaticallyHidden:(BOOL)automaticallyHidden
{
_automaticallyHidden = automaticallyHidden;
}
@end
================================================
FILE: MJRefresh/Base/MJRefreshHeader.h
================================================
// 代码地址: https://github.com/CoderMJLee/MJRefresh
// MJRefreshHeader.h
// MJRefresh
//
// Created by MJ Lee on 15/3/4.
// Copyright (c) 2015年 小码哥. All rights reserved.
// 下拉刷新控件:负责监控用户下拉的状态
#if __has_include()
#import
#else
#import "MJRefreshComponent.h"
#endif
NS_ASSUME_NONNULL_BEGIN
@interface MJRefreshHeader : MJRefreshComponent
/** 创建header */
+ (instancetype)headerWithRefreshingBlock:(MJRefreshComponentAction)refreshingBlock;
/** 创建header */
+ (instancetype)headerWithRefreshingTarget:(id)target refreshingAction:(SEL)action;
/** 这个key用来存储上一次下拉刷新成功的时间 */
@property (copy, nonatomic) NSString *lastUpdatedTimeKey;
/** 上一次下拉刷新成功的时间 */
@property (strong, nonatomic, readonly, nullable) NSDate *lastUpdatedTime;
/** 忽略多少scrollView的contentInset的top */
@property (assign, nonatomic) CGFloat ignoredScrollViewContentInsetTop;
/** 默认是关闭状态, 如果遇到 CollectionView 的动画异常问题可以尝试打开 */
@property (nonatomic) BOOL isCollectionViewAnimationBug;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: MJRefresh/Base/MJRefreshHeader.m
================================================
// 代码地址: https://github.com/CoderMJLee/MJRefresh
// MJRefreshHeader.m
// MJRefresh
//
// Created by MJ Lee on 15/3/4.
// Copyright (c) 2015年 小码哥. All rights reserved.
//
#import "MJRefreshHeader.h"
#import "UIView+MJExtension.h"
#import "UIScrollView+MJExtension.h"
#import "UIScrollView+MJRefresh.h"
NSString * const MJRefreshHeaderRefreshing2IdleBoundsKey = @"MJRefreshHeaderRefreshing2IdleBounds";
NSString * const MJRefreshHeaderRefreshingBoundsKey = @"MJRefreshHeaderRefreshingBounds";
@interface MJRefreshHeader()
@property (assign, nonatomic) CGFloat insetTDelta;
@end
@implementation MJRefreshHeader
#pragma mark - 构造方法
+ (instancetype)headerWithRefreshingBlock:(MJRefreshComponentAction)refreshingBlock
{
MJRefreshHeader *cmp = [[self alloc] init];
cmp.refreshingBlock = refreshingBlock;
return cmp;
}
+ (instancetype)headerWithRefreshingTarget:(id)target refreshingAction:(SEL)action
{
MJRefreshHeader *cmp = [[self alloc] init];
[cmp setRefreshingTarget:target refreshingAction:action];
return cmp;
}
#pragma mark - 覆盖父类的方法
- (void)prepare
{
[super prepare];
// 设置key
self.lastUpdatedTimeKey = MJRefreshHeaderLastUpdatedTimeKey;
// 设置高度
self.mj_h = MJRefreshHeaderHeight;
}
- (void)placeSubviews
{
[super placeSubviews];
// 设置y值(当自己的高度发生改变了,肯定要重新调整Y值,所以放到placeSubviews方法中设置y值)
self.mj_y = - self.mj_h - self.ignoredScrollViewContentInsetTop;
}
- (void)resetInset {
if (@available(iOS 11.0, *)) {
} else {
// 如果 iOS 10 及以下系统在刷新时, push 新的 VC, 等待刷新完成后回来, 会导致顶部 Insets.top 异常, 不能 resetInset, 检查一下这种特殊情况
if (!self.window) { return; }
}
// sectionheader停留解决
CGFloat insetT = - self.scrollView.mj_offsetY > _scrollViewOriginalInset.top ? - self.scrollView.mj_offsetY : _scrollViewOriginalInset.top;
insetT = insetT > self.mj_h + _scrollViewOriginalInset.top ? self.mj_h + _scrollViewOriginalInset.top : insetT;
self.insetTDelta = _scrollViewOriginalInset.top - insetT;
// 避免 CollectionView 在使用根据 Autolayout 和 内容自动伸缩 Cell, 刷新时导致的 Layout 异常渲染问题
if (fabs(self.scrollView.mj_insetT - insetT) > FLT_EPSILON) {
self.scrollView.mj_insetT = insetT;
}
}
- (void)scrollViewContentOffsetDidChange:(NSDictionary *)change
{
[super scrollViewContentOffsetDidChange:change];
// 在刷新的refreshing状态
if (self.state == MJRefreshStateRefreshing) {
[self resetInset];
return;
}
// 跳转到下一个控制器时,contentInset可能会变
_scrollViewOriginalInset = self.scrollView.mj_inset;
// 当前的contentOffset
CGFloat offsetY = self.scrollView.mj_offsetY;
// 头部控件刚好出现的offsetY
CGFloat happenOffsetY = - self.scrollViewOriginalInset.top;
// 如果是向上滚动到看不见头部控件,直接返回
// >= -> >
if (offsetY > happenOffsetY) return;
// 普通 和 即将刷新 的临界点
CGFloat normal2pullingOffsetY = happenOffsetY - self.mj_h;
CGFloat pullingPercent = (happenOffsetY - offsetY) / self.mj_h;
if (self.scrollView.isDragging) { // 如果正在拖拽
self.pullingPercent = pullingPercent;
if (self.state == MJRefreshStateIdle && offsetY < normal2pullingOffsetY) {
// 转为即将刷新状态
self.state = MJRefreshStatePulling;
} else if (self.state == MJRefreshStatePulling && offsetY >= normal2pullingOffsetY) {
// 转为普通状态
self.state = MJRefreshStateIdle;
}
} else if (self.state == MJRefreshStatePulling) {// 即将刷新 && 手松开
// 开始刷新
[self beginRefreshing];
} else if (pullingPercent < 1) {
self.pullingPercent = pullingPercent;
}
}
- (void)setState:(MJRefreshState)state
{
MJRefreshCheckState
// 根据状态做事情
if (state == MJRefreshStateIdle) {
if (oldState != MJRefreshStateRefreshing) return;
[self headerEndingAction];
} else if (state == MJRefreshStateRefreshing) {
[self headerRefreshingAction];
}
}
- (void)headerEndingAction {
// 保存刷新时间
[[NSUserDefaults standardUserDefaults] setObject:[NSDate date] forKey:self.lastUpdatedTimeKey];
[[NSUserDefaults standardUserDefaults] synchronize];
// 默认使用 UIViewAnimation 动画
if (!self.isCollectionViewAnimationBug) {
// 恢复inset和offset
[UIView animateWithDuration:self.slowAnimationDuration animations:^{
self.scrollView.mj_insetT += self.insetTDelta;
if (self.endRefreshingAnimationBeginAction) {
self.endRefreshingAnimationBeginAction();
}
// 自动调整透明度
if (self.isAutomaticallyChangeAlpha) self.alpha = 0.0;
} completion:^(BOOL finished) {
self.pullingPercent = 0.0;
if (self.endRefreshingCompletionBlock) {
self.endRefreshingCompletionBlock();
}
}];
return;
}
/**
这个解决方法的思路出自 https://github.com/CoderMJLee/MJRefresh/pull/844
修改了用+ [UIView animateWithDuration: animations:]实现的修改contentInset的动画
fix issue#225 https://github.com/CoderMJLee/MJRefresh/issues/225
另一种解法 pull#737 https://github.com/CoderMJLee/MJRefresh/pull/737
同时, 处理了 Refreshing 中的动画替换.
*/
// 由于修改 Inset 会导致 self.pullingPercent 联动设置 self.alpha, 故提前获取 alpha 值, 后续用于还原 alpha 动画
CGFloat viewAlpha = self.alpha;
self.scrollView.mj_insetT += self.insetTDelta;
// 禁用交互, 如果不禁用可能会引起渲染问题.
self.scrollView.userInteractionEnabled = NO;
//CAAnimation keyPath 不支持 contentInset 用Bounds的动画代替
CABasicAnimation *boundsAnimation = [CABasicAnimation animationWithKeyPath:@"bounds"];
boundsAnimation.fromValue = [NSValue valueWithCGRect:CGRectOffset(self.scrollView.bounds, 0, self.insetTDelta)];
boundsAnimation.duration = self.slowAnimationDuration;
//在delegate里移除
boundsAnimation.removedOnCompletion = NO;
boundsAnimation.fillMode = kCAFillModeBoth;
boundsAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
boundsAnimation.delegate = self;
[boundsAnimation setValue:MJRefreshHeaderRefreshing2IdleBoundsKey forKey:@"identity"];
[self.scrollView.layer addAnimation:boundsAnimation forKey:MJRefreshHeaderRefreshing2IdleBoundsKey];
if (self.endRefreshingAnimationBeginAction) {
self.endRefreshingAnimationBeginAction();
}
// 自动调整透明度的动画
if (self.isAutomaticallyChangeAlpha) {
CABasicAnimation *opacityAnimation = [CABasicAnimation animationWithKeyPath:@"opacity"];
opacityAnimation.fromValue = @(viewAlpha);
opacityAnimation.toValue = @(0.0);
opacityAnimation.duration = self.slowAnimationDuration;
opacityAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
[self.layer addAnimation:opacityAnimation forKey:@"MJRefreshHeaderRefreshing2IdleOpacity"];
// 由于修改了 inset 导致, pullingPercent 被设置值, alpha 已经被提前修改为 0 了. 所以这里不用置 0, 但为了代码的严谨性, 不依赖其他的特殊实现方式, 这里还是置 0.
self.alpha = 0;
}
}
- (void)headerRefreshingAction {
// 默认使用 UIViewAnimation 动画
if (!self.isCollectionViewAnimationBug) {
[UIView animateWithDuration:self.fastAnimationDuration animations:^{
if (self.scrollView.panGestureRecognizer.state != UIGestureRecognizerStateCancelled) {
CGFloat top = self.scrollViewOriginalInset.top + self.mj_h;
// 增加滚动区域top
self.scrollView.mj_insetT = top;
// 设置滚动位置
CGPoint offset = self.scrollView.contentOffset;
offset.y = -top;
[self.scrollView setContentOffset:offset animated:NO];
}
} completion:^(BOOL finished) {
[self executeRefreshingCallback];
}];
return;
}
if (self.scrollView.panGestureRecognizer.state != UIGestureRecognizerStateCancelled) {
CGFloat top = self.scrollViewOriginalInset.top + self.mj_h;
// 禁用交互, 如果不禁用可能会引起渲染问题.
self.scrollView.userInteractionEnabled = NO;
// CAAnimation keyPath不支持 contentOffset 用Bounds的动画代替
CABasicAnimation *boundsAnimation = [CABasicAnimation animationWithKeyPath:@"bounds"];
CGRect bounds = self.scrollView.bounds;
bounds.origin.y = -top;
boundsAnimation.fromValue = [NSValue valueWithCGRect:self.scrollView.bounds];
boundsAnimation.toValue = [NSValue valueWithCGRect:bounds];
boundsAnimation.duration = self.fastAnimationDuration;
//在delegate里移除
boundsAnimation.removedOnCompletion = NO;
boundsAnimation.fillMode = kCAFillModeBoth;
boundsAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
boundsAnimation.delegate = self;
[boundsAnimation setValue:MJRefreshHeaderRefreshingBoundsKey forKey:@"identity"];
[self.scrollView.layer addAnimation:boundsAnimation forKey:MJRefreshHeaderRefreshingBoundsKey];
} else {
[self executeRefreshingCallback];
}
}
#pragma mark . 链式语法部分 .
- (instancetype)linkTo:(UIScrollView *)scrollView {
scrollView.mj_header = self;
return self;
}
#pragma mark - CAAnimationDelegate
- (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag {
NSString *identity = [anim valueForKey:@"identity"];
if ([identity isEqualToString:MJRefreshHeaderRefreshing2IdleBoundsKey]) {
self.pullingPercent = 0.0;
self.scrollView.userInteractionEnabled = YES;
if (self.endRefreshingCompletionBlock) {
self.endRefreshingCompletionBlock();
}
} else if ([identity isEqualToString:MJRefreshHeaderRefreshingBoundsKey]) {
// 避免出现 end 先于 Refreshing 状态
if (self.state != MJRefreshStateIdle) {
CGFloat top = self.scrollViewOriginalInset.top + self.mj_h;
self.scrollView.mj_insetT = top;
// 设置最终滚动位置
CGPoint offset = self.scrollView.contentOffset;
offset.y = -top;
[self.scrollView setContentOffset:offset animated:NO];
}
self.scrollView.userInteractionEnabled = YES;
[self executeRefreshingCallback];
}
if ([self.scrollView.layer animationForKey:MJRefreshHeaderRefreshing2IdleBoundsKey]) {
[self.scrollView.layer removeAnimationForKey:MJRefreshHeaderRefreshing2IdleBoundsKey];
}
if ([self.scrollView.layer animationForKey:MJRefreshHeaderRefreshingBoundsKey]) {
[self.scrollView.layer removeAnimationForKey:MJRefreshHeaderRefreshingBoundsKey];
}
}
#pragma mark - 公共方法
- (NSDate *)lastUpdatedTime
{
return [[NSUserDefaults standardUserDefaults] objectForKey:self.lastUpdatedTimeKey];
}
- (void)setIgnoredScrollViewContentInsetTop:(CGFloat)ignoredScrollViewContentInsetTop {
_ignoredScrollViewContentInsetTop = ignoredScrollViewContentInsetTop;
self.mj_y = - self.mj_h - _ignoredScrollViewContentInsetTop;
}
@end
================================================
FILE: MJRefresh/Base/MJRefreshTrailer.h
================================================
//
// MJRefreshTrailer.h
// MJRefresh
//
// Created by kinarobin on 2020/5/3.
// Copyright © 2020 小码哥. All rights reserved.
//
#if __has_include()
#import
#else
#import "MJRefreshComponent.h"
#endif
NS_ASSUME_NONNULL_BEGIN
@interface MJRefreshTrailer : MJRefreshComponent
/** 创建trailer*/
+ (instancetype)trailerWithRefreshingBlock:(MJRefreshComponentAction)refreshingBlock;
/** 创建trailer */
+ (instancetype)trailerWithRefreshingTarget:(id)target refreshingAction:(SEL)action;
/** 忽略多少scrollView的contentInset的right */
@property (assign, nonatomic) CGFloat ignoredScrollViewContentInsetRight;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: MJRefresh/Base/MJRefreshTrailer.m
================================================
//
// MJRefreshTrailer.m
// MJRefresh
//
// Created by kinarobin on 2020/5/3.
// Copyright © 2020 小码哥. All rights reserved.
//
#import "MJRefreshTrailer.h"
#import "UIView+MJExtension.h"
#import "UIScrollView+MJRefresh.h"
#import "UIScrollView+MJExtension.h"
@interface MJRefreshTrailer()
@property (assign, nonatomic) NSInteger lastRefreshCount;
@property (assign, nonatomic) CGFloat lastRightDelta;
@end
@implementation MJRefreshTrailer
#pragma mark - 构造方法
+ (instancetype)trailerWithRefreshingBlock:(MJRefreshComponentAction)refreshingBlock {
MJRefreshTrailer *cmp = [[self alloc] init];
cmp.refreshingBlock = refreshingBlock;
return cmp;
}
+ (instancetype)trailerWithRefreshingTarget:(id)target refreshingAction:(SEL)action {
MJRefreshTrailer *cmp = [[self alloc] init];
[cmp setRefreshingTarget:target refreshingAction:action];
return cmp;
}
- (void)scrollViewContentOffsetDidChange:(NSDictionary *)change {
[super scrollViewContentOffsetDidChange:change];
// 如果正在刷新,直接返回
if (self.state == MJRefreshStateRefreshing) return;
_scrollViewOriginalInset = self.scrollView.mj_inset;
// 当前的contentOffset
CGFloat currentOffsetX = self.scrollView.mj_offsetX;
// 尾部控件刚好出现的offsetX
CGFloat happenOffsetX = [self happenOffsetX];
// 如果是向右滚动到看不见右边控件,直接返回
if (currentOffsetX <= happenOffsetX) return;
CGFloat pullingPercent = (currentOffsetX - happenOffsetX) / self.mj_w;
// 如果已全部加载,仅设置pullingPercent,然后返回
if (self.state == MJRefreshStateNoMoreData) {
self.pullingPercent = pullingPercent;
return;
}
if (self.scrollView.isDragging) {
self.pullingPercent = pullingPercent;
// 普通 和 即将刷新 的临界点
CGFloat normal2pullingOffsetX = happenOffsetX + self.mj_w;
if (self.state == MJRefreshStateIdle && currentOffsetX > normal2pullingOffsetX) {
self.state = MJRefreshStatePulling;
} else if (self.state == MJRefreshStatePulling && currentOffsetX <= normal2pullingOffsetX) {
// 转为普通状态
self.state = MJRefreshStateIdle;
}
} else if (self.state == MJRefreshStatePulling) {// 即将刷新 && 手松开
// 开始刷新
[self beginRefreshing];
} else if (pullingPercent < 1) {
self.pullingPercent = pullingPercent;
}
}
- (void)setState:(MJRefreshState)state {
MJRefreshCheckState
// 根据状态来设置属性
if (state == MJRefreshStateNoMoreData || state == MJRefreshStateIdle) {
// 刷新完毕
if (MJRefreshStateRefreshing == oldState) {
[UIView animateWithDuration:self.slowAnimationDuration animations:^{
if (self.endRefreshingAnimationBeginAction) {
self.endRefreshingAnimationBeginAction();
}
self.scrollView.mj_insetR -= self.lastRightDelta;
// 自动调整透明度
if (self.isAutomaticallyChangeAlpha) self.alpha = 0.0;
} completion:^(BOOL finished) {
self.pullingPercent = 0.0;
if (self.endRefreshingCompletionBlock) {
self.endRefreshingCompletionBlock();
}
}];
}
CGFloat deltaW = [self widthForContentBreakView];
// 刚刷新完毕
if (MJRefreshStateRefreshing == oldState && deltaW > 0 && self.scrollView.mj_totalDataCount != self.lastRefreshCount) {
self.scrollView.mj_offsetX = self.scrollView.mj_offsetX;
}
} else if (state == MJRefreshStateRefreshing) {
// 记录刷新前的数量
self.lastRefreshCount = self.scrollView.mj_totalDataCount;
[UIView animateWithDuration:self.fastAnimationDuration animations:^{
CGFloat right = self.mj_w + self.scrollViewOriginalInset.right;
CGFloat deltaW = [self widthForContentBreakView];
if (deltaW < 0) { // 如果内容宽度小于view的宽度
right -= deltaW;
}
self.lastRightDelta = right - self.scrollView.mj_insetR;
self.scrollView.mj_insetR = right;
// 设置滚动位置
CGPoint offset = self.scrollView.contentOffset;
offset.x = [self happenOffsetX] + self.mj_w;
[self.scrollView setContentOffset:offset animated:NO];
} completion:^(BOOL finished) {
[self executeRefreshingCallback];
}];
}
}
- (void)scrollViewContentSizeDidChange:(NSDictionary *)change {
[super scrollViewContentSizeDidChange:change];
// 内容的宽度
CGFloat contentWidth = self.scrollView.mj_contentW + self.ignoredScrollViewContentInsetRight;
// 表格的宽度
CGFloat scrollWidth = self.scrollView.mj_w - self.scrollViewOriginalInset.left - self.scrollViewOriginalInset.right + self.ignoredScrollViewContentInsetRight;
// 设置位置和尺寸
self.mj_x = MAX(contentWidth, scrollWidth);
}
- (void)placeSubviews {
[super placeSubviews];
self.mj_h = _scrollView.mj_h;
// 设置自己的宽度
self.mj_w = MJRefreshTrailWidth;
}
- (void)willMoveToSuperview:(UIView *)newSuperview {
[super willMoveToSuperview:newSuperview];
if (newSuperview) {
// 设置支持水平弹簧效果
_scrollView.alwaysBounceHorizontal = YES;
_scrollView.alwaysBounceVertical = NO;
}
}
#pragma mark . 链式语法部分 .
- (instancetype)linkTo:(UIScrollView *)scrollView {
scrollView.mj_trailer = self;
return self;
}
#pragma mark - 刚好看到上拉刷新控件时的contentOffset.x
- (CGFloat)happenOffsetX {
CGFloat deltaW = [self widthForContentBreakView];
if (deltaW > 0) {
return deltaW - self.scrollViewOriginalInset.left;
} else {
return - self.scrollViewOriginalInset.left;
}
}
#pragma mark 获得scrollView的内容 超出 view 的宽度
- (CGFloat)widthForContentBreakView {
CGFloat w = self.scrollView.frame.size.width - self.scrollViewOriginalInset.right - self.scrollViewOriginalInset.left;
return self.scrollView.contentSize.width - w;
}
@end
================================================
FILE: MJRefresh/Custom/Footer/Auto/MJRefreshAutoGifFooter.h
================================================
//
// MJRefreshAutoGifFooter.h
// MJRefresh
//
// Created by MJ Lee on 15/4/24.
// Copyright (c) 2015年 小码哥. All rights reserved.
//
#if __has_include()
#import
#else
#import "MJRefreshAutoStateFooter.h"
#endif
NS_ASSUME_NONNULL_BEGIN
@interface MJRefreshAutoGifFooter : MJRefreshAutoStateFooter
@property (weak, nonatomic, readonly) UIImageView *gifView;
/** 设置state状态下的动画图片images 动画持续时间duration*/
- (instancetype)setImages:(NSArray *)images duration:(NSTimeInterval)duration forState:(MJRefreshState)state;
- (instancetype)setImages:(NSArray *)images forState:(MJRefreshState)state;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: MJRefresh/Custom/Footer/Auto/MJRefreshAutoGifFooter.m
================================================
//
// MJRefreshAutoGifFooter.m
// MJRefresh
//
// Created by MJ Lee on 15/4/24.
// Copyright (c) 2015年 小码哥. All rights reserved.
//
#import "MJRefreshAutoGifFooter.h"
#import "NSBundle+MJRefresh.h"
#import "UIView+MJExtension.h"
#import "UIScrollView+MJExtension.h"
#import "UIScrollView+MJRefresh.h"
@interface MJRefreshAutoGifFooter()
{
__unsafe_unretained UIImageView *_gifView;
}
/** 所有状态对应的动画图片 */
@property (strong, nonatomic) NSMutableDictionary *stateImages;
/** 所有状态对应的动画时间 */
@property (strong, nonatomic) NSMutableDictionary *stateDurations;
@end
@implementation MJRefreshAutoGifFooter
#pragma mark - 懒加载
- (UIImageView *)gifView
{
if (!_gifView) {
UIImageView *gifView = [[UIImageView alloc] init];
[self addSubview:_gifView = gifView];
}
return _gifView;
}
- (NSMutableDictionary *)stateImages
{
if (!_stateImages) {
self.stateImages = [NSMutableDictionary dictionary];
}
return _stateImages;
}
- (NSMutableDictionary *)stateDurations
{
if (!_stateDurations) {
self.stateDurations = [NSMutableDictionary dictionary];
}
return _stateDurations;
}
#pragma mark - 公共方法
- (instancetype)setImages:(NSArray *)images duration:(NSTimeInterval)duration forState:(MJRefreshState)state
{
if (images == nil) return self;
self.stateImages[@(state)] = images;
self.stateDurations[@(state)] = @(duration);
/* 根据图片设置控件的高度 */
UIImage *image = [images firstObject];
if (image.size.height > self.mj_h) {
self.mj_h = image.size.height;
}
return self;
}
- (instancetype)setImages:(NSArray *)images forState:(MJRefreshState)state
{
return [self setImages:images duration:images.count * 0.1 forState:state];
}
#pragma mark - 实现父类的方法
- (void)prepare
{
[super prepare];
// 初始化间距
self.labelLeftInset = 20;
}
- (void)placeSubviews
{
[super placeSubviews];
if (self.gifView.constraints.count) return;
self.gifView.frame = self.bounds;
if (self.isRefreshingTitleHidden) {
self.gifView.contentMode = UIViewContentModeCenter;
} else {
self.gifView.contentMode = UIViewContentModeRight;
self.gifView.mj_w = self.mj_w * 0.5 - self.labelLeftInset - self.stateLabel.mj_textWidth * 0.5;
}
}
- (void)setState:(MJRefreshState)state
{
MJRefreshCheckState
// 根据状态做事情
if (state == MJRefreshStateRefreshing) {
NSArray *images = self.stateImages[@(state)];
if (images.count == 0) return;
[self.gifView stopAnimating];
self.gifView.hidden = NO;
if (images.count == 1) { // 单张图片
self.gifView.image = [images lastObject];
} else { // 多张图片
self.gifView.animationImages = images;
self.gifView.animationDuration = [self.stateDurations[@(state)] doubleValue];
[self.gifView startAnimating];
}
} else if (state == MJRefreshStateNoMoreData || state == MJRefreshStateIdle) {
[self.gifView stopAnimating];
self.gifView.hidden = YES;
}
}
- (NSArray *)flipsHorizontallyInOppositeLayoutDirectionViews {
return [super.flipsHorizontallyInOppositeLayoutDirectionViews arrayByAddingObjectsFromArray:@[
self.gifView
]];
}
@end
================================================
FILE: MJRefresh/Custom/Footer/Auto/MJRefreshAutoNormalFooter.h
================================================
//
// MJRefreshAutoNormalFooter.h
// MJRefresh
//
// Created by MJ Lee on 15/4/24.
// Copyright (c) 2015年 小码哥. All rights reserved.
//
#if __has_include()
#import
#else
#import "MJRefreshAutoStateFooter.h"
#endif
NS_ASSUME_NONNULL_BEGIN
@interface MJRefreshAutoNormalFooter : MJRefreshAutoStateFooter
@property (weak, nonatomic, readonly) UIActivityIndicatorView *loadingView;
/** 菊花的样式 */
@property (assign, nonatomic) UIActivityIndicatorViewStyle activityIndicatorViewStyle MJRefreshDeprecated("first deprecated in 3.2.2 - Use `loadingView` property");
@end
NS_ASSUME_NONNULL_END
================================================
FILE: MJRefresh/Custom/Footer/Auto/MJRefreshAutoNormalFooter.m
================================================
//
// MJRefreshAutoNormalFooter.m
// MJRefresh
//
// Created by MJ Lee on 15/4/24.
// Copyright (c) 2015年 小码哥. All rights reserved.
//
#import "MJRefreshAutoNormalFooter.h"
#import "NSBundle+MJRefresh.h"
#import "UIView+MJExtension.h"
#import "UIScrollView+MJExtension.h"
#import "UIScrollView+MJRefresh.h"
@interface MJRefreshAutoNormalFooter()
@property (weak, nonatomic) UIActivityIndicatorView *loadingView;
@end
@implementation MJRefreshAutoNormalFooter
#pragma mark - 懒加载子控件
- (UIActivityIndicatorView *)loadingView
{
if (!_loadingView) {
UIActivityIndicatorView *loadingView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:_activityIndicatorViewStyle];
loadingView.hidesWhenStopped = YES;
[self addSubview:_loadingView = loadingView];
}
return _loadingView;
}
- (void)setActivityIndicatorViewStyle:(UIActivityIndicatorViewStyle)activityIndicatorViewStyle
{
_activityIndicatorViewStyle = activityIndicatorViewStyle;
[self.loadingView removeFromSuperview];
self.loadingView = nil;
[self setNeedsLayout];
}
#pragma mark - 重写父类的方法
- (void)prepare
{
[super prepare];
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000
if (@available(iOS 13.0, *)) {
_activityIndicatorViewStyle = UIActivityIndicatorViewStyleMedium;
return;
}
#endif
_activityIndicatorViewStyle = UIActivityIndicatorViewStyleGray;
}
- (void)placeSubviews
{
[super placeSubviews];
if (self.loadingView.constraints.count) return;
// 圈圈
CGFloat loadingCenterX = self.mj_w * 0.5;
if (!self.isRefreshingTitleHidden) {
loadingCenterX -= self.stateLabel.mj_textWidth * 0.5 + self.labelLeftInset;
}
CGFloat loadingCenterY = self.mj_h * 0.5;
self.loadingView.center = CGPointMake(loadingCenterX, loadingCenterY);
}
- (void)setState:(MJRefreshState)state
{
MJRefreshCheckState
// 根据状态做事情
if (state == MJRefreshStateNoMoreData || state == MJRefreshStateIdle) {
[self.loadingView stopAnimating];
} else if (state == MJRefreshStateRefreshing) {
[self.loadingView startAnimating];
}
}
@end
================================================
FILE: MJRefresh/Custom/Footer/Auto/MJRefreshAutoStateFooter.h
================================================
//
// MJRefreshAutoStateFooter.h
// MJRefresh
//
// Created by MJ Lee on 15/6/13.
// Copyright © 2015年 小码哥. All rights reserved.
//
#if __has_include()
#import
#else
#import "MJRefreshAutoFooter.h"
#endif
NS_ASSUME_NONNULL_BEGIN
@interface MJRefreshAutoStateFooter : MJRefreshAutoFooter
/** 文字距离圈圈、箭头的距离 */
@property (assign, nonatomic) CGFloat labelLeftInset;
/** 显示刷新状态的label */
@property (weak, nonatomic, readonly) UILabel *stateLabel;
/** 设置state状态下的文字 */
- (instancetype)setTitle:(NSString *)title forState:(MJRefreshState)state;
/** 隐藏刷新状态的文字 */
@property (assign, nonatomic, getter=isRefreshingTitleHidden) BOOL refreshingTitleHidden;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: MJRefresh/Custom/Footer/Auto/MJRefreshAutoStateFooter.m
================================================
//
// MJRefreshAutoStateFooter.m
// MJRefresh
//
// Created by MJ Lee on 15/6/13.
// Copyright © 2015年 小码哥. All rights reserved.
//
#import "MJRefreshAutoStateFooter.h"
#import "NSBundle+MJRefresh.h"
@interface MJRefreshAutoFooter (TapTriggerFix)
- (void)beginRefreshingWithoutValidation;
@end
@implementation MJRefreshAutoFooter (TapTriggerFix)
- (void)beginRefreshingWithoutValidation {
[super beginRefreshing];
}
@end
@interface MJRefreshAutoStateFooter()
{
/** 显示刷新状态的label */
__unsafe_unretained UILabel *_stateLabel;
}
/** 所有状态对应的文字 */
@property (strong, nonatomic) NSMutableDictionary *stateTitles;
@end
@implementation MJRefreshAutoStateFooter
#pragma mark - 懒加载
- (NSMutableDictionary *)stateTitles
{
if (!_stateTitles) {
self.stateTitles = [NSMutableDictionary dictionary];
}
return _stateTitles;
}
- (UILabel *)stateLabel
{
if (!_stateLabel) {
[self addSubview:_stateLabel = [UILabel mj_label]];
}
return _stateLabel;
}
#pragma mark - 公共方法
- (instancetype)setTitle:(NSString *)title forState:(MJRefreshState)state
{
if (title == nil) return self;
self.stateTitles[@(state)] = title;
self.stateLabel.text = self.stateTitles[@(self.state)];
return self;
}
#pragma mark - 私有方法
- (void)stateLabelClick
{
if (self.state == MJRefreshStateIdle) {
[super beginRefreshingWithoutValidation];
}
}
- (void)textConfiguration {
// 初始化文字
[self setTitle:[NSBundle mj_localizedStringForKey:MJRefreshAutoFooterIdleText] forState:MJRefreshStateIdle];
[self setTitle:[NSBundle mj_localizedStringForKey:MJRefreshAutoFooterRefreshingText] forState:MJRefreshStateRefreshing];
[self setTitle:[NSBundle mj_localizedStringForKey:MJRefreshAutoFooterNoMoreDataText] forState:MJRefreshStateNoMoreData];
}
#pragma mark - 重写父类的方法
- (void)prepare
{
[super prepare];
// 初始化间距
self.labelLeftInset = MJRefreshLabelLeftInset;
[self textConfiguration];
// 监听label
self.stateLabel.userInteractionEnabled = YES;
[self.stateLabel addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(stateLabelClick)]];
}
- (void)i18nDidChange {
[self textConfiguration];
[super i18nDidChange];
}
- (void)placeSubviews
{
[super placeSubviews];
if (self.stateLabel.constraints.count) return;
// 状态标签
self.stateLabel.frame = self.bounds;
}
- (void)setState:(MJRefreshState)state
{
MJRefreshCheckState
if (self.isRefreshingTitleHidden && state == MJRefreshStateRefreshing) {
self.stateLabel.text = nil;
} else {
self.stateLabel.text = self.stateTitles[@(state)];
}
}
- (NSArray *)flipsHorizontallyInOppositeLayoutDirectionViews {
return @[
self.stateLabel
];
}
@end
================================================
FILE: MJRefresh/Custom/Footer/Back/MJRefreshBackGifFooter.h
================================================
//
// MJRefreshBackGifFooter.h
// MJRefresh
//
// Created by MJ Lee on 15/4/24.
// Copyright (c) 2015年 小码哥. All rights reserved.
//
#if __has_include()
#import
#else
#import "MJRefreshBackStateFooter.h"
#endif
NS_ASSUME_NONNULL_BEGIN
@interface MJRefreshBackGifFooter : MJRefreshBackStateFooter
@property (weak, nonatomic, readonly) UIImageView *gifView;
/** 设置state状态下的动画图片images 动画持续时间duration*/
- (instancetype)setImages:(NSArray *)images duration:(NSTimeInterval)duration forState:(MJRefreshState)state;
- (instancetype)setImages:(NSArray *)images forState:(MJRefreshState)state;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: MJRefresh/Custom/Footer/Back/MJRefreshBackGifFooter.m
================================================
//
// MJRefreshBackGifFooter.m
// MJRefresh
//
// Created by MJ Lee on 15/4/24.
// Copyright (c) 2015年 小码哥. All rights reserved.
//
#import "MJRefreshBackGifFooter.h"
#import "NSBundle+MJRefresh.h"
#import "UIView+MJExtension.h"
#import "UIScrollView+MJExtension.h"
#import "UIScrollView+MJRefresh.h"
@interface MJRefreshBackGifFooter()
{
__unsafe_unretained UIImageView *_gifView;
}
/** 所有状态对应的动画图片 */
@property (strong, nonatomic) NSMutableDictionary *stateImages;
/** 所有状态对应的动画时间 */
@property (strong, nonatomic) NSMutableDictionary *stateDurations;
@end
@implementation MJRefreshBackGifFooter
#pragma mark - 懒加载
- (UIImageView *)gifView
{
if (!_gifView) {
UIImageView *gifView = [[UIImageView alloc] init];
[self addSubview:_gifView = gifView];
}
return _gifView;
}
- (NSMutableDictionary *)stateImages
{
if (!_stateImages) {
self.stateImages = [NSMutableDictionary dictionary];
}
return _stateImages;
}
- (NSMutableDictionary *)stateDurations
{
if (!_stateDurations) {
self.stateDurations = [NSMutableDictionary dictionary];
}
return _stateDurations;
}
#pragma mark - 公共方法
- (instancetype)setImages:(NSArray *)images duration:(NSTimeInterval)duration forState:(MJRefreshState)state
{
if (images == nil) return self;
self.stateImages[@(state)] = images;
self.stateDurations[@(state)] = @(duration);
/* 根据图片设置控件的高度 */
UIImage *image = [images firstObject];
if (image.size.height > self.mj_h) {
self.mj_h = image.size.height;
}
return self;
}
- (instancetype)setImages:(NSArray *)images forState:(MJRefreshState)state
{
return [self setImages:images duration:images.count * 0.1 forState:state];
}
#pragma mark - 实现父类的方法
- (void)prepare
{
[super prepare];
// 初始化间距
self.labelLeftInset = 20;
}
- (void)setPullingPercent:(CGFloat)pullingPercent
{
[super setPullingPercent:pullingPercent];
NSArray *images = self.stateImages[@(MJRefreshStateIdle)];
if (self.state != MJRefreshStateIdle || images.count == 0) return;
[self.gifView stopAnimating];
NSUInteger index = images.count * pullingPercent;
if (index >= images.count) index = images.count - 1;
self.gifView.image = images[index];
}
- (void)placeSubviews
{
[super placeSubviews];
if (self.gifView.constraints.count) return;
self.gifView.frame = self.bounds;
if (self.stateLabel.hidden) {
self.gifView.contentMode = UIViewContentModeCenter;
} else {
self.gifView.contentMode = UIViewContentModeRight;
self.gifView.mj_w = self.mj_w * 0.5 - self.labelLeftInset - self.stateLabel.mj_textWidth * 0.5;
}
}
- (void)setState:(MJRefreshState)state
{
MJRefreshCheckState
// 根据状态做事情
if (state == MJRefreshStatePulling || state == MJRefreshStateRefreshing) {
NSArray *images = self.stateImages[@(state)];
if (images.count == 0) return;
self.gifView.hidden = NO;
[self.gifView stopAnimating];
if (images.count == 1) { // 单张图片
self.gifView.image = [images lastObject];
} else { // 多张图片
self.gifView.animationImages = images;
self.gifView.animationDuration = [self.stateDurations[@(state)] doubleValue];
[self.gifView startAnimating];
}
} else if (state == MJRefreshStateIdle) {
self.gifView.hidden = NO;
} else if (state == MJRefreshStateNoMoreData) {
self.gifView.hidden = YES;
}
}
- (NSArray *)flipsHorizontallyInOppositeLayoutDirectionViews {
return [super.flipsHorizontallyInOppositeLayoutDirectionViews arrayByAddingObjectsFromArray:@[
self.gifView
]];
}
@end
================================================
FILE: MJRefresh/Custom/Footer/Back/MJRefreshBackNormalFooter.h
================================================
//
// MJRefreshBackNormalFooter.h
// MJRefresh
//
// Created by MJ Lee on 15/4/24.
// Copyright (c) 2015年 小码哥. All rights reserved.
//
#if __has_include()
#import
#else
#import "MJRefreshBackStateFooter.h"
#endif
NS_ASSUME_NONNULL_BEGIN
@interface MJRefreshBackNormalFooter : MJRefreshBackStateFooter
@property (weak, nonatomic, readonly) UIImageView *arrowView;
@property (weak, nonatomic, readonly) UIActivityIndicatorView *loadingView;
/** 菊花的样式 */
@property (assign, nonatomic) UIActivityIndicatorViewStyle activityIndicatorViewStyle MJRefreshDeprecated("first deprecated in 3.2.2 - Use `loadingView` property");
@end
NS_ASSUME_NONNULL_END
================================================
FILE: MJRefresh/Custom/Footer/Back/MJRefreshBackNormalFooter.m
================================================
//
// MJRefreshBackNormalFooter.m
// MJRefresh
//
// Created by MJ Lee on 15/4/24.
// Copyright (c) 2015年 小码哥. All rights reserved.
//
#import "MJRefreshBackNormalFooter.h"
#import "NSBundle+MJRefresh.h"
#import "UIView+MJExtension.h"
@interface MJRefreshBackNormalFooter()
{
__unsafe_unretained UIImageView *_arrowView;
}
@property (weak, nonatomic) UIActivityIndicatorView *loadingView;
@end
@implementation MJRefreshBackNormalFooter
#pragma mark - 懒加载子控件
- (UIImageView *)arrowView
{
if (!_arrowView) {
UIImageView *arrowView = [[UIImageView alloc] initWithImage:[NSBundle mj_arrowImage]];
[self addSubview:_arrowView = arrowView];
}
return _arrowView;
}
- (UIActivityIndicatorView *)loadingView
{
if (!_loadingView) {
UIActivityIndicatorView *loadingView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:_activityIndicatorViewStyle];
loadingView.hidesWhenStopped = YES;
[self addSubview:_loadingView = loadingView];
}
return _loadingView;
}
- (void)setActivityIndicatorViewStyle:(UIActivityIndicatorViewStyle)activityIndicatorViewStyle
{
_activityIndicatorViewStyle = activityIndicatorViewStyle;
[self.loadingView removeFromSuperview];
self.loadingView = nil;
[self setNeedsLayout];
}
#pragma mark - 重写父类的方法
- (void)prepare
{
[super prepare];
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000
if (@available(iOS 13.0, *)) {
_activityIndicatorViewStyle = UIActivityIndicatorViewStyleMedium;
return;
}
#endif
_activityIndicatorViewStyle = UIActivityIndicatorViewStyleGray;
}
- (void)placeSubviews
{
[super placeSubviews];
// 箭头的中心点
CGFloat arrowCenterX = self.mj_w * 0.5;
if (!self.stateLabel.hidden) {
arrowCenterX -= self.labelLeftInset + self.stateLabel.mj_textWidth * 0.5;
}
CGFloat arrowCenterY = self.mj_h * 0.5;
CGPoint arrowCenter = CGPointMake(arrowCenterX, arrowCenterY);
// 箭头
if (self.arrowView.constraints.count == 0) {
self.arrowView.mj_size = self.arrowView.image.size;
self.arrowView.center = arrowCenter;
}
// 圈圈
if (self.loadingView.constraints.count == 0) {
self.loadingView.center = arrowCenter;
}
self.arrowView.tintColor = self.stateLabel.textColor;
}
- (void)setState:(MJRefreshState)state
{
MJRefreshCheckState
// 根据状态做事情
if (state == MJRefreshStateIdle) {
if (oldState == MJRefreshStateRefreshing) {
self.arrowView.transform = CGAffineTransformMakeRotation(0.000001 - M_PI);
[UIView animateWithDuration:self.slowAnimationDuration animations:^{
self.loadingView.alpha = 0.0;
} completion:^(BOOL finished) {
// 防止动画结束后,状态已经不是MJRefreshStateIdle
if (self.state != MJRefreshStateIdle) return;
self.loadingView.alpha = 1.0;
[self.loadingView stopAnimating];
self.arrowView.hidden = NO;
}];
} else {
self.arrowView.hidden = NO;
[self.loadingView stopAnimating];
[UIView animateWithDuration:self.fastAnimationDuration animations:^{
self.arrowView.transform = CGAffineTransformMakeRotation(0.000001 - M_PI);
}];
}
} else if (state == MJRefreshStatePulling) {
self.arrowView.hidden = NO;
[self.loadingView stopAnimating];
[UIView animateWithDuration:self.fastAnimationDuration animations:^{
self.arrowView.transform = CGAffineTransformIdentity;
}];
} else if (state == MJRefreshStateRefreshing) {
self.arrowView.hidden = YES;
[self.loadingView startAnimating];
} else if (state == MJRefreshStateNoMoreData) {
self.arrowView.hidden = YES;
[self.loadingView stopAnimating];
}
}
- (NSArray *)flipsHorizontallyInOppositeLayoutDirectionViews {
return [super.flipsHorizontallyInOppositeLayoutDirectionViews arrayByAddingObjectsFromArray:@[
self.arrowView
]];
}
@end
================================================
FILE: MJRefresh/Custom/Footer/Back/MJRefreshBackStateFooter.h
================================================
//
// MJRefreshBackStateFooter.h
// MJRefresh
//
// Created by MJ Lee on 15/6/13.
// Copyright © 2015年 小码哥. All rights reserved.
//
#if __has_include()
#import
#else
#import "MJRefreshBackFooter.h"
#endif
NS_ASSUME_NONNULL_BEGIN
@interface MJRefreshBackStateFooter : MJRefreshBackFooter
/** 文字距离圈圈、箭头的距离 */
@property (assign, nonatomic) CGFloat labelLeftInset;
/** 显示刷新状态的label */
@property (weak, nonatomic, readonly) UILabel *stateLabel;
/** 设置state状态下的文字 */
- (instancetype)setTitle:(NSString *)title forState:(MJRefreshState)state;
/** 获取state状态下的title */
- (NSString *)titleForState:(MJRefreshState)state;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: MJRefresh/Custom/Footer/Back/MJRefreshBackStateFooter.m
================================================
//
// MJRefreshBackStateFooter.m
// MJRefresh
//
// Created by MJ Lee on 15/6/13.
// Copyright © 2015年 小码哥. All rights reserved.
//
#import "MJRefreshBackStateFooter.h"
#import "NSBundle+MJRefresh.h"
@interface MJRefreshBackStateFooter()
{
/** 显示刷新状态的label */
__unsafe_unretained UILabel *_stateLabel;
}
/** 所有状态对应的文字 */
@property (strong, nonatomic) NSMutableDictionary *stateTitles;
@end
@implementation MJRefreshBackStateFooter
#pragma mark - 懒加载
- (NSMutableDictionary *)stateTitles
{
if (!_stateTitles) {
self.stateTitles = [NSMutableDictionary dictionary];
}
return _stateTitles;
}
- (UILabel *)stateLabel
{
if (!_stateLabel) {
[self addSubview:_stateLabel = [UILabel mj_label]];
}
return _stateLabel;
}
#pragma mark - 公共方法
- (instancetype)setTitle:(NSString *)title forState:(MJRefreshState)state
{
if (title == nil) return self;
self.stateTitles[@(state)] = title;
self.stateLabel.text = self.stateTitles[@(self.state)];
return self;
}
- (NSString *)titleForState:(MJRefreshState)state {
return self.stateTitles[@(state)];
}
- (void)textConfiguration {
// 初始化文字
[self setTitle:[NSBundle mj_localizedStringForKey:MJRefreshBackFooterIdleText] forState:MJRefreshStateIdle];
[self setTitle:[NSBundle mj_localizedStringForKey:MJRefreshBackFooterPullingText] forState:MJRefreshStatePulling];
[self setTitle:[NSBundle mj_localizedStringForKey:MJRefreshBackFooterRefreshingText] forState:MJRefreshStateRefreshing];
[self setTitle:[NSBundle mj_localizedStringForKey:MJRefreshBackFooterNoMoreDataText] forState:MJRefreshStateNoMoreData];
}
#pragma mark - 重写父类的方法
- (void)prepare
{
[super prepare];
// 初始化间距
self.labelLeftInset = MJRefreshLabelLeftInset;
[self textConfiguration];
}
- (void)i18nDidChange {
[self textConfiguration];
[super i18nDidChange];
}
- (void)placeSubviews
{
[super placeSubviews];
if (self.stateLabel.constraints.count) return;
// 状态标签
self.stateLabel.frame = self.bounds;
}
- (void)setState:(MJRefreshState)state
{
MJRefreshCheckState
// 设置状态文字
self.stateLabel.text = self.stateTitles[@(state)];
}
- (NSArray *)flipsHorizontallyInOppositeLayoutDirectionViews {
return @[
self.stateLabel
];
}
@end
================================================
FILE: MJRefresh/Custom/Header/MJRefreshGifHeader.h
================================================
//
// MJRefreshGifHeader.h
// MJRefresh
//
// Created by MJ Lee on 15/4/24.
// Copyright (c) 2015年 小码哥. All rights reserved.
//
#if __has_include()
#import
#else
#import "MJRefreshStateHeader.h"
#endif
NS_ASSUME_NONNULL_BEGIN
@interface MJRefreshGifHeader : MJRefreshStateHeader
@property (weak, nonatomic, readonly) UIImageView *gifView;
/** 设置state状态下的动画图片images 动画持续时间duration*/
- (instancetype)setImages:(NSArray *)images duration:(NSTimeInterval)duration forState:(MJRefreshState)state;
- (instancetype)setImages:(NSArray *)images forState:(MJRefreshState)state;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: MJRefresh/Custom/Header/MJRefreshGifHeader.m
================================================
//
// MJRefreshGifHeader.m
// MJRefresh
//
// Created by MJ Lee on 15/4/24.
// Copyright (c) 2015年 小码哥. All rights reserved.
//
#import "MJRefreshGifHeader.h"
#import "UIView+MJExtension.h"
#import "UIScrollView+MJExtension.h"
@interface MJRefreshGifHeader()
{
__unsafe_unretained UIImageView *_gifView;
}
/** 所有状态对应的动画图片 */
@property (strong, nonatomic) NSMutableDictionary *stateImages;
/** 所有状态对应的动画时间 */
@property (strong, nonatomic) NSMutableDictionary *stateDurations;
@end
@implementation MJRefreshGifHeader
#pragma mark - 懒加载
- (UIImageView *)gifView
{
if (!_gifView) {
UIImageView *gifView = [[UIImageView alloc] init];
[self addSubview:_gifView = gifView];
}
return _gifView;
}
- (NSMutableDictionary *)stateImages
{
if (!_stateImages) {
self.stateImages = [NSMutableDictionary dictionary];
}
return _stateImages;
}
- (NSMutableDictionary *)stateDurations
{
if (!_stateDurations) {
self.stateDurations = [NSMutableDictionary dictionary];
}
return _stateDurations;
}
#pragma mark - 公共方法
- (instancetype)setImages:(NSArray *)images duration:(NSTimeInterval)duration forState:(MJRefreshState)state {
if (images == nil) return self;
self.stateImages[@(state)] = images;
self.stateDurations[@(state)] = @(duration);
/* 根据图片设置控件的高度 */
UIImage *image = [images firstObject];
if (image.size.height > self.mj_h) {
self.mj_h = image.size.height;
}
return self;
}
- (instancetype)setImages:(NSArray *)images forState:(MJRefreshState)state
{
return [self setImages:images duration:images.count * 0.1 forState:state];
}
#pragma mark - 实现父类的方法
- (void)prepare
{
[super prepare];
// 初始化间距
self.labelLeftInset = 20;
}
- (void)setPullingPercent:(CGFloat)pullingPercent
{
[super setPullingPercent:pullingPercent];
NSArray *images = self.stateImages[@(MJRefreshStateIdle)];
if (self.state != MJRefreshStateIdle || images.count == 0) return;
// 停止动画
[self.gifView stopAnimating];
// 设置当前需要显示的图片
NSUInteger index = images.count * pullingPercent;
if (index >= images.count) index = images.count - 1;
self.gifView.image = images[index];
}
- (void)placeSubviews
{
[super placeSubviews];
if (self.gifView.constraints.count) return;
self.gifView.frame = self.bounds;
if (self.stateLabel.hidden && self.lastUpdatedTimeLabel.hidden) {
self.gifView.contentMode = UIViewContentModeCenter;
} else {
self.gifView.contentMode = UIViewContentModeRight;
CGFloat stateWidth = self.stateLabel.mj_textWidth;
CGFloat timeWidth = 0.0;
if (!self.lastUpdatedTimeLabel.hidden) {
timeWidth = self.lastUpdatedTimeLabel.mj_textWidth;
}
CGFloat textWidth = MAX(stateWidth, timeWidth);
self.gifView.mj_w = self.mj_w * 0.5 - textWidth * 0.5 - self.labelLeftInset;
}
}
- (void)setState:(MJRefreshState)state
{
MJRefreshCheckState
// 根据状态做事情
if (state == MJRefreshStatePulling || state == MJRefreshStateRefreshing) {
NSArray *images = self.stateImages[@(state)];
if (images.count == 0) return;
[self.gifView stopAnimating];
if (images.count == 1) { // 单张图片
self.gifView.image = [images lastObject];
} else { // 多张图片
self.gifView.animationImages = images;
self.gifView.animationDuration = [self.stateDurations[@(state)] doubleValue];
[self.gifView startAnimating];
}
} else if (state == MJRefreshStateIdle) {
[self.gifView stopAnimating];
}
}
- (NSArray *)flipsHorizontallyInOppositeLayoutDirectionViews {
return [super.flipsHorizontallyInOppositeLayoutDirectionViews arrayByAddingObjectsFromArray:@[
self.gifView
]];
}
@end
================================================
FILE: MJRefresh/Custom/Header/MJRefreshNormalHeader.h
================================================
//
// MJRefreshNormalHeader.h
// MJRefresh
//
// Created by MJ Lee on 15/4/24.
// Copyright (c) 2015年 小码哥. All rights reserved.
//
#if __has_include()
#import
#else
#import "MJRefreshStateHeader.h"
#endif
NS_ASSUME_NONNULL_BEGIN
@interface MJRefreshNormalHeader : MJRefreshStateHeader
@property (weak, nonatomic, readonly) UIImageView *arrowView;
@property (weak, nonatomic, readonly) UIActivityIndicatorView *loadingView;
/** 菊花的样式 */
@property (assign, nonatomic) UIActivityIndicatorViewStyle activityIndicatorViewStyle MJRefreshDeprecated("first deprecated in 3.2.2 - Use `loadingView` property");
@end
NS_ASSUME_NONNULL_END
================================================
FILE: MJRefresh/Custom/Header/MJRefreshNormalHeader.m
================================================
//
// MJRefreshNormalHeader.m
// MJRefresh
//
// Created by MJ Lee on 15/4/24.
// Copyright (c) 2015年 小码哥. All rights reserved.
//
#import "MJRefreshNormalHeader.h"
#import "NSBundle+MJRefresh.h"
#import "UIScrollView+MJRefresh.h"
#import "UIView+MJExtension.h"
@interface MJRefreshNormalHeader()
{
__unsafe_unretained UIImageView *_arrowView;
}
@property (weak, nonatomic) UIActivityIndicatorView *loadingView;
@end
@implementation MJRefreshNormalHeader
#pragma mark - 懒加载子控件
- (UIImageView *)arrowView
{
if (!_arrowView) {
UIImageView *arrowView = [[UIImageView alloc] initWithImage:[NSBundle mj_arrowImage]];
[self addSubview:_arrowView = arrowView];
}
return _arrowView;
}
- (UIActivityIndicatorView *)loadingView
{
if (!_loadingView) {
UIActivityIndicatorView *loadingView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:_activityIndicatorViewStyle];
loadingView.hidesWhenStopped = YES;
[self addSubview:_loadingView = loadingView];
}
return _loadingView;
}
#pragma mark - 公共方法
- (void)setActivityIndicatorViewStyle:(UIActivityIndicatorViewStyle)activityIndicatorViewStyle
{
_activityIndicatorViewStyle = activityIndicatorViewStyle;
[self.loadingView removeFromSuperview];
self.loadingView = nil;
[self setNeedsLayout];
}
#pragma mark - 重写父类的方法
- (void)prepare
{
[super prepare];
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000
if (@available(iOS 13.0, *)) {
_activityIndicatorViewStyle = UIActivityIndicatorViewStyleMedium;
return;
}
#endif
_activityIndicatorViewStyle = UIActivityIndicatorViewStyleGray;
}
- (void)placeSubviews
{
[super placeSubviews];
// 箭头的中心点
CGFloat arrowCenterX = self.mj_w * 0.5;
if (!self.stateLabel.hidden) {
CGFloat stateWidth = self.stateLabel.mj_textWidth;
CGFloat timeWidth = 0.0;
if (!self.lastUpdatedTimeLabel.hidden) {
timeWidth = self.lastUpdatedTimeLabel.mj_textWidth;
}
CGFloat textWidth = MAX(stateWidth, timeWidth);
arrowCenterX -= textWidth / 2 + self.labelLeftInset;
}
CGFloat arrowCenterY = self.mj_h * 0.5;
CGPoint arrowCenter = CGPointMake(arrowCenterX, arrowCenterY);
// 箭头
if (self.arrowView.constraints.count == 0) {
self.arrowView.mj_size = self.arrowView.image.size;
self.arrowView.center = arrowCenter;
}
// 圈圈
if (self.loadingView.constraints.count == 0) {
self.loadingView.center = arrowCenter;
}
self.arrowView.tintColor = self.stateLabel.textColor;
}
- (void)setState:(MJRefreshState)state
{
MJRefreshCheckState
// 根据状态做事情
if (state == MJRefreshStateIdle) {
if (oldState == MJRefreshStateRefreshing) {
self.arrowView.transform = CGAffineTransformIdentity;
[UIView animateWithDuration:self.slowAnimationDuration animations:^{
self.loadingView.alpha = 0.0;
} completion:^(BOOL finished) {
// 如果执行完动画发现不是idle状态,就直接返回,进入其他状态
if (self.state != MJRefreshStateIdle) return;
self.loadingView.alpha = 1.0;
[self.loadingView stopAnimating];
self.arrowView.hidden = NO;
}];
} else {
[self.loadingView stopAnimating];
self.arrowView.hidden = NO;
[UIView animateWithDuration:self.fastAnimationDuration animations:^{
self.arrowView.transform = CGAffineTransformIdentity;
}];
}
} else if (state == MJRefreshStatePulling) {
[self.loadingView stopAnimating];
self.arrowView.hidden = NO;
[UIView animateWithDuration:self.fastAnimationDuration animations:^{
self.arrowView.transform = CGAffineTransformMakeRotation(0.000001 - M_PI);
}];
} else if (state == MJRefreshStateRefreshing) {
self.loadingView.alpha = 1.0; // 防止refreshing -> idle的动画完毕动作没有被执行
[self.loadingView startAnimating];
self.arrowView.hidden = YES;
}
}
- (NSArray *)flipsHorizontallyInOppositeLayoutDirectionViews {
return [super.flipsHorizontallyInOppositeLayoutDirectionViews arrayByAddingObjectsFromArray:@[
self.arrowView
]];
}
@end
================================================
FILE: MJRefresh/Custom/Header/MJRefreshStateHeader.h
================================================
//
// MJRefreshStateHeader.h
// MJRefresh
//
// Created by MJ Lee on 15/4/24.
// Copyright (c) 2015年 小码哥. All rights reserved.
//
#if __has_include()
#import
#else
#import "MJRefreshHeader.h"
#endif
NS_ASSUME_NONNULL_BEGIN
@interface MJRefreshStateHeader : MJRefreshHeader
#pragma mark - 刷新时间相关
/** 利用这个block来决定显示的更新时间文字 */
@property (copy, nonatomic, nullable) NSString *(^lastUpdatedTimeText)(NSDate * _Nullable lastUpdatedTime);
/** 显示上一次刷新时间的label */
@property (weak, nonatomic, readonly) UILabel *lastUpdatedTimeLabel;
#pragma mark - 状态相关
/** 文字距离圈圈、箭头的距离 */
@property (assign, nonatomic) CGFloat labelLeftInset;
/** 显示刷新状态的label */
@property (weak, nonatomic, readonly) UILabel *stateLabel;
/** 设置state状态下的文字 */
- (instancetype)setTitle:(NSString *)title forState:(MJRefreshState)state;
@end
@interface MJRefreshStateHeader (ChainingGrammar)
- (instancetype)modifyLastUpdatedTimeText:(NSString * (^)(NSDate * _Nullable lastUpdatedTime))handler;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: MJRefresh/Custom/Header/MJRefreshStateHeader.m
================================================
//
// MJRefreshStateHeader.m
// MJRefresh
//
// Created by MJ Lee on 15/4/24.
// Copyright (c) 2015年 小码哥. All rights reserved.
//
#import "MJRefreshStateHeader.h"
#import "MJRefreshConst.h"
#import "NSBundle+MJRefresh.h"
#import "UIView+MJExtension.h"
#import "UIScrollView+MJExtension.h"
@interface MJRefreshStateHeader()
{
/** 显示上一次刷新时间的label */
__unsafe_unretained UILabel *_lastUpdatedTimeLabel;
/** 显示刷新状态的label */
__unsafe_unretained UILabel *_stateLabel;
}
/** 所有状态对应的文字 */
@property (strong, nonatomic) NSMutableDictionary *stateTitles;
@end
@implementation MJRefreshStateHeader
#pragma mark - 懒加载
- (NSMutableDictionary *)stateTitles
{
if (!_stateTitles) {
self.stateTitles = [NSMutableDictionary dictionary];
}
return _stateTitles;
}
- (UILabel *)stateLabel
{
if (!_stateLabel) {
[self addSubview:_stateLabel = [UILabel mj_label]];
}
return _stateLabel;
}
- (UILabel *)lastUpdatedTimeLabel
{
if (!_lastUpdatedTimeLabel) {
[self addSubview:_lastUpdatedTimeLabel = [UILabel mj_label]];
}
return _lastUpdatedTimeLabel;
}
- (void)setLastUpdatedTimeText:(NSString * _Nonnull (^)(NSDate * _Nullable))lastUpdatedTimeText{
_lastUpdatedTimeText = lastUpdatedTimeText;
// 重新设置key(重新显示时间)
self.lastUpdatedTimeKey = self.lastUpdatedTimeKey;
}
#pragma mark - 公共方法
- (instancetype)setTitle:(NSString *)title forState:(MJRefreshState)state
{
if (title == nil) return self;
self.stateTitles[@(state)] = title;
self.stateLabel.text = self.stateTitles[@(self.state)];
return self;
}
#pragma mark key的处理
- (void)setLastUpdatedTimeKey:(NSString *)lastUpdatedTimeKey
{
[super setLastUpdatedTimeKey:lastUpdatedTimeKey];
// 如果label隐藏了,就不用再处理
if (self.lastUpdatedTimeLabel.hidden) return;
NSDate *lastUpdatedTime = [[NSUserDefaults standardUserDefaults] objectForKey:lastUpdatedTimeKey];
// 如果有block
if (self.lastUpdatedTimeText) {
self.lastUpdatedTimeLabel.text = self.lastUpdatedTimeText(lastUpdatedTime);
return;
}
if (lastUpdatedTime) {
// 1.获得年月日
NSCalendar *calendar = [NSCalendar calendarWithIdentifier:NSCalendarIdentifierGregorian];
NSUInteger unitFlags = NSCalendarUnitYear| NSCalendarUnitMonth | NSCalendarUnitDay | NSCalendarUnitHour | NSCalendarUnitMinute;
NSDateComponents *cmp1 = [calendar components:unitFlags fromDate:lastUpdatedTime];
NSDateComponents *cmp2 = [calendar components:unitFlags fromDate:[NSDate date]];
// 2.格式化日期
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
BOOL isToday = NO;
if ([cmp1 day] == [cmp2 day]) { // 今天
formatter.dateFormat = @" HH:mm";
isToday = YES;
} else if ([cmp1 year] == [cmp2 year]) { // 今年
formatter.dateFormat = @"MM-dd HH:mm";
} else {
formatter.dateFormat = @"yyyy-MM-dd HH:mm";
}
NSString *time = [formatter stringFromDate:lastUpdatedTime];
// 3.显示日期
self.lastUpdatedTimeLabel.text = [NSString stringWithFormat:@"%@%@%@",
[NSBundle mj_localizedStringForKey:MJRefreshHeaderLastTimeText],
isToday ? [NSBundle mj_localizedStringForKey:MJRefreshHeaderDateTodayText] : @"",
time];
} else {
self.lastUpdatedTimeLabel.text = [NSString stringWithFormat:@"%@%@",
[NSBundle mj_localizedStringForKey:MJRefreshHeaderLastTimeText],
[NSBundle mj_localizedStringForKey:MJRefreshHeaderNoneLastDateText]];
}
}
- (void)textConfiguration {
// 初始化文字
[self setTitle:[NSBundle mj_localizedStringForKey:MJRefreshHeaderIdleText] forState:MJRefreshStateIdle];
[self setTitle:[NSBundle mj_localizedStringForKey:MJRefreshHeaderPullingText] forState:MJRefreshStatePulling];
[self setTitle:[NSBundle mj_localizedStringForKey:MJRefreshHeaderRefreshingText] forState:MJRefreshStateRefreshing];
self.lastUpdatedTimeKey = MJRefreshHeaderLastUpdatedTimeKey;
}
#pragma mark - 覆盖父类的方法
- (void)prepare
{
[super prepare];
// 初始化间距
self.labelLeftInset = MJRefreshLabelLeftInset;
[self textConfiguration];
}
- (void)i18nDidChange {
[self textConfiguration];
[super i18nDidChange];
}
- (void)placeSubviews
{
[super placeSubviews];
if (self.stateLabel.hidden) return;
BOOL noConstrainsOnStatusLabel = self.stateLabel.constraints.count == 0;
if (self.lastUpdatedTimeLabel.hidden) {
// 状态
if (noConstrainsOnStatusLabel) self.stateLabel.frame = self.bounds;
} else {
CGFloat stateLabelH = self.mj_h * 0.5;
// 状态
if (noConstrainsOnStatusLabel) {
self.stateLabel.mj_x = 0;
self.stateLabel.mj_y = 0;
self.stateLabel.mj_w = self.mj_w;
self.stateLabel.mj_h = stateLabelH;
}
// 更新时间
if (self.lastUpdatedTimeLabel.constraints.count == 0) {
self.lastUpdatedTimeLabel.mj_x = 0;
self.lastUpdatedTimeLabel.mj_y = stateLabelH;
self.lastUpdatedTimeLabel.mj_w = self.mj_w;
self.lastUpdatedTimeLabel.mj_h = self.mj_h - self.lastUpdatedTimeLabel.mj_y;
}
}
}
- (void)setState:(MJRefreshState)state
{
MJRefreshCheckState
// 设置状态文字
self.stateLabel.text = self.stateTitles[@(state)];
// 重新设置key(重新显示时间)
self.lastUpdatedTimeKey = self.lastUpdatedTimeKey;
}
- (NSArray *)flipsHorizontallyInOppositeLayoutDirectionViews {
return @[
self.stateLabel, self.lastUpdatedTimeLabel
];
}
@end
#pragma mark - <<< 为 Swift 扩展链式语法 >>> -
@implementation MJRefreshStateHeader (ChainingGrammar)
- (instancetype)modifyLastUpdatedTimeText:(NSString * _Nonnull (^)(NSDate * _Nullable))handler {
self.lastUpdatedTimeText = handler;
return self;
}
@end
================================================
FILE: MJRefresh/Custom/Trailer/MJRefreshNormalTrailer.h
================================================
//
// MJRefreshNormalTrailer.h
// MJRefresh
//
// Created by kinarobin on 2020/5/3.
// Copyright © 2020 小码哥. All rights reserved.
//
#if __has_include()
#import
#else
#import "MJRefreshStateTrailer.h"
#endif
NS_ASSUME_NONNULL_BEGIN
@interface MJRefreshNormalTrailer : MJRefreshStateTrailer
@property (weak, nonatomic, readonly) UIImageView *arrowView;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: MJRefresh/Custom/Trailer/MJRefreshNormalTrailer.m
================================================
//
// MJRefreshNormalTrailer.m
// MJRefresh
//
// Created by kinarobin on 2020/5/3.
// Copyright © 2020 小码哥. All rights reserved.
//
#import "MJRefreshNormalTrailer.h"
#import "NSBundle+MJRefresh.h"
#import "UIView+MJExtension.h"
@interface MJRefreshNormalTrailer() {
__unsafe_unretained UIImageView *_arrowView;
}
@end
@implementation MJRefreshNormalTrailer
#pragma mark - 懒加载子控件
- (UIImageView *)arrowView {
if (!_arrowView) {
UIImageView *arrowView = [[UIImageView alloc] initWithImage:[NSBundle mj_trailArrowImage]];
[self addSubview:_arrowView = arrowView];
}
return _arrowView;
}
- (void)placeSubviews {
[super placeSubviews];
CGSize arrowSize = self.arrowView.image.size;
// 箭头的中心点
CGPoint selfCenter = CGPointMake(self.mj_w * 0.5, self.mj_h * 0.5);
CGPoint arrowCenter = CGPointMake(arrowSize.width * 0.5 + 5, self.mj_h * 0.5);
BOOL stateHidden = self.stateLabel.isHidden;
if (self.arrowView.constraints.count == 0) {
self.arrowView.mj_size = self.arrowView.image.size;
self.arrowView.center = stateHidden ? selfCenter : arrowCenter ;
}
self.arrowView.tintColor = self.stateLabel.textColor;
if (stateHidden) return;
BOOL noConstrainsOnStatusLabel = self.stateLabel.constraints.count == 0;
CGFloat stateLabelW = ceil(self.stateLabel.font.pointSize);
// 状态
if (noConstrainsOnStatusLabel) {
BOOL arrowHidden = self.arrowView.isHidden;
CGFloat stateCenterX = (self.mj_w + arrowSize.width) * 0.5;
self.stateLabel.center = arrowHidden ? selfCenter : CGPointMake(stateCenterX, self.mj_h * 0.5);
self.stateLabel.mj_size = CGSizeMake(stateLabelW, self.mj_h) ;
}
}
- (void)setState:(MJRefreshState)state {
MJRefreshCheckState
// 根据状态做事情
if (state == MJRefreshStateIdle) {
if (oldState == MJRefreshStateRefreshing) {
[UIView animateWithDuration:self.fastAnimationDuration animations:^{
self.arrowView.transform = CGAffineTransformMakeRotation(M_PI);
} completion:^(BOOL finished) {
self.arrowView.transform = CGAffineTransformIdentity;
}];
} else {
[UIView animateWithDuration:self.fastAnimationDuration animations:^{
self.arrowView.transform = CGAffineTransformIdentity;
}];
}
} else if (state == MJRefreshStatePulling) {
[UIView animateWithDuration:self.fastAnimationDuration animations:^{
self.arrowView.transform = CGAffineTransformMakeRotation(M_PI);
}];
}
}
- (NSArray *)flipsHorizontallyInOppositeLayoutDirectionViews {
return [super.flipsHorizontallyInOppositeLayoutDirectionViews arrayByAddingObjectsFromArray:@[
self.arrowView
]];
}
@end
================================================
FILE: MJRefresh/Custom/Trailer/MJRefreshStateTrailer.h
================================================
//
// MJRefreshStateTrailer.h
// MJRefresh
//
// Created by kinarobin on 2020/5/3.
// Copyright © 2020 小码哥. All rights reserved.
//
#if __has_include()
#import
#else
#import "MJRefreshTrailer.h"
#endif
NS_ASSUME_NONNULL_BEGIN
@interface MJRefreshStateTrailer : MJRefreshTrailer
#pragma mark - 状态相关
/** 显示刷新状态的label */
@property (weak, nonatomic, readonly) UILabel *stateLabel;
/** 设置state状态下的文字 */
- (instancetype)setTitle:(NSString *)title forState:(MJRefreshState)state;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: MJRefresh/Custom/Trailer/MJRefreshStateTrailer.m
================================================
//
// MJRefreshStateTrailer.m
// MJRefresh
//
// Created by kinarobin on 2020/5/3.
// Copyright © 2020 小码哥. All rights reserved.
//
#import "MJRefreshStateTrailer.h"
#import "NSBundle+MJRefresh.h"
#import "UIView+MJExtension.h"
@interface MJRefreshStateTrailer() {
/** 显示刷新状态的label */
__unsafe_unretained UILabel *_stateLabel;
}
/** 所有状态对应的文字 */
@property (strong, nonatomic) NSMutableDictionary *stateTitles;
@end
@implementation MJRefreshStateTrailer
#pragma mark - 懒加载
- (NSMutableDictionary *)stateTitles {
if (!_stateTitles) {
self.stateTitles = [NSMutableDictionary dictionary];
}
return _stateTitles;
}
- (UILabel *)stateLabel {
if (!_stateLabel) {
UILabel *stateLabel = [UILabel mj_label];
stateLabel.numberOfLines = 0;
[self addSubview:_stateLabel = stateLabel];
}
return _stateLabel;
}
#pragma mark - 公共方法
- (instancetype)setTitle:(NSString *)title forState:(MJRefreshState)state {
if (title == nil) return self;
self.stateTitles[@(state)] = title;
self.stateLabel.text = self.stateTitles[@(self.state)];
return self;
}
- (void)textConfiguration {
// 初始化文字
[self setTitle:[NSBundle mj_localizedStringForKey:MJRefreshTrailerIdleText] forState:MJRefreshStateIdle];
[self setTitle:[NSBundle mj_localizedStringForKey:MJRefreshTrailerPullingText] forState:MJRefreshStatePulling];
[self setTitle:[NSBundle mj_localizedStringForKey:MJRefreshTrailerPullingText] forState:MJRefreshStateRefreshing];
}
#pragma mark - 覆盖父类的方法
- (void)prepare {
[super prepare];
[self textConfiguration];
}
- (void)i18nDidChange {
[self textConfiguration];
[super i18nDidChange];
}
- (void)setState:(MJRefreshState)state {
MJRefreshCheckState
// 设置状态文字
self.stateLabel.text = self.stateTitles[@(state)];
}
- (void)placeSubviews {
[super placeSubviews];
if (self.stateLabel.hidden) return;
BOOL noConstrainsOnStatusLabel = self.stateLabel.constraints.count == 0;
CGFloat stateLabelW = ceil(self.stateLabel.font.pointSize);
// 状态
if (noConstrainsOnStatusLabel) {
self.stateLabel.center = CGPointMake(self.mj_w * 0.5, self.mj_h * 0.5);
self.stateLabel.mj_size = CGSizeMake(stateLabelW, self.mj_h) ;
}
}
- (NSArray *)flipsHorizontallyInOppositeLayoutDirectionViews {
return @[
self.stateLabel
];
}
@end
================================================
FILE: MJRefresh/Info.plist
================================================
CFBundleDevelopmentRegion
$(DEVELOPMENT_LANGUAGE)
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
$(PRODUCT_NAME)
CFBundlePackageType
FMWK
CFBundleShortVersionString
1.0
CFBundleVersion
$(CURRENT_PROJECT_VERSION)
NSPrincipalClass
================================================
FILE: MJRefresh/MJRefresh.bundle/ko.lproj/Localizable.strings
================================================
"MJRefreshHeaderIdleText" = "아래로 당겨 새로고침";
"MJRefreshHeaderPullingText" = "놓으면 새로고침";
"MJRefreshHeaderRefreshingText" = "로딩중...";
"MJRefreshAutoFooterIdleText" = "탭 또는 위로 당겨 로드함";
"MJRefreshAutoFooterRefreshingText" = "로딩중...";
"MJRefreshAutoFooterNoMoreDataText" = "더이상 데이터 없음";
"MJRefreshBackFooterIdleText" = "위로 당겨 더 로드 가능";
"MJRefreshBackFooterPullingText" = "놓으면 더 로드됨.";
"MJRefreshBackFooterRefreshingText" = "로딩중...";
"MJRefreshBackFooterNoMoreDataText" = "더이상 데이터 없음";
"MJRefreshHeaderLastTimeText" = "마지막 업데이트: ";
"MJRefreshHeaderDateTodayText" = "오늘";
"MJRefreshHeaderNoneLastDateText" = "기록 없음";
================================================
FILE: MJRefresh/MJRefresh.bundle/zh-Hant.lproj/Localizable.strings
================================================
"MJRefreshHeaderIdleText" = "下拉可以刷新";
"MJRefreshHeaderPullingText" = "鬆開立即刷新";
"MJRefreshHeaderRefreshingText" = "正在刷新數據中...";
"MJRefreshTrailerIdleText" = "滑動查看圖文詳情";
"MJRefreshTrailerPullingText" = "釋放查看圖文詳情";
"MJRefreshAutoFooterIdleText" = "點擊或上拉加載更多";
"MJRefreshAutoFooterRefreshingText" = "正在加載更多的數據...";
"MJRefreshAutoFooterNoMoreDataText" = "已經全部加載完畢";
"MJRefreshBackFooterIdleText" = "上拉可以加載更多";
"MJRefreshBackFooterPullingText" = "鬆開立即加載更多";
"MJRefreshBackFooterRefreshingText" = "正在加載更多的數據...";
"MJRefreshBackFooterNoMoreDataText" = "已經全部加載完畢";
"MJRefreshHeaderLastTimeText" = "最後更新:";
"MJRefreshHeaderDateTodayText" = "今天";
"MJRefreshHeaderNoneLastDateText" = "無記錄";
================================================
FILE: MJRefresh/MJRefresh.h
================================================
// 代码地址: https://github.com/CoderMJLee/MJRefresh
#import
#if __has_include()
FOUNDATION_EXPORT double MJRefreshVersionNumber;
FOUNDATION_EXPORT const unsigned char MJRefreshVersionString[];
#import
#import
#import
#import
#import
#import
#import
#import
#import
#import
#import
#import
#import
#else
#import "UIScrollView+MJRefresh.h"
#import "UIScrollView+MJExtension.h"
#import "UIView+MJExtension.h"
#import "MJRefreshNormalHeader.h"
#import "MJRefreshGifHeader.h"
#import "MJRefreshBackNormalFooter.h"
#import "MJRefreshBackGifFooter.h"
#import "MJRefreshAutoNormalFooter.h"
#import "MJRefreshAutoGifFooter.h"
#import "MJRefreshNormalTrailer.h"
#import "MJRefreshConfig.h"
#import "NSBundle+MJRefresh.h"
#import "MJRefreshConst.h"
#endif
================================================
FILE: MJRefresh/MJRefreshConfig.h
================================================
//
// MJRefreshConfig.h
//
// Created by Frank on 2018/11/27.
// Copyright © 2018 小码哥. All rights reserved.
//
#import
NS_ASSUME_NONNULL_BEGIN
@interface MJRefreshConfig : NSObject
/** 默认使用的语言版本, 默认为 nil. 将随系统的语言自动改变 */
@property (copy, nonatomic, nullable) NSString *languageCode;
/** 默认使用的语言资源文件名, 默认为 nil, 即默认的 Localizable.strings.
- Attention: 文件名不包含后缀.strings
*/
@property (copy, nonatomic, nullable) NSString *i18nFilename;
/** i18n 多语言资源加载自定义 Bundle.
- Attention: 默认为 nil 采用内置逻辑. 这里设置后将忽略内置逻辑的多语言模式, 采用自定义的多语言 bundle
*/
@property (nonatomic, nullable) NSBundle *i18nBundle;
/** Singleton Config instance */
@property (class, nonatomic, readonly) MJRefreshConfig *defaultConfig;
- (instancetype)init NS_UNAVAILABLE;
+ (instancetype)new NS_UNAVAILABLE;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: MJRefresh/MJRefreshConfig.m
================================================
//
// MJRefreshConfig.m
//
// Created by Frank on 2018/11/27.
// Copyright © 2018 小码哥. All rights reserved.
//
#import "MJRefreshConfig.h"
#import "MJRefreshConst.h"
#import "NSBundle+MJRefresh.h"
@interface MJRefreshConfig (Bundle)
+ (void)resetLanguageResourceCache;
@end
@implementation MJRefreshConfig
static MJRefreshConfig *mj_RefreshConfig = nil;
+ (instancetype)defaultConfig {
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
mj_RefreshConfig = [[self alloc] init];
});
return mj_RefreshConfig;
}
- (void)setLanguageCode:(NSString *)languageCode {
if ([languageCode isEqualToString:_languageCode]) {
return;
}
_languageCode = languageCode;
// 重置语言资源
[MJRefreshConfig resetLanguageResourceCache];
[NSNotificationCenter.defaultCenter
postNotificationName:MJRefreshDidChangeLanguageNotification object:self];
}
@end
================================================
FILE: MJRefresh/MJRefreshConst.h
================================================
// 代码地址: https://github.com/CoderMJLee/MJRefresh
#import
#import
#import
// 弱引用
#define MJWeakSelf __weak typeof(self) weakSelf = self;
// 日志输出
#ifdef DEBUG
#define MJRefreshLog(...) NSLog(__VA_ARGS__)
#else
#define MJRefreshLog(...)
#endif
#ifndef mj_cguard
#define mj_cguard(X) if (X);
#endif
// 过期提醒
#define MJRefreshDeprecated(DESCRIPTION) __attribute__((deprecated(DESCRIPTION)))
// 运行时objc_msgSend
#define MJRefreshMsgSend(...) ((void (*)(void *, SEL, UIView *))objc_msgSend)(__VA_ARGS__)
#define MJRefreshMsgTarget(target) (__bridge void *)(target)
// RGB颜色
#define MJRefreshColor(r, g, b) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1.0]
// 文字颜色
#define MJRefreshLabelTextColor MJRefreshColor(90, 90, 90)
// 字体大小
#define MJRefreshLabelFont [UIFont boldSystemFontOfSize:14]
// 常量
UIKIT_EXTERN const CGFloat MJRefreshLabelLeftInset;
UIKIT_EXTERN const CGFloat MJRefreshHeaderHeight;
UIKIT_EXTERN const CGFloat MJRefreshFooterHeight;
UIKIT_EXTERN const CGFloat MJRefreshTrailWidth;
UIKIT_EXTERN const CGFloat MJRefreshFastAnimationDuration;
UIKIT_EXTERN const CGFloat MJRefreshSlowAnimationDuration;
UIKIT_EXTERN NSString *const MJRefreshKeyPathContentOffset;
UIKIT_EXTERN NSString *const MJRefreshKeyPathContentSize;
UIKIT_EXTERN NSString *const MJRefreshKeyPathContentInset;
UIKIT_EXTERN NSString *const MJRefreshKeyPathPanState;
UIKIT_EXTERN NSString *const MJRefreshHeaderLastUpdatedTimeKey;
UIKIT_EXTERN NSString *const MJRefreshHeaderIdleText;
UIKIT_EXTERN NSString *const MJRefreshHeaderPullingText;
UIKIT_EXTERN NSString *const MJRefreshHeaderRefreshingText;
UIKIT_EXTERN NSString *const MJRefreshTrailerIdleText;
UIKIT_EXTERN NSString *const MJRefreshTrailerPullingText;
UIKIT_EXTERN NSString *const MJRefreshAutoFooterIdleText;
UIKIT_EXTERN NSString *const MJRefreshAutoFooterRefreshingText;
UIKIT_EXTERN NSString *const MJRefreshAutoFooterNoMoreDataText;
UIKIT_EXTERN NSString *const MJRefreshBackFooterIdleText;
UIKIT_EXTERN NSString *const MJRefreshBackFooterPullingText;
UIKIT_EXTERN NSString *const MJRefreshBackFooterRefreshingText;
UIKIT_EXTERN NSString *const MJRefreshBackFooterNoMoreDataText;
UIKIT_EXTERN NSString *const MJRefreshHeaderLastTimeText;
UIKIT_EXTERN NSString *const MJRefreshHeaderDateTodayText;
UIKIT_EXTERN NSString *const MJRefreshHeaderNoneLastDateText;
UIKIT_EXTERN NSString *const MJRefreshDidChangeLanguageNotification;
// 状态检查
#define MJRefreshCheckState \
MJRefreshState oldState = self.state; \
if (state == oldState) return; \
[super setState:state];
// 异步主线程执行,不强持有Self
#define MJRefreshDispatchAsyncOnMainQueue(x) \
__weak typeof(self) weakSelf = self; \
dispatch_async(dispatch_get_main_queue(), ^{ \
typeof(weakSelf) self = weakSelf; \
{x} \
});
/// 替换方法实现
/// @param _fromClass 源类
/// @param _originSelector 源类的 Selector
/// @param _toClass 目标类
/// @param _newSelector 目标类的 Selector
CG_INLINE BOOL MJRefreshExchangeImplementations(
Class _fromClass, SEL _originSelector,
Class _toClass, SEL _newSelector) {
if (!_fromClass || !_toClass) {
return NO;
}
Method oriMethod = class_getInstanceMethod(_fromClass, _originSelector);
Method newMethod = class_getInstanceMethod(_toClass, _newSelector);
if (!newMethod) {
return NO;
}
BOOL isAddedMethod = class_addMethod(_fromClass, _originSelector,
method_getImplementation(newMethod),
method_getTypeEncoding(newMethod));
if (isAddedMethod) {
// 如果 class_addMethod 成功了,说明之前 fromClass 里并不存在 originSelector,所以要用一个空的方法代替它,以避免 class_replaceMethod 后,后续 toClass 的这个方法被调用时可能会 crash
IMP emptyIMP = imp_implementationWithBlock(^(id selfObject) {});
IMP oriMethodIMP = method_getImplementation(oriMethod) ?: emptyIMP;
const char *oriMethodTypeEncoding = method_getTypeEncoding(oriMethod) ?: "v@:";
class_replaceMethod(_toClass, _newSelector, oriMethodIMP, oriMethodTypeEncoding);
} else {
method_exchangeImplementations(oriMethod, newMethod);
}
return YES;
}
================================================
FILE: MJRefresh/MJRefreshConst.m
================================================
// 代码地址: https://github.com/CoderMJLee/MJRefresh
#import
const CGFloat MJRefreshLabelLeftInset = 25;
const CGFloat MJRefreshHeaderHeight = 54.0;
const CGFloat MJRefreshFooterHeight = 44.0;
const CGFloat MJRefreshTrailWidth = 60.0;
const CGFloat MJRefreshFastAnimationDuration = 0.25;
const CGFloat MJRefreshSlowAnimationDuration = 0.4;
NSString *const MJRefreshKeyPathContentOffset = @"contentOffset";
NSString *const MJRefreshKeyPathContentInset = @"contentInset";
NSString *const MJRefreshKeyPathContentSize = @"contentSize";
NSString *const MJRefreshKeyPathPanState = @"state";
NSString *const MJRefreshHeaderLastUpdatedTimeKey = @"MJRefreshHeaderLastUpdatedTimeKey";
NSString *const MJRefreshHeaderIdleText = @"MJRefreshHeaderIdleText";
NSString *const MJRefreshHeaderPullingText = @"MJRefreshHeaderPullingText";
NSString *const MJRefreshHeaderRefreshingText = @"MJRefreshHeaderRefreshingText";
NSString *const MJRefreshTrailerIdleText = @"MJRefreshTrailerIdleText";
NSString *const MJRefreshTrailerPullingText = @"MJRefreshTrailerPullingText";
NSString *const MJRefreshAutoFooterIdleText = @"MJRefreshAutoFooterIdleText";
NSString *const MJRefreshAutoFooterRefreshingText = @"MJRefreshAutoFooterRefreshingText";
NSString *const MJRefreshAutoFooterNoMoreDataText = @"MJRefreshAutoFooterNoMoreDataText";
NSString *const MJRefreshBackFooterIdleText = @"MJRefreshBackFooterIdleText";
NSString *const MJRefreshBackFooterPullingText = @"MJRefreshBackFooterPullingText";
NSString *const MJRefreshBackFooterRefreshingText = @"MJRefreshBackFooterRefreshingText";
NSString *const MJRefreshBackFooterNoMoreDataText = @"MJRefreshBackFooterNoMoreDataText";
NSString *const MJRefreshHeaderLastTimeText = @"MJRefreshHeaderLastTimeText";
NSString *const MJRefreshHeaderDateTodayText = @"MJRefreshHeaderDateTodayText";
NSString *const MJRefreshHeaderNoneLastDateText = @"MJRefreshHeaderNoneLastDateText";
NSString *const MJRefreshDidChangeLanguageNotification = @"MJRefreshDidChangeLanguageNotification";
================================================
FILE: MJRefresh/NSBundle+MJRefresh.h
================================================
//
// NSBundle+MJRefresh.h
// MJRefresh
//
// Created by MJ Lee on 16/6/13.
// Copyright © 2016年 小码哥. All rights reserved.
//
#import
NS_ASSUME_NONNULL_BEGIN
@interface NSBundle (MJRefresh)
+ (instancetype)mj_refreshBundle;
+ (UIImage *)mj_arrowImage;
+ (UIImage *)mj_trailArrowImage;
+ (NSString *)mj_localizedStringForKey:(NSString *)key value:(nullable NSString *)value;
+ (NSString *)mj_localizedStringForKey:(NSString *)key;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: MJRefresh/NSBundle+MJRefresh.m
================================================
//
// NSBundle+MJRefresh.m
// MJRefresh
//
// Created by MJ Lee on 16/6/13.
// Copyright © 2016年 小码哥. All rights reserved.
//
#import "NSBundle+MJRefresh.h"
#import "MJRefreshComponent.h"
#import "MJRefreshConfig.h"
static NSBundle *mj_defaultI18nBundle = nil;
static NSBundle *mj_systemI18nBundle = nil;
@implementation NSBundle (MJRefresh)
+ (instancetype)mj_refreshBundle
{
static NSBundle *refreshBundle = nil;
if (refreshBundle == nil) {
#ifdef SWIFT_PACKAGE
NSBundle *containnerBundle = SWIFTPM_MODULE_BUNDLE;
#else
NSBundle *containnerBundle = [NSBundle bundleForClass:[MJRefreshComponent class]];
#endif
refreshBundle = [NSBundle bundleWithPath:[containnerBundle pathForResource:@"MJRefresh" ofType:@"bundle"]];
}
return refreshBundle;
}
+ (UIImage *)mj_arrowImage
{
static UIImage *arrowImage = nil;
if (arrowImage == nil) {
arrowImage = [[UIImage imageWithContentsOfFile:[[self mj_refreshBundle] pathForResource:@"arrow@2x" ofType:@"png"]] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
}
return arrowImage;
}
+ (UIImage *)mj_trailArrowImage {
static UIImage *arrowImage = nil;
if (arrowImage == nil) {
arrowImage = [[UIImage imageWithContentsOfFile:[[self mj_refreshBundle] pathForResource:@"trail_arrow@2x" ofType:@"png"]] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
}
return arrowImage;
}
+ (NSString *)mj_localizedStringForKey:(NSString *)key
{
return [self mj_localizedStringForKey:key value:nil];
}
+ (NSString *)mj_localizedStringForKey:(NSString *)key value:(NSString *)value
{
NSString *table = MJRefreshConfig.defaultConfig.i18nFilename;
// 如果没有缓存, 则走初始化逻辑
if (mj_defaultI18nBundle == nil) {
NSString *language = MJRefreshConfig.defaultConfig.languageCode;
// 如果配置中没有配置语言
if (!language) {
language = [NSLocale preferredLanguages].firstObject;
}
NSBundle *bundle = MJRefreshConfig.defaultConfig.i18nBundle;
// 首先优先使用公共配置中的 i18nBundle, 如果为空则使用 mainBundle
bundle = bundle ? bundle : NSBundle.mainBundle;
// 按语言选取语言包
NSString *i18nFolderPath = [bundle pathForResource:language ofType:@"lproj"];
mj_defaultI18nBundle = [NSBundle bundleWithPath:i18nFolderPath];
// 检查语言包, 如果没有查找到, 则默认使用 mainBundle
mj_defaultI18nBundle = mj_defaultI18nBundle ? mj_defaultI18nBundle : NSBundle.mainBundle;
// 获取 MJRefresh 自有的语言包
if (mj_systemI18nBundle == nil) {
mj_systemI18nBundle = [self mj_defaultI18nBundleWithLanguage:language];
}
}
// 首先在 MJRefresh 内置语言文件中寻找
value = [mj_systemI18nBundle localizedStringForKey:key value:value table:nil];
// 然后在 MainBundle 对应语言文件中寻找
value = [mj_defaultI18nBundle localizedStringForKey:key value:value table:table];
return value;
}
+ (NSBundle *)mj_defaultI18nBundleWithLanguage:(NSString *)language {
if ([language hasPrefix:@"en"]) {
language = @"en";
} else if ([language hasPrefix:@"zh"]) {
if ([language rangeOfString:@"Hans"].location != NSNotFound) {
language = @"zh-Hans"; // 简体中文
} else { // zh-Hant\zh-HK\zh-TW
language = @"zh-Hant"; // 繁體中文
}
} else if ([language hasPrefix:@"ko"]) {
language = @"ko";
} else if ([language hasPrefix:@"ru"]) {
language = @"ru";
} else if ([language hasPrefix:@"uk"]) {
language = @"uk";
} else {
language = @"en";
}
// 从MJRefresh.bundle中查找资源
return [NSBundle bundleWithPath:[[NSBundle mj_refreshBundle] pathForResource:language ofType:@"lproj"]];
}
@end
@implementation MJRefreshConfig (Bundle)
+ (void)resetLanguageResourceCache {
mj_defaultI18nBundle = nil;
mj_systemI18nBundle = nil;
}
@end
================================================
FILE: MJRefresh/PrivacyInfo.xcprivacy
================================================
NSPrivacyTracking
NSPrivacyTrackingDomains
NSPrivacyAccessedAPITypes
NSPrivacyAccessedAPIType
NSPrivacyAccessedAPICategoryUserDefaults
NSPrivacyAccessedAPITypeReasons
CA92.1
NSPrivacyCollectedDataTypes
================================================
FILE: MJRefresh/UICollectionViewLayout+MJRefresh.h
================================================
//
// UICollectionViewLayout+MJRefresh.h
//
// 该类是用来解决 Footer 在底端加载完成后, 仍停留在原处的 bug.
// 此问题出现在 iOS 14 及以下系统上.
// Reference: https://github.com/CoderMJLee/MJRefresh/issues/1552
//
// Created by jiasong on 2021/11/15.
// Copyright © 2021 小码哥. All rights reserved.
//
#import
NS_ASSUME_NONNULL_BEGIN
@interface UICollectionViewLayout (MJRefresh)
@end
NS_ASSUME_NONNULL_END
================================================
FILE: MJRefresh/UICollectionViewLayout+MJRefresh.m
================================================
//
// UICollectionViewLayout+MJRefresh.m
//
// 该类是用来解决 Footer 在底端加载完成后, 仍停留在原处的 bug.
// 此问题出现在 iOS 14 及以下系统上.
// Reference: https://github.com/CoderMJLee/MJRefresh/issues/1552
//
// Created by jiasong on 2021/11/15.
// Copyright © 2021 小码哥. All rights reserved.
//
#import "UICollectionViewLayout+MJRefresh.h"
#import "MJRefreshConst.h"
#import "MJRefreshFooter.h"
#import "UIScrollView+MJRefresh.h"
@implementation UICollectionViewLayout (MJRefresh)
+ (void)load {
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
MJRefreshExchangeImplementations(self.class, @selector(finalizeCollectionViewUpdates),
self.class, @selector(mj_finalizeCollectionViewUpdates));
});
}
- (void)mj_finalizeCollectionViewUpdates {
[self mj_finalizeCollectionViewUpdates];
__kindof MJRefreshFooter *footer = self.collectionView.mj_footer;
CGSize newSize = self.collectionViewContentSize;
CGSize oldSize = self.collectionView.contentSize;
if (footer != nil && !CGSizeEqualToSize(newSize, oldSize)) {
NSDictionary *changed = @{
NSKeyValueChangeNewKey: [NSValue valueWithCGSize:newSize],
NSKeyValueChangeOldKey: [NSValue valueWithCGSize:oldSize],
};
[CATransaction begin];
[CATransaction setDisableActions:YES];
[footer scrollViewContentSizeDidChange:changed];
[CATransaction commit];
}
}
@end
================================================
FILE: MJRefresh/UIScrollView+MJExtension.h
================================================
// 代码地址: https://github.com/CoderMJLee/MJRefresh
// UIScrollView+Extension.h
// MJRefresh
//
// Created by MJ Lee on 14-5-28.
// Copyright (c) 2014年 小码哥. All rights reserved.
//
#import
NS_ASSUME_NONNULL_BEGIN
@interface UIScrollView (MJExtension)
@property (readonly, nonatomic) UIEdgeInsets mj_inset;
@property (assign, nonatomic) CGFloat mj_insetT;
@property (assign, nonatomic) CGFloat mj_insetB;
@property (assign, nonatomic) CGFloat mj_insetL;
@property (assign, nonatomic) CGFloat mj_insetR;
@property (assign, nonatomic) CGFloat mj_offsetX;
@property (assign, nonatomic) CGFloat mj_offsetY;
@property (assign, nonatomic) CGFloat mj_contentW;
@property (assign, nonatomic) CGFloat mj_contentH;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: MJRefresh/UIScrollView+MJExtension.m
================================================
// 代码地址: https://github.com/CoderMJLee/MJRefresh
// UIScrollView+Extension.m
// MJRefresh
//
// Created by MJ Lee on 14-5-28.
// Copyright (c) 2014年 小码哥. All rights reserved.
//
#import "UIScrollView+MJExtension.h"
#import
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunguarded-availability-new"
@implementation UIScrollView (MJExtension)
static BOOL respondsToAdjustedContentInset_;
+ (void)load
{
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
respondsToAdjustedContentInset_ = [self instancesRespondToSelector:@selector(adjustedContentInset)];
});
}
- (UIEdgeInsets)mj_inset
{
#ifdef __IPHONE_11_0
if (respondsToAdjustedContentInset_) {
return self.adjustedContentInset;
}
#endif
return self.contentInset;
}
- (void)setMj_insetT:(CGFloat)mj_insetT
{
UIEdgeInsets inset = self.contentInset;
inset.top = mj_insetT;
#ifdef __IPHONE_11_0
if (respondsToAdjustedContentInset_) {
inset.top -= (self.adjustedContentInset.top - self.contentInset.top);
}
#endif
self.contentInset = inset;
}
- (CGFloat)mj_insetT
{
return self.mj_inset.top;
}
- (void)setMj_insetB:(CGFloat)mj_insetB
{
UIEdgeInsets inset = self.contentInset;
inset.bottom = mj_insetB;
#ifdef __IPHONE_11_0
if (respondsToAdjustedContentInset_) {
inset.bottom -= (self.adjustedContentInset.bottom - self.contentInset.bottom);
}
#endif
self.contentInset = inset;
}
- (CGFloat)mj_insetB
{
return self.mj_inset.bottom;
}
- (void)setMj_insetL:(CGFloat)mj_insetL
{
UIEdgeInsets inset = self.contentInset;
inset.left = mj_insetL;
#ifdef __IPHONE_11_0
if (respondsToAdjustedContentInset_) {
inset.left -= (self.adjustedContentInset.left - self.contentInset.left);
}
#endif
self.contentInset = inset;
}
- (CGFloat)mj_insetL
{
return self.mj_inset.left;
}
- (void)setMj_insetR:(CGFloat)mj_insetR
{
UIEdgeInsets inset = self.contentInset;
inset.right = mj_insetR;
#ifdef __IPHONE_11_0
if (respondsToAdjustedContentInset_) {
inset.right -= (self.adjustedContentInset.right - self.contentInset.right);
}
#endif
self.contentInset = inset;
}
- (CGFloat)mj_insetR
{
return self.mj_inset.right;
}
- (void)setMj_offsetX:(CGFloat)mj_offsetX
{
CGPoint offset = self.contentOffset;
offset.x = mj_offsetX;
self.contentOffset = offset;
}
- (CGFloat)mj_offsetX
{
return self.contentOffset.x;
}
- (void)setMj_offsetY:(CGFloat)mj_offsetY
{
CGPoint offset = self.contentOffset;
offset.y = mj_offsetY;
self.contentOffset = offset;
}
- (CGFloat)mj_offsetY
{
return self.contentOffset.y;
}
- (void)setMj_contentW:(CGFloat)mj_contentW
{
CGSize size = self.contentSize;
size.width = mj_contentW;
self.contentSize = size;
}
- (CGFloat)mj_contentW
{
return self.contentSize.width;
}
- (void)setMj_contentH:(CGFloat)mj_contentH
{
CGSize size = self.contentSize;
size.height = mj_contentH;
self.contentSize = size;
}
- (CGFloat)mj_contentH
{
return self.contentSize.height;
}
@end
#pragma clang diagnostic pop
================================================
FILE: MJRefresh/UIScrollView+MJRefresh.h
================================================
// 代码地址: https://github.com/CoderMJLee/MJRefresh
// UIScrollView+MJRefresh.h
// MJRefresh
//
// Created by MJ Lee on 15/3/4.
// Copyright (c) 2015年 小码哥. All rights reserved.
// 给ScrollView增加下拉刷新、上拉刷新、 左滑刷新的功能
#import
#if __has_include()
#import
#else
#import "MJRefreshConst.h"
#endif
@class MJRefreshHeader, MJRefreshFooter, MJRefreshTrailer;
NS_ASSUME_NONNULL_BEGIN
@interface UIScrollView (MJRefresh)
/** 下拉刷新控件 */
@property (strong, nonatomic, nullable) MJRefreshHeader *mj_header;
@property (strong, nonatomic, nullable) MJRefreshHeader *header MJRefreshDeprecated("使用mj_header");
/** 上拉刷新控件 */
@property (strong, nonatomic, nullable) MJRefreshFooter *mj_footer;
@property (strong, nonatomic, nullable) MJRefreshFooter *footer MJRefreshDeprecated("使用mj_footer");
/** 左滑刷新控件 */
@property (strong, nonatomic, nullable) MJRefreshTrailer *mj_trailer;
#pragma mark - other
- (NSInteger)mj_totalDataCount;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: MJRefresh/UIScrollView+MJRefresh.m
================================================
// 代码地址: https://github.com/CoderMJLee/MJRefresh
// UIScrollView+MJRefresh.m
// MJRefresh
//
// Created by MJ Lee on 15/3/4.
// Copyright (c) 2015年 小码哥. All rights reserved.
//
#import "UIScrollView+MJRefresh.h"
#import "MJRefreshHeader.h"
#import "MJRefreshFooter.h"
#import "MJRefreshTrailer.h"
#import
@implementation UIScrollView (MJRefresh)
#pragma mark - header
static const char MJRefreshHeaderKey = '\0';
- (void)setMj_header:(MJRefreshHeader *)mj_header
{
if (mj_header != self.mj_header) {
// 删除旧的,添加新的
[self.mj_header removeFromSuperview];
if (mj_header) {
[self insertSubview:mj_header atIndex:0];
}
// 存储新的
objc_setAssociatedObject(self, &MJRefreshHeaderKey,
mj_header, OBJC_ASSOCIATION_RETAIN);
}
}
- (MJRefreshHeader *)mj_header
{
return objc_getAssociatedObject(self, &MJRefreshHeaderKey);
}
#pragma mark - footer
static const char MJRefreshFooterKey = '\0';
- (void)setMj_footer:(MJRefreshFooter *)mj_footer
{
if (mj_footer != self.mj_footer) {
// 删除旧的,添加新的
[self.mj_footer removeFromSuperview];
if (mj_footer) {
[self insertSubview:mj_footer atIndex:0];
}
// 存储新的
objc_setAssociatedObject(self, &MJRefreshFooterKey,
mj_footer, OBJC_ASSOCIATION_RETAIN);
}
}
- (MJRefreshFooter *)mj_footer
{
return objc_getAssociatedObject(self, &MJRefreshFooterKey);
}
#pragma mark - footer
static const char MJRefreshTrailerKey = '\0';
- (void)setMj_trailer:(MJRefreshTrailer *)mj_trailer {
if (mj_trailer != self.mj_trailer) {
// 删除旧的,添加新的
[self.mj_trailer removeFromSuperview];
if (mj_trailer) {
[self insertSubview:mj_trailer atIndex:0];
}
// 存储新的
objc_setAssociatedObject(self, &MJRefreshTrailerKey,
mj_trailer, OBJC_ASSOCIATION_RETAIN);
}
}
- (MJRefreshTrailer *)mj_trailer {
return objc_getAssociatedObject(self, &MJRefreshTrailerKey);
}
#pragma mark - 过期
- (void)setFooter:(MJRefreshFooter *)footer
{
self.mj_footer = footer;
}
- (MJRefreshFooter *)footer
{
return self.mj_footer;
}
- (void)setHeader:(MJRefreshHeader *)header
{
self.mj_header = header;
}
- (MJRefreshHeader *)header
{
return self.mj_header;
}
#pragma mark - other
- (NSInteger)mj_totalDataCount
{
NSInteger totalCount = 0;
if ([self isKindOfClass:[UITableView class]]) {
UITableView *tableView = (UITableView *)self;
for (NSInteger section = 0; section < tableView.numberOfSections; section++) {
totalCount += [tableView numberOfRowsInSection:section];
}
} else if ([self isKindOfClass:[UICollectionView class]]) {
UICollectionView *collectionView = (UICollectionView *)self;
for (NSInteger section = 0; section < collectionView.numberOfSections; section++) {
totalCount += [collectionView numberOfItemsInSection:section];
}
}
return totalCount;
}
@end
================================================
FILE: MJRefresh/UIView+MJExtension.h
================================================
// 代码地址: https://github.com/CoderMJLee/MJRefresh
// UIView+Extension.h
// MJRefresh
//
// Created by MJ Lee on 14-5-28.
// Copyright (c) 2014年 小码哥. All rights reserved.
//
#import
NS_ASSUME_NONNULL_BEGIN
@interface UIView (MJExtension)
@property (assign, nonatomic) CGFloat mj_x;
@property (assign, nonatomic) CGFloat mj_y;
@property (assign, nonatomic) CGFloat mj_w;
@property (assign, nonatomic) CGFloat mj_h;
@property (assign, nonatomic) CGSize mj_size;
@property (assign, nonatomic) CGPoint mj_origin;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: MJRefresh/UIView+MJExtension.m
================================================
// 代码地址: https://github.com/CoderMJLee/MJRefresh
// UIView+Extension.m
// MJRefresh
//
// Created by MJ Lee on 14-5-28.
// Copyright (c) 2014年 小码哥. All rights reserved.
//
#import "UIView+MJExtension.h"
@implementation UIView (MJExtension)
- (void)setMj_x:(CGFloat)mj_x
{
CGRect frame = self.frame;
frame.origin.x = mj_x;
self.frame = frame;
}
- (CGFloat)mj_x
{
return self.frame.origin.x;
}
- (void)setMj_y:(CGFloat)mj_y
{
CGRect frame = self.frame;
frame.origin.y = mj_y;
self.frame = frame;
}
- (CGFloat)mj_y
{
return self.frame.origin.y;
}
- (void)setMj_w:(CGFloat)mj_w
{
CGRect frame = self.frame;
frame.size.width = mj_w;
self.frame = frame;
}
- (CGFloat)mj_w
{
return self.frame.size.width;
}
- (void)setMj_h:(CGFloat)mj_h
{
CGRect frame = self.frame;
frame.size.height = mj_h;
self.frame = frame;
}
- (CGFloat)mj_h
{
return self.frame.size.height;
}
- (void)setMj_size:(CGSize)mj_size
{
CGRect frame = self.frame;
frame.size = mj_size;
self.frame = frame;
}
- (CGSize)mj_size
{
return self.frame.size;
}
- (void)setMj_origin:(CGPoint)mj_origin
{
CGRect frame = self.frame;
frame.origin = mj_origin;
self.frame = frame;
}
- (CGPoint)mj_origin
{
return self.frame.origin;
}
@end
================================================
FILE: MJRefresh.podspec
================================================
Pod::Spec.new do |s|
s.name = 'MJRefresh'
s.version = '3.7.9'
s.summary = 'An easy way to use pull-to-refresh'
s.homepage = 'https://github.com/CoderMJLee/MJRefresh'
s.license = 'MIT'
s.authors = {'MJ Lee' => 'richermj123go@vip.qq.com'}
s.platform = :ios, '12.0'
s.source = {:git => 'https://github.com/CoderMJLee/MJRefresh.git', :tag => s.version}
s.source_files = 'MJRefresh/**/*.{h,m}'
s.exclude_files = 'MJRefresh/include/**'
s.resource = 'MJRefresh/MJRefresh.bundle'
s.resource_bundles = { 'MJRefresh.Privacy' => 'MJRefresh/PrivacyInfo.xcprivacy' }
s.requires_arc = true
end
================================================
FILE: MJRefresh.xcodeproj/project.pbxproj
================================================
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objects = {
/* Begin PBXBuildFile section */
012254B62BA14874007BD496 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 012254B32BA144D6007BD496 /* PrivacyInfo.xcprivacy */; };
013B0687269D6D9A00943978 /* MJRefreshNormalTrailer.m in Sources */ = {isa = PBXBuildFile; fileRef = 88E3200F24839B2300069FA7 /* MJRefreshNormalTrailer.m */; };
013B0688269D6D9D00943978 /* MJRefreshTrailer.m in Sources */ = {isa = PBXBuildFile; fileRef = 88E3200924839ABA00069FA7 /* MJRefreshTrailer.m */; };
013B0689269D6DA100943978 /* MJRefreshStateTrailer.m in Sources */ = {isa = PBXBuildFile; fileRef = 88E3200E24839B2300069FA7 /* MJRefreshStateTrailer.m */; };
013B068A269D6DF800943978 /* MJRefreshConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = 01A2CE0A21ACE01500BEE365 /* MJRefreshConfig.h */; settings = {ATTRIBUTES = (Public, ); }; };
2D9DF45A1F7CE2C20042D6DD /* MJRefreshAutoFooter.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DB2E9EC1BECBE6700D58F6A /* MJRefreshAutoFooter.h */; settings = {ATTRIBUTES = (Public, ); }; };
2D9DF45B1F7CE2C20042D6DD /* MJRefreshBackFooter.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DB2E9EE1BECBE6700D58F6A /* MJRefreshBackFooter.h */; settings = {ATTRIBUTES = (Public, ); }; };
2D9DF45C1F7CE2C20042D6DD /* MJRefreshComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DB2E9F01BECBE6700D58F6A /* MJRefreshComponent.h */; settings = {ATTRIBUTES = (Public, ); }; };
2D9DF45D1F7CE2C20042D6DD /* MJRefreshFooter.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DB2E9F21BECBE6700D58F6A /* MJRefreshFooter.h */; settings = {ATTRIBUTES = (Public, ); }; };
2D9DF45E1F7CE2C20042D6DD /* MJRefreshHeader.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DB2E9F41BECBE6700D58F6A /* MJRefreshHeader.h */; settings = {ATTRIBUTES = (Public, ); }; };
2D9DF45F1F7CE2C20042D6DD /* MJRefreshAutoGifFooter.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DB2E9F91BECBE6700D58F6A /* MJRefreshAutoGifFooter.h */; settings = {ATTRIBUTES = (Public, ); }; };
2D9DF4601F7CE2C20042D6DD /* MJRefreshAutoNormalFooter.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DB2E9FB1BECBE6700D58F6A /* MJRefreshAutoNormalFooter.h */; settings = {ATTRIBUTES = (Public, ); }; };
2D9DF4611F7CE2C20042D6DD /* MJRefreshAutoStateFooter.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DB2E9FD1BECBE6700D58F6A /* MJRefreshAutoStateFooter.h */; settings = {ATTRIBUTES = (Public, ); }; };
2D9DF4621F7CE2C20042D6DD /* MJRefreshBackGifFooter.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DB2EA001BECBE6700D58F6A /* MJRefreshBackGifFooter.h */; settings = {ATTRIBUTES = (Public, ); }; };
2D9DF4631F7CE2C20042D6DD /* MJRefreshBackNormalFooter.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DB2EA021BECBE6700D58F6A /* MJRefreshBackNormalFooter.h */; settings = {ATTRIBUTES = (Public, ); }; };
2D9DF4641F7CE2C20042D6DD /* MJRefreshBackStateFooter.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DB2EA041BECBE6700D58F6A /* MJRefreshBackStateFooter.h */; settings = {ATTRIBUTES = (Public, ); }; };
2D9DF4651F7CE2C20042D6DD /* MJRefreshGifHeader.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DB2EA071BECBE6700D58F6A /* MJRefreshGifHeader.h */; settings = {ATTRIBUTES = (Public, ); }; };
2D9DF4661F7CE2C20042D6DD /* MJRefreshNormalHeader.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DB2EA091BECBE6700D58F6A /* MJRefreshNormalHeader.h */; settings = {ATTRIBUTES = (Public, ); }; };
2D9DF4671F7CE2C20042D6DD /* MJRefreshStateHeader.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DB2EA0B1BECBE6700D58F6A /* MJRefreshStateHeader.h */; settings = {ATTRIBUTES = (Public, ); }; };
2D9DF4681F7CE2C20042D6DD /* MJRefresh.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DB2EA0E1BECBE6700D58F6A /* MJRefresh.h */; settings = {ATTRIBUTES = (Public, ); }; };
2D9DF4691F7CE2C20042D6DD /* MJRefreshConst.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DB2EA0F1BECBE6700D58F6A /* MJRefreshConst.h */; settings = {ATTRIBUTES = (Public, ); }; };
2D9DF46A1F7CE2C20042D6DD /* UIScrollView+MJExtension.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DB2EA111BECBE6700D58F6A /* UIScrollView+MJExtension.h */; settings = {ATTRIBUTES = (Public, ); }; };
2D9DF46B1F7CE2C20042D6DD /* UIScrollView+MJRefresh.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DB2EA131BECBE6700D58F6A /* UIScrollView+MJRefresh.h */; settings = {ATTRIBUTES = (Public, ); }; };
2D9DF46C1F7CE2C20042D6DD /* UIView+MJExtension.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DB2EA151BECBE6700D58F6A /* UIView+MJExtension.h */; settings = {ATTRIBUTES = (Public, ); }; };
2D9DF46D1F7CE2C20042D6DD /* NSBundle+MJRefresh.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D4698841D0EE6A400CB8025 /* NSBundle+MJRefresh.h */; settings = {ATTRIBUTES = (Public, ); }; };
2D9DF46E1F7CE2D60042D6DD /* MJRefresh.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 2DB2EA0D1BECBE6700D58F6A /* MJRefresh.bundle */; };
2D9DF46F1F7CE2F90042D6DD /* MJRefreshAutoFooter.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DB2E9ED1BECBE6700D58F6A /* MJRefreshAutoFooter.m */; };
2D9DF4701F7CE2F90042D6DD /* MJRefreshBackFooter.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DB2E9EF1BECBE6700D58F6A /* MJRefreshBackFooter.m */; };
2D9DF4711F7CE2F90042D6DD /* MJRefreshComponent.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DB2E9F11BECBE6700D58F6A /* MJRefreshComponent.m */; };
2D9DF4721F7CE2F90042D6DD /* MJRefreshFooter.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DB2E9F31BECBE6700D58F6A /* MJRefreshFooter.m */; };
2D9DF4731F7CE2F90042D6DD /* MJRefreshHeader.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DB2E9F51BECBE6700D58F6A /* MJRefreshHeader.m */; };
2D9DF4741F7CE2F90042D6DD /* MJRefreshAutoGifFooter.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DB2E9FA1BECBE6700D58F6A /* MJRefreshAutoGifFooter.m */; };
2D9DF4751F7CE2F90042D6DD /* MJRefreshAutoNormalFooter.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DB2E9FC1BECBE6700D58F6A /* MJRefreshAutoNormalFooter.m */; };
2D9DF4761F7CE2F90042D6DD /* MJRefreshAutoStateFooter.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DB2E9FE1BECBE6700D58F6A /* MJRefreshAutoStateFooter.m */; };
2D9DF4771F7CE2F90042D6DD /* MJRefreshBackGifFooter.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DB2EA011BECBE6700D58F6A /* MJRefreshBackGifFooter.m */; };
2D9DF4781F7CE2F90042D6DD /* MJRefreshBackNormalFooter.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DB2EA031BECBE6700D58F6A /* MJRefreshBackNormalFooter.m */; };
2D9DF4791F7CE2F90042D6DD /* MJRefreshBackStateFooter.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DB2EA051BECBE6700D58F6A /* MJRefreshBackStateFooter.m */; };
2D9DF47A1F7CE2F90042D6DD /* MJRefreshGifHeader.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DB2EA081BECBE6700D58F6A /* MJRefreshGifHeader.m */; };
2D9DF47B1F7CE2F90042D6DD /* MJRefreshNormalHeader.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DB2EA0A1BECBE6700D58F6A /* MJRefreshNormalHeader.m */; };
2D9DF47C1F7CE2F90042D6DD /* MJRefreshStateHeader.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DB2EA0C1BECBE6700D58F6A /* MJRefreshStateHeader.m */; };
2D9DF47D1F7CE2F90042D6DD /* MJRefreshConst.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DB2EA101BECBE6700D58F6A /* MJRefreshConst.m */; };
2D9DF47E1F7CE2F90042D6DD /* UIScrollView+MJExtension.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DB2EA121BECBE6700D58F6A /* UIScrollView+MJExtension.m */; settings = {COMPILER_FLAGS = "-Wno-unguarded-availability-new"; }; };
2D9DF47F1F7CE2F90042D6DD /* UIScrollView+MJRefresh.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DB2EA141BECBE6700D58F6A /* UIScrollView+MJRefresh.m */; };
2D9DF4801F7CE2F90042D6DD /* UIView+MJExtension.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DB2EA161BECBE6700D58F6A /* UIView+MJExtension.m */; };
2D9DF4811F7CE2F90042D6DD /* NSBundle+MJRefresh.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D4698851D0EE6A400CB8025 /* NSBundle+MJRefresh.m */; };
7A698CD2274232A00028A4DD /* UICollectionViewLayout+MJRefresh.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A698CD0274232A00028A4DD /* UICollectionViewLayout+MJRefresh.h */; };
7A698CD5274232A00028A4DD /* UICollectionViewLayout+MJRefresh.m in Sources */ = {isa = PBXBuildFile; fileRef = 7A698CD1274232A00028A4DD /* UICollectionViewLayout+MJRefresh.m */; };
84FC857E228037CE001C6728 /* MJRefreshConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = 01A2CE0B21ACE01500BEE365 /* MJRefreshConfig.m */; };
D32060E124F89B8B00EF3333 /* MJRefreshTrailer.h in Headers */ = {isa = PBXBuildFile; fileRef = 88E3200A24839ABA00069FA7 /* MJRefreshTrailer.h */; settings = {ATTRIBUTES = (Public, ); }; };
D32060E224F89B9200EF3333 /* MJRefreshNormalTrailer.h in Headers */ = {isa = PBXBuildFile; fileRef = 88E3200D24839B2300069FA7 /* MJRefreshNormalTrailer.h */; settings = {ATTRIBUTES = (Public, ); }; };
D32060E324F89B9D00EF3333 /* MJRefreshStateTrailer.h in Headers */ = {isa = PBXBuildFile; fileRef = 88E3201024839B2300069FA7 /* MJRefreshStateTrailer.h */; settings = {ATTRIBUTES = (Public, ); }; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
012254B32BA144D6007BD496 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = ""; };
01A2CE0A21ACE01500BEE365 /* MJRefreshConfig.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MJRefreshConfig.h; sourceTree = ""; };
01A2CE0B21ACE01500BEE365 /* MJRefreshConfig.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MJRefreshConfig.m; sourceTree = ""; };
2D4698841D0EE6A400CB8025 /* NSBundle+MJRefresh.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSBundle+MJRefresh.h"; sourceTree = ""; };
2D4698851D0EE6A400CB8025 /* NSBundle+MJRefresh.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSBundle+MJRefresh.m"; sourceTree = ""; };
2D9DF4521F7CE29B0042D6DD /* MJRefresh.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = MJRefresh.framework; sourceTree = BUILT_PRODUCTS_DIR; };
2D9DF4551F7CE29B0042D6DD /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
2DB2E9EC1BECBE6700D58F6A /* MJRefreshAutoFooter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MJRefreshAutoFooter.h; sourceTree = ""; };
2DB2E9ED1BECBE6700D58F6A /* MJRefreshAutoFooter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MJRefreshAutoFooter.m; sourceTree = ""; };
2DB2E9EE1BECBE6700D58F6A /* MJRefreshBackFooter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MJRefreshBackFooter.h; sourceTree = ""; };
2DB2E9EF1BECBE6700D58F6A /* MJRefreshBackFooter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MJRefreshBackFooter.m; sourceTree = ""; };
2DB2E9F01BECBE6700D58F6A /* MJRefreshComponent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MJRefreshComponent.h; sourceTree = ""; };
2DB2E9F11BECBE6700D58F6A /* MJRefreshComponent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MJRefreshComponent.m; sourceTree = ""; };
2DB2E9F21BECBE6700D58F6A /* MJRefreshFooter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MJRefreshFooter.h; sourceTree = ""; };
2DB2E9F31BECBE6700D58F6A /* MJRefreshFooter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MJRefreshFooter.m; sourceTree = ""; };
2DB2E9F41BECBE6700D58F6A /* MJRefreshHeader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MJRefreshHeader.h; sourceTree = ""; };
2DB2E9F51BECBE6700D58F6A /* MJRefreshHeader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MJRefreshHeader.m; sourceTree = ""; };
2DB2E9F91BECBE6700D58F6A /* MJRefreshAutoGifFooter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MJRefreshAutoGifFooter.h; sourceTree = ""; };
2DB2E9FA1BECBE6700D58F6A /* MJRefreshAutoGifFooter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MJRefreshAutoGifFooter.m; sourceTree = ""; };
2DB2E9FB1BECBE6700D58F6A /* MJRefreshAutoNormalFooter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MJRefreshAutoNormalFooter.h; sourceTree = ""; };
2DB2E9FC1BECBE6700D58F6A /* MJRefreshAutoNormalFooter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MJRefreshAutoNormalFooter.m; sourceTree = ""; };
2DB2E9FD1BECBE6700D58F6A /* MJRefreshAutoStateFooter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MJRefreshAutoStateFooter.h; sourceTree = ""; };
2DB2E9FE1BECBE6700D58F6A /* MJRefreshAutoStateFooter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MJRefreshAutoStateFooter.m; sourceTree = ""; };
2DB2EA001BECBE6700D58F6A /* MJRefreshBackGifFooter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MJRefreshBackGifFooter.h; sourceTree = ""; };
2DB2EA011BECBE6700D58F6A /* MJRefreshBackGifFooter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MJRefreshBackGifFooter.m; sourceTree = ""; };
2DB2EA021BECBE6700D58F6A /* MJRefreshBackNormalFooter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MJRefreshBackNormalFooter.h; sourceTree = ""; };
2DB2EA031BECBE6700D58F6A /* MJRefreshBackNormalFooter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MJRefreshBackNormalFooter.m; sourceTree = ""; };
2DB2EA041BECBE6700D58F6A /* MJRefreshBackStateFooter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MJRefreshBackStateFooter.h; sourceTree = ""; };
2DB2EA051BECBE6700D58F6A /* MJRefreshBackStateFooter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MJRefreshBackStateFooter.m; sourceTree = ""; };
2DB2EA071BECBE6700D58F6A /* MJRefreshGifHeader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MJRefreshGifHeader.h; sourceTree = ""; };
2DB2EA081BECBE6700D58F6A /* MJRefreshGifHeader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MJRefreshGifHeader.m; sourceTree = ""; };
2DB2EA091BECBE6700D58F6A /* MJRefreshNormalHeader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MJRefreshNormalHeader.h; sourceTree = ""; };
2DB2EA0A1BECBE6700D58F6A /* MJRefreshNormalHeader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MJRefreshNormalHeader.m; sourceTree = ""; };
2DB2EA0B1BECBE6700D58F6A /* MJRefreshStateHeader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MJRefreshStateHeader.h; sourceTree = ""; };
2DB2EA0C1BECBE6700D58F6A /* MJRefreshStateHeader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MJRefreshStateHeader.m; sourceTree = ""; };
2DB2EA0D1BECBE6700D58F6A /* MJRefresh.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = MJRefresh.bundle; sourceTree = ""; };
2DB2EA0E1BECBE6700D58F6A /* MJRefresh.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MJRefresh.h; sourceTree = ""; };
2DB2EA0F1BECBE6700D58F6A /* MJRefreshConst.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MJRefreshConst.h; sourceTree = ""; };
2DB2EA101BECBE6700D58F6A /* MJRefreshConst.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MJRefreshConst.m; sourceTree = ""; };
2DB2EA111BECBE6700D58F6A /* UIScrollView+MJExtension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIScrollView+MJExtension.h"; sourceTree = ""; };
2DB2EA121BECBE6700D58F6A /* UIScrollView+MJExtension.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIScrollView+MJExtension.m"; sourceTree = ""; };
2DB2EA131BECBE6700D58F6A /* UIScrollView+MJRefresh.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIScrollView+MJRefresh.h"; sourceTree = ""; };
2DB2EA141BECBE6700D58F6A /* UIScrollView+MJRefresh.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIScrollView+MJRefresh.m"; sourceTree = ""; };
2DB2EA151BECBE6700D58F6A /* UIView+MJExtension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+MJExtension.h"; sourceTree = ""; };
2DB2EA161BECBE6700D58F6A /* UIView+MJExtension.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+MJExtension.m"; sourceTree = ""; };
7A698CD0274232A00028A4DD /* UICollectionViewLayout+MJRefresh.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UICollectionViewLayout+MJRefresh.h"; sourceTree = ""; };
7A698CD1274232A00028A4DD /* UICollectionViewLayout+MJRefresh.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UICollectionViewLayout+MJRefresh.m"; sourceTree = ""; };
88E3200924839ABA00069FA7 /* MJRefreshTrailer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MJRefreshTrailer.m; sourceTree = ""; };
88E3200A24839ABA00069FA7 /* MJRefreshTrailer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MJRefreshTrailer.h; sourceTree = ""; };
88E3200D24839B2300069FA7 /* MJRefreshNormalTrailer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MJRefreshNormalTrailer.h; sourceTree = ""; };
88E3200E24839B2300069FA7 /* MJRefreshStateTrailer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MJRefreshStateTrailer.m; sourceTree = ""; };
88E3200F24839B2300069FA7 /* MJRefreshNormalTrailer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MJRefreshNormalTrailer.m; sourceTree = ""; };
88E3201024839B2300069FA7 /* MJRefreshStateTrailer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MJRefreshStateTrailer.h; sourceTree = ""; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
2D9DF44E1F7CE29B0042D6DD /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
2DA7F91C1AA6B4C4005627AB = {
isa = PBXGroup;
children = (
2DB2E9EA1BECBE6700D58F6A /* MJRefresh */,
2DA7F9261AA6B4C4005627AB /* Products */,
);
sourceTree = "";
};
2DA7F9261AA6B4C4005627AB /* Products */ = {
isa = PBXGroup;
children = (
2D9DF4521F7CE29B0042D6DD /* MJRefresh.framework */,
);
name = Products;
sourceTree = "";
};
2DB2E9EA1BECBE6700D58F6A /* MJRefresh */ = {
isa = PBXGroup;
children = (
2DB2E9EB1BECBE6700D58F6A /* Base */,
2DB2E9F61BECBE6700D58F6A /* Custom */,
2DB2EA0D1BECBE6700D58F6A /* MJRefresh.bundle */,
2DB2EA0E1BECBE6700D58F6A /* MJRefresh.h */,
01A2CE0A21ACE01500BEE365 /* MJRefreshConfig.h */,
01A2CE0B21ACE01500BEE365 /* MJRefreshConfig.m */,
2DB2EA0F1BECBE6700D58F6A /* MJRefreshConst.h */,
2DB2EA101BECBE6700D58F6A /* MJRefreshConst.m */,
2D4698841D0EE6A400CB8025 /* NSBundle+MJRefresh.h */,
2D4698851D0EE6A400CB8025 /* NSBundle+MJRefresh.m */,
7A698CD0274232A00028A4DD /* UICollectionViewLayout+MJRefresh.h */,
7A698CD1274232A00028A4DD /* UICollectionViewLayout+MJRefresh.m */,
2DB2EA111BECBE6700D58F6A /* UIScrollView+MJExtension.h */,
2DB2EA121BECBE6700D58F6A /* UIScrollView+MJExtension.m */,
2DB2EA131BECBE6700D58F6A /* UIScrollView+MJRefresh.h */,
2DB2EA141BECBE6700D58F6A /* UIScrollView+MJRefresh.m */,
2DB2EA151BECBE6700D58F6A /* UIView+MJExtension.h */,
2DB2EA161BECBE6700D58F6A /* UIView+MJExtension.m */,
2D9DF4551F7CE29B0042D6DD /* Info.plist */,
012254B32BA144D6007BD496 /* PrivacyInfo.xcprivacy */,
);
path = MJRefresh;
sourceTree = SOURCE_ROOT;
};
2DB2E9EB1BECBE6700D58F6A /* Base */ = {
isa = PBXGroup;
children = (
2DB2E9EC1BECBE6700D58F6A /* MJRefreshAutoFooter.h */,
2DB2E9ED1BECBE6700D58F6A /* MJRefreshAutoFooter.m */,
2DB2E9EE1BECBE6700D58F6A /* MJRefreshBackFooter.h */,
2DB2E9EF1BECBE6700D58F6A /* MJRefreshBackFooter.m */,
2DB2E9F01BECBE6700D58F6A /* MJRefreshComponent.h */,
2DB2E9F11BECBE6700D58F6A /* MJRefreshComponent.m */,
2DB2E9F21BECBE6700D58F6A /* MJRefreshFooter.h */,
2DB2E9F31BECBE6700D58F6A /* MJRefreshFooter.m */,
2DB2E9F41BECBE6700D58F6A /* MJRefreshHeader.h */,
2DB2E9F51BECBE6700D58F6A /* MJRefreshHeader.m */,
88E3200A24839ABA00069FA7 /* MJRefreshTrailer.h */,
88E3200924839ABA00069FA7 /* MJRefreshTrailer.m */,
);
path = Base;
sourceTree = "";
};
2DB2E9F61BECBE6700D58F6A /* Custom */ = {
isa = PBXGroup;
children = (
88E3200C24839B2300069FA7 /* Trailer */,
2DB2E9F71BECBE6700D58F6A /* Footer */,
2DB2EA061BECBE6700D58F6A /* Header */,
);
path = Custom;
sourceTree = "";
};
2DB2E9F71BECBE6700D58F6A /* Footer */ = {
isa = PBXGroup;
children = (
2DB2E9F81BECBE6700D58F6A /* Auto */,
2DB2E9FF1BECBE6700D58F6A /* Back */,
);
path = Footer;
sourceTree = "";
};
2DB2E9F81BECBE6700D58F6A /* Auto */ = {
isa = PBXGroup;
children = (
2DB2E9F91BECBE6700D58F6A /* MJRefreshAutoGifFooter.h */,
2DB2E9FA1BECBE6700D58F6A /* MJRefreshAutoGifFooter.m */,
2DB2E9FB1BECBE6700D58F6A /* MJRefreshAutoNormalFooter.h */,
2DB2E9FC1BECBE6700D58F6A /* MJRefreshAutoNormalFooter.m */,
2DB2E9FD1BECBE6700D58F6A /* MJRefreshAutoStateFooter.h */,
2DB2E9FE1BECBE6700D58F6A /* MJRefreshAutoStateFooter.m */,
);
path = Auto;
sourceTree = "";
};
2DB2E9FF1BECBE6700D58F6A /* Back */ = {
isa = PBXGroup;
children = (
2DB2EA001BECBE6700D58F6A /* MJRefreshBackGifFooter.h */,
2DB2EA011BECBE6700D58F6A /* MJRefreshBackGifFooter.m */,
2DB2EA021BECBE6700D58F6A /* MJRefreshBackNormalFooter.h */,
2DB2EA031BECBE6700D58F6A /* MJRefreshBackNormalFooter.m */,
2DB2EA041BECBE6700D58F6A /* MJRefreshBackStateFooter.h */,
2DB2EA051BECBE6700D58F6A /* MJRefreshBackStateFooter.m */,
);
path = Back;
sourceTree = "";
};
2DB2EA061BECBE6700D58F6A /* Header */ = {
isa = PBXGroup;
children = (
2DB2EA071BECBE6700D58F6A /* MJRefreshGifHeader.h */,
2DB2EA081BECBE6700D58F6A /* MJRefreshGifHeader.m */,
2DB2EA091BECBE6700D58F6A /* MJRefreshNormalHeader.h */,
2DB2EA0A1BECBE6700D58F6A /* MJRefreshNormalHeader.m */,
2DB2EA0B1BECBE6700D58F6A /* MJRefreshStateHeader.h */,
2DB2EA0C1BECBE6700D58F6A /* MJRefreshStateHeader.m */,
);
path = Header;
sourceTree = "";
};
88E3200C24839B2300069FA7 /* Trailer */ = {
isa = PBXGroup;
children = (
88E3200D24839B2300069FA7 /* MJRefreshNormalTrailer.h */,
88E3200F24839B2300069FA7 /* MJRefreshNormalTrailer.m */,
88E3201024839B2300069FA7 /* MJRefreshStateTrailer.h */,
88E3200E24839B2300069FA7 /* MJRefreshStateTrailer.m */,
);
path = Trailer;
sourceTree = "";
};
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
2D9DF44F1F7CE29B0042D6DD /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
013B068A269D6DF800943978 /* MJRefreshConfig.h in Headers */,
2D9DF45A1F7CE2C20042D6DD /* MJRefreshAutoFooter.h in Headers */,
2D9DF45B1F7CE2C20042D6DD /* MJRefreshBackFooter.h in Headers */,
2D9DF45C1F7CE2C20042D6DD /* MJRefreshComponent.h in Headers */,
2D9DF45D1F7CE2C20042D6DD /* MJRefreshFooter.h in Headers */,
2D9DF45E1F7CE2C20042D6DD /* MJRefreshHeader.h in Headers */,
D32060E324F89B9D00EF3333 /* MJRefreshStateTrailer.h in Headers */,
D32060E224F89B9200EF3333 /* MJRefreshNormalTrailer.h in Headers */,
D32060E124F89B8B00EF3333 /* MJRefreshTrailer.h in Headers */,
2D9DF45F1F7CE2C20042D6DD /* MJRefreshAutoGifFooter.h in Headers */,
2D9DF4601F7CE2C20042D6DD /* MJRefreshAutoNormalFooter.h in Headers */,
2D9DF4611F7CE2C20042D6DD /* MJRefreshAutoStateFooter.h in Headers */,
2D9DF4621F7CE2C20042D6DD /* MJRefreshBackGifFooter.h in Headers */,
2D9DF4631F7CE2C20042D6DD /* MJRefreshBackNormalFooter.h in Headers */,
2D9DF4641F7CE2C20042D6DD /* MJRefreshBackStateFooter.h in Headers */,
2D9DF4651F7CE2C20042D6DD /* MJRefreshGifHeader.h in Headers */,
2D9DF4661F7CE2C20042D6DD /* MJRefreshNormalHeader.h in Headers */,
2D9DF4671F7CE2C20042D6DD /* MJRefreshStateHeader.h in Headers */,
2D9DF4681F7CE2C20042D6DD /* MJRefresh.h in Headers */,
2D9DF4691F7CE2C20042D6DD /* MJRefreshConst.h in Headers */,
2D9DF46A1F7CE2C20042D6DD /* UIScrollView+MJExtension.h in Headers */,
7A698CD2274232A00028A4DD /* UICollectionViewLayout+MJRefresh.h in Headers */,
2D9DF46B1F7CE2C20042D6DD /* UIScrollView+MJRefresh.h in Headers */,
2D9DF46C1F7CE2C20042D6DD /* UIView+MJExtension.h in Headers */,
2D9DF46D1F7CE2C20042D6DD /* NSBundle+MJRefresh.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXHeadersBuildPhase section */
/* Begin PBXNativeTarget section */
2D9DF4511F7CE29B0042D6DD /* MJRefresh */ = {
isa = PBXNativeTarget;
buildConfigurationList = 2D9DF4571F7CE29B0042D6DD /* Build configuration list for PBXNativeTarget "MJRefresh" */;
buildPhases = (
2D9DF44D1F7CE29B0042D6DD /* Sources */,
2D9DF44E1F7CE29B0042D6DD /* Frameworks */,
2D9DF44F1F7CE29B0042D6DD /* Headers */,
2D9DF4501F7CE29B0042D6DD /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = MJRefresh;
productName = MJRefreshFramework;
productReference = 2D9DF4521F7CE29B0042D6DD /* MJRefresh.framework */;
productType = "com.apple.product-type.framework";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
2DA7F91D1AA6B4C4005627AB /* Project object */ = {
isa = PBXProject;
attributes = {
CLASSPREFIX = MJ;
LastUpgradeCheck = 1220;
ORGANIZATIONNAME = "小码哥";
TargetAttributes = {
2D9DF4511F7CE29B0042D6DD = {
CreatedOnToolsVersion = 9.0;
ProvisioningStyle = Automatic;
};
};
};
buildConfigurationList = 2DA7F9201AA6B4C4005627AB /* Build configuration list for PBXProject "MJRefresh" */;
compatibilityVersion = "Xcode 9.3";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
"zh-Hans",
"zh-Hant",
ru,
uk,
ko,
);
mainGroup = 2DA7F91C1AA6B4C4005627AB;
productRefGroup = 2DA7F9261AA6B4C4005627AB /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
2D9DF4511F7CE29B0042D6DD /* MJRefresh */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
2D9DF4501F7CE29B0042D6DD /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
012254B62BA14874007BD496 /* PrivacyInfo.xcprivacy in Resources */,
2D9DF46E1F7CE2D60042D6DD /* MJRefresh.bundle in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
2D9DF44D1F7CE29B0042D6DD /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
013B0689269D6DA100943978 /* MJRefreshStateTrailer.m in Sources */,
013B0688269D6D9D00943978 /* MJRefreshTrailer.m in Sources */,
013B0687269D6D9A00943978 /* MJRefreshNormalTrailer.m in Sources */,
84FC857E228037CE001C6728 /* MJRefreshConfig.m in Sources */,
2D9DF46F1F7CE2F90042D6DD /* MJRefreshAutoFooter.m in Sources */,
2D9DF4701F7CE2F90042D6DD /* MJRefreshBackFooter.m in Sources */,
7A698CD5274232A00028A4DD /* UICollectionViewLayout+MJRefresh.m in Sources */,
2D9DF4711F7CE2F90042D6DD /* MJRefreshComponent.m in Sources */,
2D9DF4721F7CE2F90042D6DD /* MJRefreshFooter.m in Sources */,
2D9DF4731F7CE2F90042D6DD /* MJRefreshHeader.m in Sources */,
2D9DF4741F7CE2F90042D6DD /* MJRefreshAutoGifFooter.m in Sources */,
2D9DF4751F7CE2F90042D6DD /* MJRefreshAutoNormalFooter.m in Sources */,
2D9DF4761F7CE2F90042D6DD /* MJRefreshAutoStateFooter.m in Sources */,
2D9DF4771F7CE2F90042D6DD /* MJRefreshBackGifFooter.m in Sources */,
2D9DF4781F7CE2F90042D6DD /* MJRefreshBackNormalFooter.m in Sources */,
2D9DF4791F7CE2F90042D6DD /* MJRefreshBackStateFooter.m in Sources */,
2D9DF47A1F7CE2F90042D6DD /* MJRefreshGifHeader.m in Sources */,
2D9DF47B1F7CE2F90042D6DD /* MJRefreshNormalHeader.m in Sources */,
2D9DF47C1F7CE2F90042D6DD /* MJRefreshStateHeader.m in Sources */,
2D9DF47D1F7CE2F90042D6DD /* MJRefreshConst.m in Sources */,
2D9DF47E1F7CE2F90042D6DD /* UIScrollView+MJExtension.m in Sources */,
2D9DF47F1F7CE2F90042D6DD /* UIScrollView+MJRefresh.m in Sources */,
2D9DF4801F7CE2F90042D6DD /* UIView+MJExtension.m in Sources */,
2D9DF4811F7CE2F90042D6DD /* NSBundle+MJRefresh.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
2D9DF4581F7CE29B0042D6DD /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_IDENTITY = "";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = dwarf;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = MJRefresh/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.520it.MJRefreshFramework;
PRODUCT_MODULE_NAME = MJRefresh;
PRODUCT_NAME = MJRefresh;
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Debug;
};
2D9DF4591F7CE29B0042D6DD /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_IDENTITY = "";
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = MJRefresh/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.520it.MJRefreshFramework;
PRODUCT_MODULE_NAME = MJRefresh;
PRODUCT_NAME = MJRefresh;
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Release;
};
2DA7F9461AA6B4C4005627AB /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
2DA7F9471AA6B4C4005627AB /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
2D9DF4571F7CE29B0042D6DD /* Build configuration list for PBXNativeTarget "MJRefresh" */ = {
isa = XCConfigurationList;
buildConfigurations = (
2D9DF4581F7CE29B0042D6DD /* Debug */,
2D9DF4591F7CE29B0042D6DD /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
2DA7F9201AA6B4C4005627AB /* Build configuration list for PBXProject "MJRefresh" */ = {
isa = XCConfigurationList;
buildConfigurations = (
2DA7F9461AA6B4C4005627AB /* Debug */,
2DA7F9471AA6B4C4005627AB /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 2DA7F91D1AA6B4C4005627AB /* Project object */;
}
================================================
FILE: MJRefresh.xcodeproj/xcshareddata/xcschemes/MJRefresh.xcscheme
================================================