2
0
Эх сурвалжийг харах

Add some Chaining grammar (#1499)

* Add some Chaining grammar
Frank 4 жил өмнө
parent
commit
d48313b40d

+ 18 - 0
MJRefresh/Base/MJRefreshComponent.h

@@ -113,5 +113,23 @@ typedef void (^MJRefreshComponentAction)(void);
 - (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)assignTo:(UIScrollView *)scrollView;
+
+@end
 
 NS_ASSUME_NONNULL_END

+ 27 - 0
MJRefresh/Base/MJRefreshComponent.m

@@ -275,3 +275,30 @@ - (CGFloat)mj_textWidth {
     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)assignTo:(UIScrollView *)scrollView {
+    return self;
+}
+
+@end

+ 7 - 0
MJRefresh/Base/MJRefreshFooter.m

@@ -40,6 +40,13 @@ - (void)prepare
 //    self.automaticallyHidden = NO;
 }
 
+#pragma mark . 链式语法部分 .
+
+- (instancetype)assignTo:(UIScrollView *)scrollView {
+    scrollView.mj_footer = self;
+    return self;
+}
+
 #pragma mark - 公共方法
 - (void)endRefreshingWithNoMoreData
 {

+ 7 - 0
MJRefresh/Base/MJRefreshHeader.m

@@ -242,6 +242,13 @@ - (void)headerRefreshingAction {
     }
 }
 
+#pragma mark . 链式语法部分 .
+
+- (instancetype)assignTo:(UIScrollView *)scrollView {
+    scrollView.mj_header = self;
+    return self;
+}
+
 #pragma mark - CAAnimationDelegate
 - (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag {
     NSString *identity = [anim valueForKey:@"identity"];

+ 8 - 1
MJRefresh/Base/MJRefreshTrailer.m

@@ -150,7 +150,14 @@ - (void)willMoveToSuperview:(UIView *)newSuperview {
     }
 }
 
-#pragma mark 刚好看到上拉刷新控件时的contentOffset.x
+#pragma mark . 链式语法部分 .
+
+- (instancetype)assignTo:(UIScrollView *)scrollView {
+    scrollView.mj_trailer = self;
+    return self;
+}
+
+#pragma mark - 刚好看到上拉刷新控件时的contentOffset.x
 - (CGFloat)happenOffsetX {
     CGFloat deltaW = [self widthForContentBreakView];
     if (deltaW > 0) {

+ 24 - 6
MJRefreshExample.xcodeproj/project.pbxproj

@@ -8,7 +8,7 @@
 
 /* Begin PBXBuildFile section */
 		01A2CE0C21ACE01500BEE365 /* MJRefreshConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = 01A2CE0B21ACE01500BEE365 /* MJRefreshConfig.m */; };
-		01EB8272236846CE00813DAA /* MJWKWebViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 01EB8271236846CE00813DAA /* MJWKWebViewController.m */; };
+		01A5EB2B25EF62B80091554E /* MJWKWebViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01A5EB2A25EF62B80091554E /* MJWKWebViewController.swift */; };
 		2D4698861D0EE6A400CB8025 /* NSBundle+MJRefresh.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D4698851D0EE6A400CB8025 /* NSBundle+MJRefresh.m */; };
 		2D9BEB091BB15F4A00AED473 /* UIViewController+Example.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D9BEAE01BB15F4A00AED473 /* UIViewController+Example.m */; };
 		2D9BEB0A1BB15F4A00AED473 /* MJChiBaoZiFooter.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D9BEAE31BB15F4A00AED473 /* MJChiBaoZiFooter.m */; };
