## 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
没有合适的资源?快使用搜索试试~ 我知道了~
Swift5.2 enum(枚举)
共753个文件
swift:346个
h:36个
m:34个
需积分: 0 0 下载量 25 浏览量
2022-04-13
10:48:44
上传
评论
收藏 1.4MB ZIP 举报
温馨提示
Swift5.2 enum(枚举)
资源详情
资源评论
资源推荐
收起资源包目录
Swift5.2 enum(枚举) (753个子文件)
029c0592b300be23daefc6f59c7c7713d800a2 217B
03f257ed59c9abb4b39e314b17b476bf69e996 584B
053700aa4427bd521f69f5fb6d5520e68d97f1 3KB
069828bf8ca575af1582d675467adeb350606b 1KB
077818a0c1704eda7a12086f18a426a3b84005 2KB
07e54342c4081bca1608e9f88da0d00c98a86a 390B
0a412319eb2e5445dde04c56e4dc21b12fdf05 991B
0c0dee554a40e1bd6f9038b0f8ec38a89cfeba 276B
0f790c42966139ab470b17276278e3e218dd8b 376B
10dccd0e523df32f0c4464ed1999ffd856fa29 1KB
11acc36c0bf001cce0a40aef6512bd119abb5d 386B
1226d302fdbe9a000be45b464571cff06bdd7b 848B
12742c5833fad47e40302cab944153608b9abe 801B
15ad1b175ec81507daad2063f8a1883de82458 979B
166b57c1dbc91da0c706ce44c00f5dc383dfd7 1KB
1693ac6164fc4dd6ccbfe667faa5a43d8861fe 645B
1978c5c99b47c641a2cb12c0b169508f59d2ae 447B
19af38622707138574a34d64061262b837d6e8 810B
1a9fa1979aef25fc8060cf70e7d706dcf4f982 493B
1b609ea6096001dec420149315c7784e9257bf 798B
1d931c18e9bd141e15d2d559ffe1fe891d214a 421B
1e6c5e33711f598bf1928a275d3c0b50b446f9 716B
1f88c0224e5c83e1b7c0e41e56793ec4e3ebe8 577B
21b9bb1a35f5de270a41afa01305478221ae32 253B
2247dcb107ab2331d1a1caf2eec24aaf7eb6af 450B
224a9f54f47c32de3e9b6dce611f3f139867b1 764B
22f36d857d3fa02d76eef3041816a69d18730b 2KB
263bb29348106a4415be920d0342b9017ea2cf 1KB
26542aa95e1fc65d523d0f87fe7e5ff0831cdd 1KB
2bc09d54ba69fd7de9e024b719e5f66ca48de8 1KB
2cb5d6d09fe5019d2f930632eaa15b4e51aedc 104B
2d1ff516f586d3150721b2bcce06f346130740 1KB
2e06d52a7e558252c015876973881ee4486bc6 3KB
2e144e5d7753991d51d4eacb2ed825bfc46f29 702B
2ea0728bc2b70abaa38eff3a7d79e22dbab300 924B
2ef784dafbbdd53006722e6e884abdb8cba396 1KB
30c0e141bfa74e68b7e00da738a9c4e15808dc 1KB
3103a99049089c9d78a0815dafac342aedf120 374B
310c96e8516622a304492fd6523268974b1f42 817B
3257a7d00cc51c19d02d81f119c077049b2d74 249B
33964a80c920e87324712c87cadeac99f48399 384B
33b73c5a1fb27caf775f25e13a32297327ab9c 2KB
34d74266a9d1bad7c78bbcece905533ed271ee 294B
353acf084d86e9a644ac0c134414f14c1c748a 1KB
35fb7eb09b18ba24d95a090e433b86ffd5582e 921B
367d7336e4e3f02d29422b88b2deb96b5254a7 397B
368d3841c9da08248d125e8a1dae396182a0a2 389B
386387f266d1ccf6459cb4400cbeed9e600bd3 58B
38995ff6c363affb7161c8f955516db985a158 1KB
3933ecf6ae96bb4f6bff9d3ee28cc24434d248 1KB
399023836b2c6019f780a768f5f0bcae3c9f28 1KB
3ab5088a98615a2021a71175565ff570eefaa6 316B
3b1e52eaadd97d0f64f0dcb4fcdc1f3f4075f1 754B
3b75afe68f99409db7df8606d8fca964f881ef 2KB
3bcc84264e092ba7091be25caed8c383bacf7f 261B
3c9afdae35805086796848ae7dfa52ec858a07 367B
3cc9b8ba4e4ae5c6df5ed5e3f199668b7fead0 68B
3dfc31090e88d3d0720ae1dda41d6a51e360a0 412B
3f1e2182529aa82fff4f9715320f1063d1b650 708B
403f87eb7387c4efabd1f4c53e30cb778c502a 648B
409bf685cb43e27efde9357a8fde7c86fe7081 601B
415c61be43adefdf6cbaecda80704b7196fc72 3KB
4186914fe1496695ca09ed563451e8239e9493 571B
41ed0e35e448dfbe89789b5d77e27468b854dd 226B
4374f323ed267db1783c8e7c58a904225d5fc9 420B
449e2065ce4179b4b27512ecb924c1c47570d5 1KB
47b577a4a1d7b35a26ef1ce96e2ebc0b45f317 1KB
48ca845aec2adb542c46f76525012feb733e8e 131B
4bb7efd0c007d9488b0e1f8d3314003658afd9 2KB
4c1e31d72224be4c4ee49c309e03406a442a3f 3KB
4c5622c7c0db864845b3158c42e9edf537ef42 607B
4c8e1d43840c8821f9f71f4b59754f0d25acef 3KB
4db72c687c9deb4f1c09bfd4cc412836d04430 63B
4e0a468f3c897162a76db45d330fb7ad2cd565 1KB
50cb365f6068620ef58b828cd6a76de8e08d05 1KB
513db8b0661d3af6bd9731237af94c5cda3fe8 868B
54c5621bea7ff7df75c439be1e1295c7d397bc 4KB
57327a139feda145ee94e172466e7cf44a302b 611B
5af8f1cf10fb035ce5dab776d4a45ae0f17ec6 5KB
5b1d829a756371de967c6d9646142b449d65b5 2KB
5b930b6d1abfa4373024c0c62b9d9907b65b3f 313B
5d96f27a72d01086938709e8430f6a8b52aee4 550B
5d9d8f03572ac51988665ba65662c062cb7fff 383B
5e9329f3767a7c1dd66294b8025bf81dee7d2c 781B
60e91d72966c4106c1d3194144338098b743e6 266B
6201c9eff9290b86ae2ae0603214ea46b3e0b2 1KB
629e7bf8e5a4e3a4310a05090cff7b7a08ca24 751B
62fa9aa5fe1e24bff7b11f3018944f5b86ee19 709B
63751a314ee50a66fe2f2a6aa95d790d681681 6KB
64641b8eeb5151ef06008300056896dd22fafa 810B
64a68eb1d9e30a51e5d396a8021eea0eb94b38 386B
66ec15935c4ee906abb01e32269749fd8d3ad7 67B
676b1f2a949e0d6dde30db2e9a7252b4331a88 3KB
6bd324c26d854187559f27f8194c8afd1795ac 58B
6bd35147cf27848bb311c5d73e07da1e5a57a4 1KB
6c964bce4b7ff5f68b2c9d2d70bcf3987bc027 1KB
6e3008740ff35298b9c012f036dba281a169fa 3KB
6e92ae0ee3ea5905eb17cb7d8e45eb3624d5ec 2KB
6ed0d964999f99e0bed92ee276077e63f3dbc0 1KB
70c54217c2bdcaa756d8a1b5b41c8b62622c3a 385B
共 753 条
- 1
- 2
- 3
- 4
- 5
- 6
- 8
冯汉栩
- 粉丝: 279
- 资源: 482
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0