## MJRefresh
[![SPM supported](https://img.shields.io/badge/SPM-supported-4BC51D.svg?style=flat)](https://github.com/apple/swift-package-manager)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
[![podversion](https://img.shields.io/cocoapods/v/MJRefresh.svg)](https://cocoapods.org/pods/MJRefresh)
* An easy way to use pull-to-refresh
[ðâð»**Release Notes**: more details](https://github.com/CoderMJLee/MJRefresh/releases)
## Contents
- New Features
- [Dynamic i18n Switching](#dynamic_i18n_switching)
- [SPM Supported](#spm_supported)
- [Swift Chaining Grammar Supported](#swift_chaining_grammar_supported)
* Getting Started
* [FeaturesãSupport what kinds of controls to refreshã](#Support_what_kinds_of_controls_to_refresh)
* [InstallationãHow to use MJRefreshã](#How_to_use_MJRefresh)
* [Who's usingãMore than hundreds of Apps are using MJRefreshã](#More_than_hundreds_of_Apps_are_using_MJRefresh)
* [ClassesãThe Class Structure Chart of MJRefreshã](#The_Class_Structure_Chart_of_MJRefresh)
* Comment API
* [MJRefreshComponent.h](#MJRefreshComponent.h)
* [MJRefreshHeader.h](#MJRefreshHeader.h)
* [MJRefreshFooter.h](#MJRefreshFooter.h)
* [MJRefreshAutoFooter.h](#MJRefreshAutoFooter.h)
* [MJRefreshTrailer.h](#MJRefreshTrailer.h)
* Examples
* [Reference](#Reference)
* [The drop-down refresh 01-Default](#The_drop-down_refresh_01-Default)
* [The drop-down refresh 02-Animation image](#The_drop-down_refresh_02-Animation_image)
* [The drop-down refresh 03-Hide the time](#The_drop-down_refresh_03-Hide_the_time)
* [The drop-down refresh 04-Hide status and time](#The_drop-down_refresh_04-Hide_status_and_time)
* [The drop-down refresh 05-DIY title](#The_drop-down_refresh_05-DIY_title)
* [The drop-down refresh 06-DIY the control of refresh](#The_drop-down_refresh_06-DIY_the_control_of_refresh)
* [The pull to refresh 01-Default](#The_pull_to_refresh_01-Default)
* [The pull to refresh 02-Animation image](#The_pull_to_refresh_02-Animation_image)
* [The pull to refresh 03-Hide the title of refresh status](#The_pull_to_refresh_03-Hide_the_title_of_refresh_status)
* [The pull to refresh 04-All loaded](#The_pull_to_refresh_04-All_loaded)
* [The pull to refresh 05-DIY title](#The_pull_to_refresh_05-DIY_title)
* [The pull to refresh 06-Hidden After loaded](#The_pull_to_refresh_06-Hidden_After_loaded)
* [The pull to refresh 07-Automatic back of the pull01](#The_pull_to_refresh_07-Automatic_back_of_the_pull01)
* [The pull to refresh 08-Automatic back of the pull02](#The_pull_to_refresh_08-Automatic_back_of_the_pull02)
* [The pull to refresh 09-DIY the control of refresh(Automatic refresh)](#The_pull_to_refresh_09-DIY_the_control_of_refresh(Automatic_refresh))
* [The pull to refresh 10-DIY the control of refresh(Automatic back)](#The_pull_to_refresh_10-DIY_the_control_of_refresh(Automatic_back))
* [UICollectionView01-The pull and drop-down refresh](#UICollectionView01-The_pull_and_drop-down_refresh)
* [UICollectionView02-The trailer refresh](#UICollectionView02-The_trailer_refresh)
* [WKWebView01-The drop-down refresh](#WKWebView01-The_drop-down_refresh)
* [Hope](#Hope)
## New Features
### <a id="dynamic_i18n_switching"></a>Dynamic i18n Switching
Now `MJRefresh components` will be rerendered automatically with `MJRefreshConfig.default.language` setting.
#### Example
Go `i18n` folder and see lots of cases. Simulator example is behind `i18n tab` in right-top corner.
#### Setting language
```swift
MJRefreshConfig.default.language = "zh-hans"
```
#### Setting i18n file name
```swift
MJRefreshConfig.default.i18nFilename = "i18n File Name(not include type<.strings>)"
```
#### Setting i18n language bundle
```swift
MJRefreshConfig.default.i18nBundle = <i18n Bundle>
```
#### Adopting the feature in your DIY component
1. Just override `i18nDidChange` function and reset texts.
```swift
// must use this localization methods
Bundle.mj_localizedString(forKey: "")
// or
Bundle.mj_localizedString(forKey: "", value:"")
override func i18nDidChange() {
// Reset texts function
setupTexts()
// Make sure to call super after resetting texts. It will call placeSubViews for applying new layout.
super.i18nDidChange()
}
```
2. Receiving `MJRefreshDidChangeLanguageNotification` notification.
### <a id="spm_supported"></a>SPM Supported
Released from [`3.7.1`](https://github.com/CoderMJLee/MJRefresh/releases/tag/3.7.1)
### <a id="swift_chaining_grammar_supported"></a>Swift Chaining Grammar Supported
```swift
// Example as MJRefreshNormalHeader
func addRefreshHeader() {
MJRefreshNormalHeader { [weak self] in
// load some data
}.autoChangeTransparency(true)
.link(to: tableView)
}
```
## <a id="Support_what_kinds_of_controls_to_refresh"></a>Support what kinds of controls to refresh
* `UIScrollView`ã`UITableView`ã`UICollectionView`ã`WKWebView`
## <a id="How_to_use_MJRefresh"></a>How to use MJRefresh
* Installation with CocoaPodsï¼`pod 'MJRefresh'`
* Installation with [Carthage](https://github.com/Carthage/Carthage)ï¼`github "CoderMJLee/MJRefresh"`
* Manual importï¼
* Drag All files in the `MJRefresh` folder to project
* Import the main fileï¼`#import "MJRefresh.h"`
```objc
Base Custom
MJRefresh.bundle MJRefresh.h
MJRefreshConst.h MJRefreshConst.m
UIScrollView+MJExtension.h UIScrollView+MJExtension.m
UIScrollView+MJRefresh.h UIScrollView+MJRefresh.m
UIView+MJExtension.h UIView+MJExtension.m
```
## <a id="More_than_hundreds_of_Apps_are_using_MJRefresh"></a>More than hundreds of Apps are using MJRefresh
<img src="http://images0.cnblogs.com/blog2015/497279/201506/141212365041650.png" width="200" height="300">
* More information of App can focus onï¼[Mäºä¸ªJ-å客å](http://www.cnblogs.com/mjios/p/4409853.html)
## <a id="The_Class_Structure_Chart_of_MJRefresh"></a>The Class Structure Chart of MJRefresh
![](http://images0.cnblogs.com/blog2015/497279/201506/132232456139177.png)
- `The class of red text` in the chartï¼You can use them directly
- The drop-down refresh control types
- Normalï¼`MJRefreshNormalHeader`
- Gifï¼`MJRefreshGifHeader`
- The pull to refresh control types
- Auto refresh
- Normalï¼`MJRefreshAutoNormalFooter`
- Gifï¼`MJRefreshAutoGifFooter`
- Auto Back
- Normalï¼`MJRefreshBackNormalFooter`
- Gifï¼`MJRefreshBackGifFooter`
- `The class of non-red text` in the chartï¼For inheritanceï¼to use DIY the control of refresh
- About how to DIY the control of refreshï¼You can refer the Class in below Chart<br>
<img src="http://images0.cnblogs.com/blog2015/497279/201506/141358159107893.png" width="30%" height="30%">
## <a id="MJRefreshComponent.h"></a>MJRefreshComponent.h
```objc
/** The Base Class of refresh control */
@interface MJRefreshComponent : UIView
#pragma mark - Control the state of Refresh
/** BeginRefreshing */
- (void)beginRefreshing;
/** EndRefreshing */
- (void)endRefreshing;
/** IsRefreshing */
- (BOOL)isRefreshing;
#pragma mark - Other
/** According to the drag ratio to change alpha automatically */
@property (assign, nonatomic, getter=isAutomaticallyChangeAlpha) BOOL automaticallyChangeAlpha;
@end
```
## <a id="MJRefreshHeader.h"></a>MJRefreshHeader.h
```objc
@interface MJRefreshHeader : MJRefreshComponent
/** Creat header */
+ (instancetype)headerWithRefreshingBlock:(MJRefreshComponentRefreshingBlock)refreshingBlock;
/** Creat header */
+ (instancetype)headerWithRefreshingTarget:(id)target refreshingAction:(SEL)action;
/** This key is used to storage the time that the last time of drown-down successfully */
@property (copy, nonatomic) NSString *lastUpdatedTimeKey;
/** The last time of drown-down successfully */
@propert
没有合适的资源?快使用搜索试试~ 我知道了~
Swift-MJRefresh(下载底部无温馨提示)
共260个文件
swift:75个
h:29个
m:28个
需积分: 1 0 下载量 139 浏览量
2022-12-24
21:50:51
上传
评论
收藏 620KB ZIP 举报
温馨提示
Swift-MJRefresh(下载底部无温馨提示)
资源推荐
资源详情
资源评论
收起资源包目录
Swift-MJRefresh(下载底部无温馨提示) (260个子文件)
0d615a2412ef68bd21674af036c55ca3c995a6 153B
1034ed0068a031a9daee8cf768b8598ca4cf14 118B
1047b274d558f0c9d992bf2a26be3e15307941 128B
21b9bb1a35f5de270a41afa01305478221ae32 253B
3257a7d00cc51c19d02d81f119c077049b2d74 249B
386387f266d1ccf6459cb4400cbeed9e600bd3 58B
48899375d6a3bf9eca4112a34d8017bc14ae5a 131B
508329cd48242241b8583a2a4135be19a7975a 114B
5c1c4280c2bd849cc7cb98bdb954becd44ca2b 3KB
5d69dba1c41e974f99ba962e0236ff89fb53e7 39KB
5e9329f3767a7c1dd66294b8025bf81dee7d2c 781B
5ea707fa02e101d7fecd628c06ba0e38b66fa5 122B
6176cde812298a59677ebd9e6ef4d9fb9ca33a 205B
67aeb311a2232d32af22ad381071d64e5f461e 590B
6a08c2cd55f1ac178618ccc8f84bd0f0ef1476 364B
6bd324c26d854187559f27f8194c8afd1795ac 58B
714c4a9ec0ddb7f4a80179602c953e671cb66b 96B
7e4ad8ae9fa2e71b0e74acae6c4057768a2b9a 116B
7f5ff3a1a2932866150e68950c3f5d36bd4cdd 119B
82b52fc1cea66f055b851dea6f5821a8917282 246B
8789700816459c1e1480e0b34781d9fb78a1ca 105B
9119b32a564e275f53120c942ecf9d75214b53 86B
9434a6254f0e9651f402737811be6634a03e9c 117B
9535d1d1dd3247bcfaad90dac9200d3c88b77b 140B
9a4208174846971cd5a193fa79346f355073f8 97B
9d18d9afdbb632b5baf450c966f30d5e78e0c0 140B
9df098625f128382071ae9707970fe8a086464 95B
a553e4c7ed3909688918c0f869e3e996856513 151B
a763858ecdbea5c897a9fd8fa2225d7223d2ad 749B
aef374682ca7f5b16e51a953b3915d5da036a5 123B
c00596a7fca3f3d4bdd64053b69d86745f9e10 66B
c19cc17a1d6452956495c8f392c3673f08a9eb 69B
c9689ca62229261e28684ae4839760a1527665 119B
COMMIT_EDITMSG 15B
config 137B
d77164ac2ea427d660410256d5d496e9483515 941B
d9b549124695030f9e377446e547f3fd5dc079 243B
de8039d81dd49f7e3e32fd426e90ca691c03a0 193B
description 73B
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
ee8f9f49389ba58d22df8e18589600866a8a16 366B
exclude 40B
f8b4583a1af3a53d55ec726a5ed0edbd699601 97B
fe85f8d6cb2c951756d0271aa3fc0ca4cca1b5 124B
MJRefreshComponent.h 6KB
MJRefreshConst.h 4KB
MJRefreshFooter.h 1KB
MJRefresh.h 1KB
MJRefreshHeader.h 1KB
MJRefreshStateHeader.h 1KB
MJRefreshAutoFooter.h 1KB
MJRefresh-umbrella.h 1KB
UIScrollView+MJRefresh.h 1KB
MJRefreshConfig.h 1KB
MJRefreshAutoStateFooter.h 828B
MJRefreshBackStateFooter.h 789B
UIScrollView+MJExtension.h 772B
MJRefreshBackNormalFooter.h 748B
MJRefreshBackGifFooter.h 737B
MJRefreshAutoGifFooter.h 737B
MJRefreshNormalHeader.h 725B
MJRefreshTrailer.h 722B
MJRefreshGifHeader.h 713B
MJRefreshAutoNormalFooter.h 687B
MJRefreshStateTrailer.h 617B
UIView+MJExtension.h 574B
NSBundle+MJRefresh.h 490B
UICollectionViewLayout+MJRefresh.h 474B
MJRefreshNormalTrailer.h 467B
MJRefreshBackFooter.h 374B
Pods-SwiftDemol-umbrella.h 322B
Alamofire-umbrella.h 310B
SnapKit-umbrella.h 306B
HEAD 162B
HEAD 21B
index 2KB
example.jpg 43KB
Contents.json 2KB
Contents.json 305B
Contents.json 123B
Contents.json 63B
LICENSE 1KB
LICENSE 1KB
LICENSE 1KB
Manifest.lock 449B
Podfile.lock 449B
MJRefreshHeader.m 12KB
MJRefreshComponent.m 9KB
MJRefreshAutoFooter.m 6KB
MJRefreshTrailer.m 6KB
MJRefreshStateHeader.m 6KB
MJRefreshBackFooter.m 6KB
MJRefreshNormalHeader.m 4KB
NSBundle+MJRefresh.m 4KB
MJRefreshBackNormalFooter.m 4KB
MJRefreshGifHeader.m 4KB
MJRefreshBackGifFooter.m 4KB
共 260 条
- 1
- 2
- 3
资源评论
冯汉栩
- 粉丝: 284
- 资源: 491
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功