@@ -130,8 +130,8 @@
 /* Begin PBXFileReference section */
 		01A2CE0A21ACE01500BEE365 /* MJRefreshConfig.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MJRefreshConfig.h; sourceTree = "<group>"; };
 		01A2CE0B21ACE01500BEE365 /* MJRefreshConfig.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MJRefreshConfig.m; sourceTree = "<group>"; };
-		01EB8270236846CE00813DAA /* MJWKWebViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MJWKWebViewController.h; sourceTree = "<group>"; };
-		01EB8271236846CE00813DAA /* MJWKWebViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MJWKWebViewController.m; sourceTree = "<group>"; };
+		01A5EB2925EF62B80091554E /* MJRefreshExample-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "MJRefreshExample-Bridging-Header.h"; sourceTree = "<group>"; };
+		01A5EB2A25EF62B80091554E /* MJWKWebViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MJWKWebViewController.swift; sourceTree = "<group>"; };
 		2D4698841D0EE6A400CB8025 /* NSBundle+MJRefresh.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSBundle+MJRefresh.h"; sourceTree = "<group>"; };
 		2D4698851D0EE6A400CB8025 /* NSBundle+MJRefresh.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSBundle+MJRefresh.m"; sourceTree = "<group>"; };
 		2D9BEADF1BB15F4A00AED473 /* UIViewController+Example.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIViewController+Example.h"; sourceTree = "<group>"; };
@@ -257,6 +257,15 @@
 /* End PBXFrameworksBuildPhase section */
 
 /* Begin PBXGroup section */
+		01A5EB2825EF62930091554E /* SwiftExample */ = {
+			isa = PBXGroup;
+			children = (
+				01A5EB2A25EF62B80091554E /* MJWKWebViewController.swift */,
+				01A5EB2925EF62B80091554E /* MJRefreshExample-Bridging-Header.h */,
+			);
+			path = SwiftExample;
+			sourceTree = "<group>";
+		};
 		2D9BEADE1BB15F4A00AED473 /* Category */ = {
 			isa = PBXGroup;
 			children = (
@@ -328,8 +337,6 @@
 				2D9BEB061BB15F4A00AED473 /* MJWebViewViewController.h */,
 				2D9BEB071BB15F4A00AED473 /* MJWebViewViewController.m */,
 				2D9BEB081BB15F4A00AED473 /* MJWebViewViewController.xib */,
-				01EB8270236846CE00813DAA /* MJWKWebViewController.h */,
-				01EB8271236846CE00813DAA /* MJWKWebViewController.m */,
 			);
 			path = Second;
 			sourceTree = "<group>";
@@ -410,6 +417,7 @@
 				2D9BEAE11BB15F4A00AED473 /* DIY */,
 				2D9BEAEE1BB15F4A00AED473 /* First */,
 				2D9BEAFE1BB15F4A00AED473 /* Second */,
+				01A5EB2825EF62930091554E /* SwiftExample */,
 			);
 			path = Classes;
 			sourceTree = "<group>";
@@ -631,6 +639,7 @@
 					};
 					2DA7F9241AA6B4C4005627AB = {
 						CreatedOnToolsVersion = 6.1;
+						LastSwiftMigration = 1220;
 					};
 					2DA7F93D1AA6B4C4005627AB = {
 						CreatedOnToolsVersion = 6.1;
@@ -744,6 +753,7 @@
 				2D9BEB1B1BB15F4A00AED473 /* MJWebViewViewController.m in Sources */,
 				2DB2EA171BECBE6700D58F6A /* MJRefreshAutoFooter.m in Sources */,
 				2D9BEB101BB15F4A00AED473 /* MJExample.m in Sources */,
+				01A5EB2B25EF62B80091554E /* MJWKWebViewController.swift in Sources */,
 				2DB2EA201BECBE6700D58F6A /* MJRefreshBackNormalFooter.m in Sources */,
 				2DA7F92B1AA6B4C4005627AB /* main.m in Sources */,
 				2DB2EA1E1BECBE6700D58F6A /* MJRefreshAutoStateFooter.m in Sources */,
@@ -757,7 +767,6 @@
 				2D9BEB0C1BB15F4A00AED473 /* MJChiBaoZiHeader.m in Sources */,
 				88E3201224839B2300069FA7 /* MJRefreshNormalTrailer.m in Sources */,
 				2DB2EA1B1BECBE6700D58F6A /* MJRefreshHeader.m in Sources */,
-				01EB8272236846CE00813DAA /* MJWKWebViewController.m in Sources */,
 				2D9BEB191BB15F4A00AED473 /* MJTestViewController.m in Sources */,
 				2DB2EA211BECBE6700D58F6A /* MJRefreshBackStateFooter.m in Sources */,
 				2DB2EA281BECBE6700D58F6A /* UIScrollView+MJRefresh.m in Sources */,
@@ -1000,6 +1009,7 @@
 			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;
@@ -1010,6 +1020,9 @@
 				);
 				PRODUCT_BUNDLE_IDENTIFIER = com.mj.MJRefresh;
 				PRODUCT_NAME = "$(TARGET_NAME)";
+				SWIFT_OBJC_BRIDGING_HEADER = "MJRefreshExample/Classes/SwiftExample/MJRefreshExample-Bridging-Header.h";
+				SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+				SWIFT_VERSION = 5.0;
 			};
 			name = Debug;
 		};
@@ -1017,6 +1030,7 @@
 			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;
@@ -1027,12 +1041,15 @@
 				);
 				PRODUCT_BUNDLE_IDENTIFIER = com.mj.MJRefresh;
 				PRODUCT_NAME = "$(TARGET_NAME)";
+				SWIFT_OBJC_BRIDGING_HEADER = "MJRefreshExample/Classes/SwiftExample/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",
@@ -1057,6 +1074,7 @@
 		2DA7F94D1AA6B4C4005627AB /* Release */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
+				ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
 				BUNDLE_LOADER = "$(TEST_HOST)";
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(SDKROOT)/System/Library/Frameworks",

+ 1 - 1
MJRefreshExample/Classes/First/MJExampleViewController.m

@@ -13,8 +13,8 @@
 #import "MJExample.h"
 #import "UIViewController+Example.h"
 #import "MJRefresh.h"
-#import "MJWKWebViewController.h"
 #import "MJHorizontalCollectionViewController.h"
+#import "MJRefreshExample-Swift.h"
 
 static NSString *const MJExample00 = @"UITableView + 下拉刷新";
 static NSString *const MJExample10 = @"UITableView + 上拉刷新";

+ 0 - 17
MJRefreshExample/Classes/Second/MJWKWebViewController.h

@@ -1,17 +0,0 @@
-//
-//  MJWKWebViewController.h
-//  MJRefreshExample
-//
-//  Created by Frank on 2019/10/29.
-//  Copyright © 2019 小码哥. All rights reserved.
-//
-
-#import <UIKit/UIKit.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-@interface MJWKWebViewController : UIViewController
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 105
MJRefreshExample/Classes/Second/MJWKWebViewController.m

@@ -1,105 +0,0 @@
-//
-//  MJWKWebViewController.m
-//  MJRefreshExample
-//
-//  Created by Frank on 2019/10/29.
-//  Copyright © 2019 小码哥. All rights reserved.
-//
-
-#import "MJWKWebViewController.h"
-#import "UIViewController+Example.h"
-#import "MJChiBaoZiHeader.h"
-#import "MJRefresh.h"
-
-@import WebKit;
-
-@interface MJWKWebViewController ()<WKNavigationDelegate>
-@property (strong, nonatomic) WKWebView *webView;
-
-@end
-
-@implementation MJWKWebViewController
-
-#pragma mark - 示例
-- (void)example41 {
-    __weak WKWebView *webView = self.webView;
-    webView.navigationDelegate = self;
-    
-    __weak UIScrollView *scrollView = self.webView.scrollView;
-    
-    // 添加下拉刷新控件
-    scrollView.mj_header= [MJChiBaoZiHeader headerWithRefreshingBlock:^{
-        [webView reload];
-    }];
-    
-    // 如果是上拉刷新,就以此类推
-    [scrollView.mj_header beginRefreshing];
-}
-
-#pragma mark - webViewDelegate
-- (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation {
-    [self.webView.scrollView.mj_header endRefreshing];
-}
-
-#pragma mark - 其他
-- (void)viewDidLoad {
-    [super viewDidLoad];
-    
-    self.webView = [[WKWebView alloc] initWithFrame:self.view.frame];
-    self.webView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
-    [self.view addSubview:self.webView];
-    
-    CGSize size = self.view.frame.size;
-    
-    UILabel *warningLabel = [[UILabel alloc] initWithFrame:CGRectMake(size.width - 210, size.height - 120, 200, 50)];
-    warningLabel.text = @"注意,这不是原生界面,是个网页:http://weibo.com/excepptions";
-    warningLabel.adjustsFontSizeToFitWidth = YES;
-    warningLabel.textColor = UIColor.blackColor;
-    warningLabel.backgroundColor = [UIColor.lightGrayColor colorWithAlphaComponent:0.3];
-    warningLabel.numberOfLines = 0;
-    warningLabel.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleBottomMargin;
-    [self.view addSubview:warningLabel];
-    
-    UIButton *backButton = [[UIButton alloc] initWithFrame:CGRectMake(size.width - 210, size.height - 60, 200, 50)];
-    [backButton setTitle:@"回到上一页" forState:UIControlStateNormal];
-    [backButton setBackgroundColor:UIColor.redColor];
-    backButton.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleBottomMargin;
-    [self.view addSubview:backButton];
-    [backButton addTarget:self action:@selector(back) forControlEvents:UIControlEventTouchUpInside];
-    
-    // 加载页面
-    [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

+ 5 - 3
MJRefreshExample/Classes/Second/MJWebViewViewController.m

@@ -25,9 +25,11 @@ - (void)example31
     __weak UIScrollView *scrollView = self.webView.scrollView;
     
     // 添加下拉刷新控件
-    scrollView.mj_header= [MJChiBaoZiHeader headerWithRefreshingBlock:^{
-        [webView reload];
-    }];
+    [[[MJChiBaoZiHeader headerWithRefreshingBlock:^{
+            [webView reload];
+        }]
+         assignTo:scrollView]
+        autoChangeTransparency:YES];
     
     // 如果是上拉刷新,就以此类推
     [scrollView.mj_header beginRefreshing];

+ 6 - 0
MJRefreshExample/Classes/SwiftExample/MJRefreshExample-Bridging-Header.h

@@ -0,0 +1,6 @@
+//
+//  Use this file to import your target's public headers that you would like to expose to Swift.
+//
+
+#import "MJRefresh.h"
+#import "MJChiBaoZiHeader.h"

+ 90 - 0
MJRefreshExample/Classes/SwiftExample/MJWKWebViewController.swift

@@ -0,0 +1,90 @@
+//
+//  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)
+        .assign(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()
+    }
+}

+ 21 - 1
README.md

@@ -7,6 +7,10 @@
 [📜✍🏻**Release Notes**: more details](https://github.com/CoderMJLee/MJRefresh/releases)
 
 ## Contents
+
+- New Features
+  - [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)
@@ -41,6 +45,19 @@
     * [WKWebView01-The drop-down refresh](#WKWebView01-The_drop-down_refresh)
 * [Hope](#Hope)
 
+## New Features
+### Swift Chaining Grammar Supported
+
+  ```swift
+  // Example as MJRefreshNormalHeader
+  func addRefreshHeader() {
+      MJRefreshNormalHeader { [weak self] in
+  	      // do some Requst
+      }.autoChangeTransparency(true)
+      .assign(to: tableView)
+  }
+  ```
+
 ## <a id="Support_what_kinds_of_controls_to_refresh"></a>Support what kinds of controls to refresh
 * `UIScrollView`、`UITableView`、`UICollectionView`、`WKWebView`
 
@@ -77,9 +94,12 @@ UIView+MJExtension.h        UIView+MJExtension.m
         - 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%">
+
+  <img src="http://images0.cnblogs.com/blog2015/497279/201506/141358159107893.png" width="30%" height="30%">
 
 ## <a id="MJRefreshComponent.h"></a>MJRefreshComponent.h
 ```objc