Commit ea5d5424 authored by 汪洋's avatar 汪洋

init

parent 2c505c2a
<?xml version="1.0" encoding="UTF-8"?> // !$*UTF8*$!
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> {
<plist version="1.0"> archiveVersion = 1;
<dict> classes = {
<key>archiveVersion</key> };
<string>1</string> objectVersion = 46;
<key>classes</key> objects = {
<dict/>
<key>objectVersion</key> /* Begin PBXBuildFile section */
<string>46</string> 1EA82A3DBD22AB871941963E /* Pods_GMRefresh_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D3F45DAD77E81DBF7176F558 /* Pods_GMRefresh_Example.framework */; };
<key>objects</key> 5E8146D8EEDBCF40CBEE9EA8 /* Pods_GMRefresh_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 89D16B3F0E0ABE381CF4A274 /* Pods_GMRefresh_Tests.framework */; };
<dict> 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; };
<key>1EA82A3DBD22AB871941963E</key> 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58F195388D20070C39A /* CoreGraphics.framework */; };
<dict> 6003F592195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; };
<key>fileRef</key> 6003F598195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F596195388D20070C39A /* InfoPlist.strings */; };
<string>D3F45DAD77E81DBF7176F558</string> 6003F59A195388D20070C39A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F599195388D20070C39A /* main.m */; };
<key>isa</key> 6003F59E195388D20070C39A /* GMAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F59D195388D20070C39A /* GMAppDelegate.m */; };
<string>PBXBuildFile</string> 6003F5A7195388D20070C39A /* GMViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5A6195388D20070C39A /* GMViewController.m */; };
</dict> 6003F5A9195388D20070C39A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5A8195388D20070C39A /* Images.xcassets */; };
<key>224BD510C33CE0DF188E772C</key> 6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F5AF195388D20070C39A /* XCTest.framework */; };
<dict> 6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; };
<key>children</key> 6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; };
<array> 6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5B8195388D20070C39A /* InfoPlist.strings */; };
<string>D7B360498240CB380AFBFDD3</string> 6003F5BC195388D20070C39A /* Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5BB195388D20070C39A /* Tests.m */; };
<string>2F69A153C1B9B002E0E117CA</string> 873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */; };
<string>39F84044B9A451BB8835E35B</string> D332B1CD1CD8BDB400A72482 /* GMTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D332B1CC1CD8BDB400A72482 /* GMTableViewController.m */; };
<string>4CE51AD89CB744BB919E4841</string> /* End PBXBuildFile section */
</array>
<key>isa</key> /* Begin PBXContainerItemProxy section */
<string>PBXGroup</string> 6003F5B3195388D20070C39A /* PBXContainerItemProxy */ = {
<key>name</key> isa = PBXContainerItemProxy;
<string>Pods</string> containerPortal = 6003F582195388D10070C39A /* Project object */;
<key>sourceTree</key> proxyType = 1;
<string>&lt;group&gt;</string> remoteGlobalIDString = 6003F589195388D20070C39A;
</dict> remoteInfo = GMRefresh;
<key>2F69A153C1B9B002E0E117CA</key> };
<dict> /* End PBXContainerItemProxy section */
<key>includeInIndex</key>
<string>1</string> /* Begin PBXFileReference section */
<key>isa</key> 2F69A153C1B9B002E0E117CA /* Pods-GMRefresh_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-GMRefresh_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-GMRefresh_Example/Pods-GMRefresh_Example.release.xcconfig"; sourceTree = "<group>"; };
<string>PBXFileReference</string> 39F84044B9A451BB8835E35B /* Pods-GMRefresh_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-GMRefresh_Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-GMRefresh_Tests/Pods-GMRefresh_Tests.debug.xcconfig"; sourceTree = "<group>"; };
<key>lastKnownFileType</key> 4CE51AD89CB744BB919E4841 /* Pods-GMRefresh_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-GMRefresh_Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-GMRefresh_Tests/Pods-GMRefresh_Tests.release.xcconfig"; sourceTree = "<group>"; };
<string>text.xcconfig</string> 6003F58A195388D20070C39A /* GMRefresh_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = GMRefresh_Example.app; sourceTree = BUILT_PRODUCTS_DIR; };
<key>name</key> 6003F58D195388D20070C39A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
<string>Pods-GMRefresh_Example.release.xcconfig</string> 6003F58F195388D20070C39A /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
<key>path</key> 6003F591195388D20070C39A /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
<string>Pods/Target Support Files/Pods-GMRefresh_Example/Pods-GMRefresh_Example.release.xcconfig</string> 6003F595195388D20070C39A /* GMRefresh-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "GMRefresh-Info.plist"; sourceTree = "<group>"; };
<key>sourceTree</key> 6003F597195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
<string>&lt;group&gt;</string> 6003F599195388D20070C39A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
</dict> 6003F59B195388D20070C39A /* GMRefresh-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "GMRefresh-Prefix.pch"; sourceTree = "<group>"; };
<key>39F84044B9A451BB8835E35B</key> 6003F59C195388D20070C39A /* GMAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GMAppDelegate.h; sourceTree = "<group>"; };
<dict> 6003F59D195388D20070C39A /* GMAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GMAppDelegate.m; sourceTree = "<group>"; };
<key>includeInIndex</key> 6003F5A5195388D20070C39A /* GMViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GMViewController.h; sourceTree = "<group>"; };
<string>1</string> 6003F5A6195388D20070C39A /* GMViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GMViewController.m; sourceTree = "<group>"; };
<key>isa</key> 6003F5A8195388D20070C39A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
<string>PBXFileReference</string> 6003F5AE195388D20070C39A /* GMRefresh_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = GMRefresh_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
<key>lastKnownFileType</key> 6003F5AF195388D20070C39A /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
<string>text.xcconfig</string> 6003F5B7195388D20070C39A /* Tests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Tests-Info.plist"; sourceTree = "<group>"; };
<key>name</key> 6003F5B9195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
<string>Pods-GMRefresh_Tests.debug.xcconfig</string> 6003F5BB195388D20070C39A /* Tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Tests.m; sourceTree = "<group>"; };
<key>path</key> 606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Tests-Prefix.pch"; sourceTree = "<group>"; };
<string>Pods/Target Support Files/Pods-GMRefresh_Tests/Pods-GMRefresh_Tests.debug.xcconfig</string> 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = "<group>"; };
<key>sourceTree</key> 89D16B3F0E0ABE381CF4A274 /* Pods_GMRefresh_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_GMRefresh_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
<string>&lt;group&gt;</string> A1A85ED1362F0742068438E9 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = "<group>"; };
</dict> D332B1CB1CD8BDB400A72482 /* GMTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GMTableViewController.h; sourceTree = "<group>"; };
<key>4CE51AD89CB744BB919E4841</key> D332B1CC1CD8BDB400A72482 /* GMTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GMTableViewController.m; sourceTree = "<group>"; };
<dict> D3F45DAD77E81DBF7176F558 /* Pods_GMRefresh_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_GMRefresh_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; };
<key>includeInIndex</key> D7B360498240CB380AFBFDD3 /* Pods-GMRefresh_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-GMRefresh_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-GMRefresh_Example/Pods-GMRefresh_Example.debug.xcconfig"; sourceTree = "<group>"; };
<string>1</string> F0090C1D186E410B67F5CCF9 /* GMRefresh.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = GMRefresh.podspec; path = ../GMRefresh.podspec; sourceTree = "<group>"; };
<key>isa</key> F42776C651DB4979CA86498C /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = "<group>"; };
<string>PBXFileReference</string> /* End PBXFileReference section */
<key>lastKnownFileType</key>
<string>text.xcconfig</string> /* Begin PBXFrameworksBuildPhase section */
<key>name</key> 6003F587195388D20070C39A /* Frameworks */ = {
<string>Pods-GMRefresh_Tests.release.xcconfig</string> isa = PBXFrameworksBuildPhase;
<key>path</key> buildActionMask = 2147483647;
<string>Pods/Target Support Files/Pods-GMRefresh_Tests/Pods-GMRefresh_Tests.release.xcconfig</string> files = (
<key>sourceTree</key> 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */,
<string>&lt;group&gt;</string> 6003F592195388D20070C39A /* UIKit.framework in Frameworks */,
</dict> 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */,
<key>5E8146D8EEDBCF40CBEE9EA8</key> 1EA82A3DBD22AB871941963E /* Pods_GMRefresh_Example.framework in Frameworks */,
<dict> );
<key>fileRef</key> runOnlyForDeploymentPostprocessing = 0;
<string>89D16B3F0E0ABE381CF4A274</string> };
<key>isa</key> 6003F5AB195388D20070C39A /* Frameworks */ = {
<string>PBXBuildFile</string> isa = PBXFrameworksBuildPhase;
</dict> buildActionMask = 2147483647;
<key>6003F581195388D10070C39A</key> files = (
<dict> 6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */,
<key>children</key> 6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */,
<array> 6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */,
<string>60FF7A9C1954A5C5007DD14C</string> 5E8146D8EEDBCF40CBEE9EA8 /* Pods_GMRefresh_Tests.framework in Frameworks */,
<string>6003F593195388D20070C39A</string> );
<string>6003F5B5195388D20070C39A</string> runOnlyForDeploymentPostprocessing = 0;
<string>6003F58C195388D20070C39A</string> };
<string>6003F58B195388D20070C39A</string> /* End PBXFrameworksBuildPhase section */
<string>224BD510C33CE0DF188E772C</string>
</array> /* Begin PBXGroup section */
<key>isa</key> 224BD510C33CE0DF188E772C /* Pods */ = {
<string>PBXGroup</string> isa = PBXGroup;
<key>sourceTree</key> children = (
<string>&lt;group&gt;</string> D7B360498240CB380AFBFDD3 /* Pods-GMRefresh_Example.debug.xcconfig */,
</dict> 2F69A153C1B9B002E0E117CA /* Pods-GMRefresh_Example.release.xcconfig */,
<key>6003F582195388D10070C39A</key> 39F84044B9A451BB8835E35B /* Pods-GMRefresh_Tests.debug.xcconfig */,
<dict> 4CE51AD89CB744BB919E4841 /* Pods-GMRefresh_Tests.release.xcconfig */,
<key>attributes</key> );
<dict> name = Pods;
<key>CLASSPREFIX</key> sourceTree = "<group>";
<string>GM</string> };
<key>LastUpgradeCheck</key> 6003F581195388D10070C39A = {
<string>0720</string> isa = PBXGroup;
<key>ORGANIZATIONNAME</key> children = (
<string>wangyang</string> 60FF7A9C1954A5C5007DD14C /* Podspec Metadata */,
<key>TargetAttributes</key> 6003F593195388D20070C39A /* Example for GMRefresh */,
<dict> 6003F5B5195388D20070C39A /* Tests */,
<key>6003F5AD195388D20070C39A</key> 6003F58C195388D20070C39A /* Frameworks */,
<dict> 6003F58B195388D20070C39A /* Products */,
<key>TestTargetID</key> 224BD510C33CE0DF188E772C /* Pods */,
<string>6003F589195388D20070C39A</string> );
</dict> sourceTree = "<group>";
</dict> };
</dict> 6003F58B195388D20070C39A /* Products */ = {
<key>buildConfigurationList</key> isa = PBXGroup;
<string>6003F585195388D10070C39A</string> children = (
<key>compatibilityVersion</key> 6003F58A195388D20070C39A /* GMRefresh_Example.app */,
<string>Xcode 3.2</string> 6003F5AE195388D20070C39A /* GMRefresh_Tests.xctest */,
<key>developmentRegion</key> );
<string>English</string> name = Products;
<key>hasScannedForEncodings</key> sourceTree = "<group>";
<string>0</string> };
<key>isa</key> 6003F58C195388D20070C39A /* Frameworks */ = {
<string>PBXProject</string> isa = PBXGroup;
<key>knownRegions</key> children = (
<array> 6003F58D195388D20070C39A /* Foundation.framework */,
<string>en</string> 6003F58F195388D20070C39A /* CoreGraphics.framework */,
<string>Base</string> 6003F591195388D20070C39A /* UIKit.framework */,
</array> 6003F5AF195388D20070C39A /* XCTest.framework */,
<key>mainGroup</key> D3F45DAD77E81DBF7176F558 /* Pods_GMRefresh_Example.framework */,
<string>6003F581195388D10070C39A</string> 89D16B3F0E0ABE381CF4A274 /* Pods_GMRefresh_Tests.framework */,
<key>productRefGroup</key> );
<string>6003F58B195388D20070C39A</string> name = Frameworks;
<key>projectDirPath</key> sourceTree = "<group>";
<string></string> };
<key>projectReferences</key> 6003F593195388D20070C39A /* Example for GMRefresh */ = {
<array/> isa = PBXGroup;
<key>projectRoot</key> children = (
<string></string> 6003F59C195388D20070C39A /* GMAppDelegate.h */,
<key>targets</key> 6003F59D195388D20070C39A /* GMAppDelegate.m */,
<array> 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */,
<string>6003F589195388D20070C39A</string> 6003F5A5195388D20070C39A /* GMViewController.h */,
<string>6003F5AD195388D20070C39A</string> 6003F5A6195388D20070C39A /* GMViewController.m */,
</array> D332B1CB1CD8BDB400A72482 /* GMTableViewController.h */,
</dict> D332B1CC1CD8BDB400A72482 /* GMTableViewController.m */,
<key>6003F585195388D10070C39A</key> 6003F5A8195388D20070C39A /* Images.xcassets */,
<dict> 6003F594195388D20070C39A /* Supporting Files */,
<key>buildConfigurations</key> );
<array> name = "Example for GMRefresh";
<string>6003F5BD195388D20070C39A</string> path = GMRefresh;
<string>6003F5BE195388D20070C39A</string> sourceTree = "<group>";
</array> };
<key>defaultConfigurationIsVisible</key> 6003F594195388D20070C39A /* Supporting Files */ = {
<string>0</string> isa = PBXGroup;
<key>defaultConfigurationName</key> children = (
<string>Release</string> 6003F595195388D20070C39A /* GMRefresh-Info.plist */,
<key>isa</key> 6003F596195388D20070C39A /* InfoPlist.strings */,
<string>XCConfigurationList</string> 6003F599195388D20070C39A /* main.m */,
</dict> 6003F59B195388D20070C39A /* GMRefresh-Prefix.pch */,
<key>6003F586195388D20070C39A</key> );
<dict> name = "Supporting Files";
<key>buildActionMask</key> sourceTree = "<group>";
<string>2147483647</string> };
<key>files</key> 6003F5B5195388D20070C39A /* Tests */ = {
<array> isa = PBXGroup;
<string>6003F59E195388D20070C39A</string> children = (
<string>6003F5A7195388D20070C39A</string> 6003F5BB195388D20070C39A /* Tests.m */,
<string>6003F59A195388D20070C39A</string> 6003F5B6195388D20070C39A /* Supporting Files */,
</array> );
<key>isa</key> path = Tests;
<string>PBXSourcesBuildPhase</string> sourceTree = "<group>";
<key>runOnlyForDeploymentPostprocessing</key> };
<string>0</string> 6003F5B6195388D20070C39A /* Supporting Files */ = {
</dict> isa = PBXGroup;
<key>6003F587195388D20070C39A</key> children = (
<dict> 6003F5B7195388D20070C39A /* Tests-Info.plist */,
<key>buildActionMask</key> 6003F5B8195388D20070C39A /* InfoPlist.strings */,
<string>2147483647</string> 606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */,
<key>files</key> );
<array> name = "Supporting Files";
<string>6003F590195388D20070C39A</string> sourceTree = "<group>";
<string>6003F592195388D20070C39A</string> };
<string>6003F58E195388D20070C39A</string> 60FF7A9C1954A5C5007DD14C /* Podspec Metadata */ = {
<string>1EA82A3DBD22AB871941963E</string> isa = PBXGroup;
</array> children = (
<key>isa</key> F0090C1D186E410B67F5CCF9 /* GMRefresh.podspec */,
<string>PBXFrameworksBuildPhase</string> A1A85ED1362F0742068438E9 /* README.md */,
<key>runOnlyForDeploymentPostprocessing</key> F42776C651DB4979CA86498C /* LICENSE */,
<string>0</string> );
</dict> name = "Podspec Metadata";
<key>6003F588195388D20070C39A</key> sourceTree = "<group>";
<dict> };
<key>buildActionMask</key> /* End PBXGroup section */
<string>2147483647</string>
<key>files</key> /* Begin PBXNativeTarget section */
<array> 6003F589195388D20070C39A /* GMRefresh_Example */ = {
<string>873B8AEB1B1F5CCA007FD442</string> isa = PBXNativeTarget;
<string>6003F5A9195388D20070C39A</string> buildConfigurationList = 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "GMRefresh_Example" */;
<string>6003F598195388D20070C39A</string> buildPhases = (
</array> F5A61F1C2113761CA10F4743 /* Check Pods Manifest.lock */,
<key>isa</key> 6003F586195388D20070C39A /* Sources */,
<string>PBXResourcesBuildPhase</string> 6003F587195388D20070C39A /* Frameworks */,
<key>runOnlyForDeploymentPostprocessing</key> 6003F588195388D20070C39A /* Resources */,
<string>0</string> 981B00561020C7179B16B39B /* Embed Pods Frameworks */,
</dict> 9BB56AD5B32170CF2DA618EC /* Copy Pods Resources */,
<key>6003F589195388D20070C39A</key> );
<dict> buildRules = (
<key>buildConfigurationList</key> );
<string>6003F5BF195388D20070C39A</string> dependencies = (
<key>buildPhases</key> );
<array> name = GMRefresh_Example;
<string>F5A61F1C2113761CA10F4743</string> productName = GMRefresh;
<string>6003F586195388D20070C39A</string> productReference = 6003F58A195388D20070C39A /* GMRefresh_Example.app */;
<string>6003F587195388D20070C39A</string> productType = "com.apple.product-type.application";
<string>6003F588195388D20070C39A</string> };
<string>981B00561020C7179B16B39B</string> 6003F5AD195388D20070C39A /* GMRefresh_Tests */ = {
<string>9BB56AD5B32170CF2DA618EC</string> isa = PBXNativeTarget;
</array> buildConfigurationList = 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "GMRefresh_Tests" */;
<key>buildRules</key> buildPhases = (
<array/> C3A8C297F271E47E4AA20353 /* Check Pods Manifest.lock */,
<key>dependencies</key> 6003F5AA195388D20070C39A /* Sources */,
<array/> 6003F5AB195388D20070C39A /* Frameworks */,
<key>isa</key> 6003F5AC195388D20070C39A /* Resources */,
<string>PBXNativeTarget</string> EF09AB50850735E3C2B7714F /* Embed Pods Frameworks */,
<key>name</key> FF7555122DDECEDD183B1CCF /* Copy Pods Resources */,
<string>GMRefresh_Example</string> );
<key>productName</key> buildRules = (
<string>GMRefresh</string> );
<key>productReference</key> dependencies = (
<string>6003F58A195388D20070C39A</string> 6003F5B4195388D20070C39A /* PBXTargetDependency */,
<key>productType</key> );
<string>com.apple.product-type.application</string> name = GMRefresh_Tests;
</dict> productName = GMRefreshTests;
<key>6003F58A195388D20070C39A</key> productReference = 6003F5AE195388D20070C39A /* GMRefresh_Tests.xctest */;
<dict> productType = "com.apple.product-type.bundle.unit-test";
<key>explicitFileType</key> };
<string>wrapper.application</string> /* End PBXNativeTarget section */
<key>includeInIndex</key>
<string>0</string> /* Begin PBXProject section */
<key>isa</key> 6003F582195388D10070C39A /* Project object */ = {
<string>PBXFileReference</string> isa = PBXProject;
<key>path</key> attributes = {
<string>GMRefresh_Example.app</string> CLASSPREFIX = GM;
<key>sourceTree</key> LastUpgradeCheck = 0720;
<string>BUILT_PRODUCTS_DIR</string> ORGANIZATIONNAME = "北京更美互动信息科技有限公司";
</dict> TargetAttributes = {
<key>6003F58B195388D20070C39A</key> 6003F5AD195388D20070C39A = {
<dict> TestTargetID = 6003F589195388D20070C39A;
<key>children</key> };
<array> };
<string>6003F58A195388D20070C39A</string> };
<string>6003F5AE195388D20070C39A</string> buildConfigurationList = 6003F585195388D10070C39A /* Build configuration list for PBXProject "GMRefresh" */;
</array> compatibilityVersion = "Xcode 3.2";
<key>isa</key> developmentRegion = English;
<string>PBXGroup</string> hasScannedForEncodings = 0;
<key>name</key> knownRegions = (
<string>Products</string> en,
<key>sourceTree</key> Base,
<string>&lt;group&gt;</string> );
</dict> mainGroup = 6003F581195388D10070C39A;
<key>6003F58C195388D20070C39A</key> productRefGroup = 6003F58B195388D20070C39A /* Products */;
<dict> projectDirPath = "";
<key>children</key> projectRoot = "";
<array> targets = (
<string>6003F58D195388D20070C39A</string> 6003F589195388D20070C39A /* GMRefresh_Example */,
<string>6003F58F195388D20070C39A</string> 6003F5AD195388D20070C39A /* GMRefresh_Tests */,
<string>6003F591195388D20070C39A</string> );
<string>6003F5AF195388D20070C39A</string> };
<string>D3F45DAD77E81DBF7176F558</string> /* End PBXProject section */
<string>89D16B3F0E0ABE381CF4A274</string>
</array> /* Begin PBXResourcesBuildPhase section */
<key>isa</key> 6003F588195388D20070C39A /* Resources */ = {
<string>PBXGroup</string> isa = PBXResourcesBuildPhase;
<key>name</key> buildActionMask = 2147483647;
<string>Frameworks</string> files = (
<key>sourceTree</key> 873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */,
<string>&lt;group&gt;</string> 6003F5A9195388D20070C39A /* Images.xcassets in Resources */,
</dict> 6003F598195388D20070C39A /* InfoPlist.strings in Resources */,
<key>6003F58D195388D20070C39A</key> );
<dict> runOnlyForDeploymentPostprocessing = 0;
<key>isa</key> };
<string>PBXFileReference</string> 6003F5AC195388D20070C39A /* Resources */ = {
<key>lastKnownFileType</key> isa = PBXResourcesBuildPhase;
<string>wrapper.framework</string> buildActionMask = 2147483647;
<key>name</key> files = (
<string>Foundation.framework</string> 6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */,
<key>path</key> );
<string>System/Library/Frameworks/Foundation.framework</string> runOnlyForDeploymentPostprocessing = 0;
<key>sourceTree</key> };
<string>SDKROOT</string> /* End PBXResourcesBuildPhase section */
</dict>
<key>6003F58E195388D20070C39A</key> /* Begin PBXShellScriptBuildPhase section */
<dict> 981B00561020C7179B16B39B /* Embed Pods Frameworks */ = {
<key>fileRef</key> isa = PBXShellScriptBuildPhase;
<string>6003F58D195388D20070C39A</string> buildActionMask = 2147483647;
<key>isa</key> files = (
<string>PBXBuildFile</string> );
</dict> inputPaths = (
<key>6003F58F195388D20070C39A</key> );
<dict> name = "Embed Pods Frameworks";
<key>isa</key> outputPaths = (
<string>PBXFileReference</string> );
<key>lastKnownFileType</key> runOnlyForDeploymentPostprocessing = 0;
<string>wrapper.framework</string> shellPath = /bin/sh;
<key>name</key> shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-GMRefresh_Example/Pods-GMRefresh_Example-frameworks.sh\"\n";
<string>CoreGraphics.framework</string> showEnvVarsInLog = 0;
<key>path</key> };
<string>System/Library/Frameworks/CoreGraphics.framework</string> 9BB56AD5B32170CF2DA618EC /* Copy Pods Resources */ = {
<key>sourceTree</key> isa = PBXShellScriptBuildPhase;
<string>SDKROOT</string> buildActionMask = 2147483647;
</dict> files = (
<key>6003F590195388D20070C39A</key> );
<dict> inputPaths = (
<key>fileRef</key> );
<string>6003F58F195388D20070C39A</string> name = "Copy Pods Resources";
<key>isa</key> outputPaths = (
<string>PBXBuildFile</string> );
</dict> runOnlyForDeploymentPostprocessing = 0;
<key>6003F591195388D20070C39A</key> shellPath = /bin/sh;
<dict> shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-GMRefresh_Example/Pods-GMRefresh_Example-resources.sh\"\n";
<key>isa</key> showEnvVarsInLog = 0;
<string>PBXFileReference</string> };
<key>lastKnownFileType</key> C3A8C297F271E47E4AA20353 /* Check Pods Manifest.lock */ = {
<string>wrapper.framework</string> isa = PBXShellScriptBuildPhase;
<key>name</key> buildActionMask = 2147483647;
<string>UIKit.framework</string> files = (
<key>path</key> );
<string>System/Library/Frameworks/UIKit.framework</string> inputPaths = (
<key>sourceTree</key> );
<string>SDKROOT</string> name = "Check Pods Manifest.lock";
</dict> outputPaths = (
<key>6003F592195388D20070C39A</key> );
<dict> runOnlyForDeploymentPostprocessing = 0;
<key>fileRef</key> shellPath = /bin/sh;
<string>6003F591195388D20070C39A</string> shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
<key>isa</key> showEnvVarsInLog = 0;
<string>PBXBuildFile</string> };
</dict> EF09AB50850735E3C2B7714F /* Embed Pods Frameworks */ = {
<key>6003F593195388D20070C39A</key> isa = PBXShellScriptBuildPhase;
<dict> buildActionMask = 2147483647;
<key>children</key> files = (
<array> );
<string>6003F59C195388D20070C39A</string> inputPaths = (
<string>6003F59D195388D20070C39A</string> );
<string>873B8AEA1B1F5CCA007FD442</string> name = "Embed Pods Frameworks";
<string>6003F5A5195388D20070C39A</string> outputPaths = (
<string>6003F5A6195388D20070C39A</string> );
<string>6003F5A8195388D20070C39A</string> runOnlyForDeploymentPostprocessing = 0;
<string>6003F594195388D20070C39A</string> shellPath = /bin/sh;
</array> shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-GMRefresh_Tests/Pods-GMRefresh_Tests-frameworks.sh\"\n";
<key>isa</key> showEnvVarsInLog = 0;
<string>PBXGroup</string> };
<key>name</key> F5A61F1C2113761CA10F4743 /* Check Pods Manifest.lock */ = {
<string>Example for GMRefresh</string> isa = PBXShellScriptBuildPhase;
<key>path</key> buildActionMask = 2147483647;
<string>GMRefresh</string> files = (
<key>sourceTree</key> );
<string>&lt;group&gt;</string> inputPaths = (
</dict> );
<key>6003F594195388D20070C39A</key> name = "Check Pods Manifest.lock";
<dict> outputPaths = (
<key>children</key> );
<array> runOnlyForDeploymentPostprocessing = 0;
<string>6003F595195388D20070C39A</string> shellPath = /bin/sh;
<string>6003F596195388D20070C39A</string> shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
<string>6003F599195388D20070C39A</string> showEnvVarsInLog = 0;
<string>6003F59B195388D20070C39A</string> };
</array> FF7555122DDECEDD183B1CCF /* Copy Pods Resources */ = {
<key>isa</key> isa = PBXShellScriptBuildPhase;
<string>PBXGroup</string> buildActionMask = 2147483647;
<key>name</key> files = (
<string>Supporting Files</string> );
<key>sourceTree</key> inputPaths = (
<string>&lt;group&gt;</string> );
</dict> name = "Copy Pods Resources";
<key>6003F595195388D20070C39A</key> outputPaths = (
<dict> );
<key>isa</key> runOnlyForDeploymentPostprocessing = 0;
<string>PBXFileReference</string> shellPath = /bin/sh;
<key>lastKnownFileType</key> shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-GMRefresh_Tests/Pods-GMRefresh_Tests-resources.sh\"\n";
<string>text.plist.xml</string> showEnvVarsInLog = 0;
<key>path</key> };
<string>GMRefresh-Info.plist</string> /* End PBXShellScriptBuildPhase section */
<key>sourceTree</key>
<string>&lt;group&gt;</string> /* Begin PBXSourcesBuildPhase section */
</dict> 6003F586195388D20070C39A /* Sources */ = {
<key>6003F596195388D20070C39A</key> isa = PBXSourcesBuildPhase;
<dict> buildActionMask = 2147483647;
<key>children</key> files = (
<array> 6003F59E195388D20070C39A /* GMAppDelegate.m in Sources */,
<string>6003F597195388D20070C39A</string> D332B1CD1CD8BDB400A72482 /* GMTableViewController.m in Sources */,
</array> 6003F5A7195388D20070C39A /* GMViewController.m in Sources */,
<key>isa</key> 6003F59A195388D20070C39A /* main.m in Sources */,
<string>PBXVariantGroup</string> );
<key>name</key> runOnlyForDeploymentPostprocessing = 0;
<string>InfoPlist.strings</string> };
<key>sourceTree</key> 6003F5AA195388D20070C39A /* Sources */ = {
<string>&lt;group&gt;</string> isa = PBXSourcesBuildPhase;
</dict> buildActionMask = 2147483647;
<key>6003F597195388D20070C39A</key> files = (
<dict> 6003F5BC195388D20070C39A /* Tests.m in Sources */,
<key>isa</key> );
<string>PBXFileReference</string> runOnlyForDeploymentPostprocessing = 0;
<key>lastKnownFileType</key> };
<string>text.plist.strings</string> /* End PBXSourcesBuildPhase section */
<key>name</key>
<string>en</string> /* Begin PBXTargetDependency section */
<key>path</key> 6003F5B4195388D20070C39A /* PBXTargetDependency */ = {
<string>en.lproj/InfoPlist.strings</string> isa = PBXTargetDependency;
<key>sourceTree</key> target = 6003F589195388D20070C39A /* GMRefresh_Example */;
<string>&lt;group&gt;</string> targetProxy = 6003F5B3195388D20070C39A /* PBXContainerItemProxy */;
</dict> };
<key>6003F598195388D20070C39A</key> /* End PBXTargetDependency section */
<dict>
<key>fileRef</key> /* Begin PBXVariantGroup section */
<string>6003F596195388D20070C39A</string> 6003F596195388D20070C39A /* InfoPlist.strings */ = {
<key>isa</key> isa = PBXVariantGroup;
<string>PBXBuildFile</string> children = (
</dict> 6003F597195388D20070C39A /* en */,
<key>6003F599195388D20070C39A</key> );
<dict> name = InfoPlist.strings;
<key>isa</key> sourceTree = "<group>";
<string>PBXFileReference</string> };
<key>lastKnownFileType</key> 6003F5B8195388D20070C39A /* InfoPlist.strings */ = {
<string>sourcecode.c.objc</string> isa = PBXVariantGroup;
<key>path</key> children = (
<string>main.m</string> 6003F5B9195388D20070C39A /* en */,
<key>sourceTree</key> );
<string>&lt;group&gt;</string> name = InfoPlist.strings;
</dict> sourceTree = "<group>";
<key>6003F59A195388D20070C39A</key> };
<dict> /* End PBXVariantGroup section */
<key>fileRef</key>
<string>6003F599195388D20070C39A</string> /* Begin XCBuildConfiguration section */
<key>isa</key> 6003F5BD195388D20070C39A /* Debug */ = {
<string>PBXBuildFile</string> isa = XCBuildConfiguration;
</dict> buildSettings = {
<key>6003F59B195388D20070C39A</key> ALWAYS_SEARCH_USER_PATHS = NO;
<dict> CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
<key>isa</key> CLANG_CXX_LIBRARY = "libc++";
<string>PBXFileReference</string> CLANG_ENABLE_MODULES = YES;
<key>lastKnownFileType</key> CLANG_ENABLE_OBJC_ARC = YES;
<string>sourcecode.c.h</string> CLANG_WARN_BOOL_CONVERSION = YES;
<key>path</key> CLANG_WARN_CONSTANT_CONVERSION = YES;
<string>GMRefresh-Prefix.pch</string> CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
<key>sourceTree</key> CLANG_WARN_EMPTY_BODY = YES;
<string>&lt;group&gt;</string> CLANG_WARN_ENUM_CONVERSION = YES;
</dict> CLANG_WARN_INT_CONVERSION = YES;
<key>6003F59C195388D20070C39A</key> CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
<dict> CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
<key>isa</key> "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
<string>PBXFileReference</string> COPY_PHASE_STRIP = NO;
<key>lastKnownFileType</key> ENABLE_TESTABILITY = YES;
<string>sourcecode.c.h</string> GCC_C_LANGUAGE_STANDARD = gnu99;
<key>path</key> GCC_DYNAMIC_NO_PIC = NO;
<string>GMAppDelegate.h</string> GCC_OPTIMIZATION_LEVEL = 0;
<key>sourceTree</key> GCC_PREPROCESSOR_DEFINITIONS = (
<string>&lt;group&gt;</string> "DEBUG=1",
</dict> "$(inherited)",
<key>6003F59D195388D20070C39A</key> );
<dict> GCC_SYMBOLS_PRIVATE_EXTERN = NO;
<key>isa</key> GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
<string>PBXFileReference</string> GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
<key>lastKnownFileType</key> GCC_WARN_UNDECLARED_SELECTOR = YES;
<string>sourcecode.c.objc</string> GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
<key>path</key> GCC_WARN_UNUSED_FUNCTION = YES;
<string>GMAppDelegate.m</string> GCC_WARN_UNUSED_VARIABLE = YES;
<key>sourceTree</key> IPHONEOS_DEPLOYMENT_TARGET = 8.3;
<string>&lt;group&gt;</string> ONLY_ACTIVE_ARCH = YES;
</dict> SDKROOT = iphoneos;
<key>6003F59E195388D20070C39A</key> TARGETED_DEVICE_FAMILY = "1,2";
<dict> };
<key>fileRef</key> name = Debug;
<string>6003F59D195388D20070C39A</string> };
<key>isa</key> 6003F5BE195388D20070C39A /* Release */ = {
<string>PBXBuildFile</string> isa = XCBuildConfiguration;
</dict> buildSettings = {
<key>6003F5A5195388D20070C39A</key> ALWAYS_SEARCH_USER_PATHS = NO;
<dict> CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
<key>isa</key> CLANG_CXX_LIBRARY = "libc++";
<string>PBXFileReference</string> CLANG_ENABLE_MODULES = YES;
<key>lastKnownFileType</key> CLANG_ENABLE_OBJC_ARC = YES;
<string>sourcecode.c.h</string> CLANG_WARN_BOOL_CONVERSION = YES;
<key>path</key> CLANG_WARN_CONSTANT_CONVERSION = YES;
<string>GMViewController.h</string> CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
<key>sourceTree</key> CLANG_WARN_EMPTY_BODY = YES;
<string>&lt;group&gt;</string> CLANG_WARN_ENUM_CONVERSION = YES;
</dict> CLANG_WARN_INT_CONVERSION = YES;
<key>6003F5A6195388D20070C39A</key> CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
<dict> CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
<key>isa</key> "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
<string>PBXFileReference</string> COPY_PHASE_STRIP = YES;
<key>lastKnownFileType</key> ENABLE_NS_ASSERTIONS = NO;
<string>sourcecode.c.objc</string> GCC_C_LANGUAGE_STANDARD = gnu99;
<key>path</key> GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
<string>GMViewController.m</string> GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
<key>sourceTree</key> GCC_WARN_UNDECLARED_SELECTOR = YES;
<string>&lt;group&gt;</string> GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
</dict> GCC_WARN_UNUSED_FUNCTION = YES;
<key>6003F5A7195388D20070C39A</key> GCC_WARN_UNUSED_VARIABLE = YES;
<dict> IPHONEOS_DEPLOYMENT_TARGET = 8.3;
<key>fileRef</key> SDKROOT = iphoneos;
<string>6003F5A6195388D20070C39A</string> TARGETED_DEVICE_FAMILY = "1,2";
<key>isa</key> VALIDATE_PRODUCT = YES;
<string>PBXBuildFile</string> };
</dict> name = Release;
<key>6003F5A8195388D20070C39A</key> };
<dict> 6003F5C0195388D20070C39A /* Debug */ = {
<key>isa</key> isa = XCBuildConfiguration;
<string>PBXFileReference</string> baseConfigurationReference = D7B360498240CB380AFBFDD3 /* Pods-GMRefresh_Example.debug.xcconfig */;
<key>lastKnownFileType</key> buildSettings = {
<string>folder.assetcatalog</string> ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
<key>path</key> ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
<string>Images.xcassets</string> GCC_PRECOMPILE_PREFIX_HEADER = YES;
<key>sourceTree</key> GCC_PREFIX_HEADER = "GMRefresh/GMRefresh-Prefix.pch";
<string>&lt;group&gt;</string> INFOPLIST_FILE = "GMRefresh/GMRefresh-Info.plist";
</dict> MODULE_NAME = ExampleApp;
<key>6003F5A9195388D20070C39A</key> PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}";
<dict> PRODUCT_NAME = "$(TARGET_NAME)";
<key>fileRef</key> WRAPPER_EXTENSION = app;
<string>6003F5A8195388D20070C39A</string> };
<key>isa</key> name = Debug;
<string>PBXBuildFile</string> };
</dict> 6003F5C1195388D20070C39A /* Release */ = {
<key>6003F5AA195388D20070C39A</key> isa = XCBuildConfiguration;
<dict> baseConfigurationReference = 2F69A153C1B9B002E0E117CA /* Pods-GMRefresh_Example.release.xcconfig */;
<key>buildActionMask</key> buildSettings = {
<string>2147483647</string> ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
<key>files</key> ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
<array> GCC_PRECOMPILE_PREFIX_HEADER = YES;
<string>6003F5BC195388D20070C39A</string> GCC_PREFIX_HEADER = "GMRefresh/GMRefresh-Prefix.pch";
</array> INFOPLIST_FILE = "GMRefresh/GMRefresh-Info.plist";
<key>isa</key> MODULE_NAME = ExampleApp;
<string>PBXSourcesBuildPhase</string> PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}";
<key>runOnlyForDeploymentPostprocessing</key> PRODUCT_NAME = "$(TARGET_NAME)";
<string>0</string> WRAPPER_EXTENSION = app;
</dict> };
<key>6003F5AB195388D20070C39A</key> name = Release;
<dict> };
<key>buildActionMask</key> 6003F5C3195388D20070C39A /* Debug */ = {
<string>2147483647</string> isa = XCBuildConfiguration;
<key>files</key> baseConfigurationReference = 39F84044B9A451BB8835E35B /* Pods-GMRefresh_Tests.debug.xcconfig */;
<array> buildSettings = {
<string>6003F5B0195388D20070C39A</string> BUNDLE_LOADER = "$(TEST_HOST)";
<string>6003F5B2195388D20070C39A</string> FRAMEWORK_SEARCH_PATHS = (
<string>6003F5B1195388D20070C39A</string> "$(SDKROOT)/Developer/Library/Frameworks",
<string>5E8146D8EEDBCF40CBEE9EA8</string> "$(inherited)",
</array> "$(DEVELOPER_FRAMEWORKS_DIR)",
<key>isa</key> );
<string>PBXFrameworksBuildPhase</string> GCC_PRECOMPILE_PREFIX_HEADER = YES;
<key>runOnlyForDeploymentPostprocessing</key> GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch";
<string>0</string> GCC_PREPROCESSOR_DEFINITIONS = (
</dict> "DEBUG=1",
<key>6003F5AC195388D20070C39A</key> "$(inherited)",
<dict> );
<key>buildActionMask</key> INFOPLIST_FILE = "Tests/Tests-Info.plist";
<string>2147483647</string> PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}";
<key>files</key> PRODUCT_NAME = "$(TARGET_NAME)";
<array> TEST_HOST = "$(BUILT_PRODUCTS_DIR)/GMRefresh_Example.app/GMRefresh_Example";
<string>6003F5BA195388D20070C39A</string> WRAPPER_EXTENSION = xctest;
</array> };
<key>isa</key> name = Debug;
<string>PBXResourcesBuildPhase</string> };
<key>runOnlyForDeploymentPostprocessing</key> 6003F5C4195388D20070C39A /* Release */ = {
<string>0</string> isa = XCBuildConfiguration;
</dict> baseConfigurationReference = 4CE51AD89CB744BB919E4841 /* Pods-GMRefresh_Tests.release.xcconfig */;
<key>6003F5AD195388D20070C39A</key> buildSettings = {
<dict> BUNDLE_LOADER = "$(TEST_HOST)";
<key>buildConfigurationList</key> FRAMEWORK_SEARCH_PATHS = (
<string>6003F5C2195388D20070C39A</string> "$(SDKROOT)/Developer/Library/Frameworks",
<key>buildPhases</key> "$(inherited)",
<array> "$(DEVELOPER_FRAMEWORKS_DIR)",
<string>C3A8C297F271E47E4AA20353</string> );
<string>6003F5AA195388D20070C39A</string> GCC_PRECOMPILE_PREFIX_HEADER = YES;
<string>6003F5AB195388D20070C39A</string> GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch";
<string>6003F5AC195388D20070C39A</string> INFOPLIST_FILE = "Tests/Tests-Info.plist";
<string>EF09AB50850735E3C2B7714F</string> PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}";
<string>FF7555122DDECEDD183B1CCF</string> PRODUCT_NAME = "$(TARGET_NAME)";
</array> TEST_HOST = "$(BUILT_PRODUCTS_DIR)/GMRefresh_Example.app/GMRefresh_Example";
<key>buildRules</key> WRAPPER_EXTENSION = xctest;
<array/> };
<key>dependencies</key> name = Release;
<array> };
<string>6003F5B4195388D20070C39A</string> /* End XCBuildConfiguration section */
</array>
<key>isa</key> /* Begin XCConfigurationList section */
<string>PBXNativeTarget</string> 6003F585195388D10070C39A /* Build configuration list for PBXProject "GMRefresh" */ = {
<key>name</key> isa = XCConfigurationList;
<string>GMRefresh_Tests</string> buildConfigurations = (
<key>productName</key> 6003F5BD195388D20070C39A /* Debug */,
<string>GMRefreshTests</string> 6003F5BE195388D20070C39A /* Release */,
<key>productReference</key> );
<string>6003F5AE195388D20070C39A</string> defaultConfigurationIsVisible = 0;
<key>productType</key> defaultConfigurationName = Release;
<string>com.apple.product-type.bundle.unit-test</string> };
</dict> 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "GMRefresh_Example" */ = {
<key>6003F5AE195388D20070C39A</key> isa = XCConfigurationList;
<dict> buildConfigurations = (
<key>explicitFileType</key> 6003F5C0195388D20070C39A /* Debug */,
<string>wrapper.cfbundle</string> 6003F5C1195388D20070C39A /* Release */,
<key>includeInIndex</key> );
<string>0</string> defaultConfigurationIsVisible = 0;
<key>isa</key> defaultConfigurationName = Release;
<string>PBXFileReference</string> };
<key>path</key> 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "GMRefresh_Tests" */ = {
<string>GMRefresh_Tests.xctest</string> isa = XCConfigurationList;
<key>sourceTree</key> buildConfigurations = (
<string>BUILT_PRODUCTS_DIR</string> 6003F5C3195388D20070C39A /* Debug */,
</dict> 6003F5C4195388D20070C39A /* Release */,
<key>6003F5AF195388D20070C39A</key> );
<dict> defaultConfigurationIsVisible = 0;
<key>isa</key> defaultConfigurationName = Release;
<string>PBXFileReference</string> };
<key>lastKnownFileType</key> /* End XCConfigurationList section */
<string>wrapper.framework</string> };
<key>name</key> rootObject = 6003F582195388D10070C39A /* Project object */;
<string>XCTest.framework</string> }
<key>path</key>
<string>Library/Frameworks/XCTest.framework</string>
<key>sourceTree</key>
<string>DEVELOPER_DIR</string>
</dict>
<key>6003F5B0195388D20070C39A</key>
<dict>
<key>fileRef</key>
<string>6003F5AF195388D20070C39A</string>
<key>isa</key>
<string>PBXBuildFile</string>
</dict>
<key>6003F5B1195388D20070C39A</key>
<dict>
<key>fileRef</key>
<string>6003F58D195388D20070C39A</string>
<key>isa</key>
<string>PBXBuildFile</string>
</dict>
<key>6003F5B2195388D20070C39A</key>
<dict>
<key>fileRef</key>
<string>6003F591195388D20070C39A</string>
<key>isa</key>
<string>PBXBuildFile</string>
</dict>
<key>6003F5B3195388D20070C39A</key>
<dict>
<key>containerPortal</key>
<string>6003F582195388D10070C39A</string>
<key>isa</key>
<string>PBXContainerItemProxy</string>
<key>proxyType</key>
<string>1</string>
<key>remoteGlobalIDString</key>
<string>6003F589195388D20070C39A</string>
<key>remoteInfo</key>
<string>GMRefresh</string>
</dict>
<key>6003F5B4195388D20070C39A</key>
<dict>
<key>isa</key>
<string>PBXTargetDependency</string>
<key>target</key>
<string>6003F589195388D20070C39A</string>
<key>targetProxy</key>
<string>6003F5B3195388D20070C39A</string>
</dict>
<key>6003F5B5195388D20070C39A</key>
<dict>
<key>children</key>
<array>
<string>6003F5BB195388D20070C39A</string>
<string>6003F5B6195388D20070C39A</string>
</array>
<key>isa</key>
<string>PBXGroup</string>
<key>path</key>
<string>Tests</string>
<key>sourceTree</key>
<string>&lt;group&gt;</string>
</dict>
<key>6003F5B6195388D20070C39A</key>
<dict>
<key>children</key>
<array>
<string>6003F5B7195388D20070C39A</string>
<string>6003F5B8195388D20070C39A</string>
<string>606FC2411953D9B200FFA9A0</string>
</array>
<key>isa</key>
<string>PBXGroup</string>
<key>name</key>
<string>Supporting Files</string>
<key>sourceTree</key>
<string>&lt;group&gt;</string>
</dict>
<key>6003F5B7195388D20070C39A</key>
<dict>
<key>isa</key>
<string>PBXFileReference</string>
<key>lastKnownFileType</key>
<string>text.plist.xml</string>
<key>path</key>
<string>Tests-Info.plist</string>
<key>sourceTree</key>
<string>&lt;group&gt;</string>
</dict>
<key>6003F5B8195388D20070C39A</key>
<dict>
<key>children</key>
<array>
<string>6003F5B9195388D20070C39A</string>
</array>
<key>isa</key>
<string>PBXVariantGroup</string>
<key>name</key>
<string>InfoPlist.strings</string>
<key>sourceTree</key>
<string>&lt;group&gt;</string>
</dict>
<key>6003F5B9195388D20070C39A</key>
<dict>
<key>isa</key>
<string>PBXFileReference</string>
<key>lastKnownFileType</key>
<string>text.plist.strings</string>
<key>name</key>
<string>en</string>
<key>path</key>
<string>en.lproj/InfoPlist.strings</string>
<key>sourceTree</key>
<string>&lt;group&gt;</string>
</dict>
<key>6003F5BA195388D20070C39A</key>
<dict>
<key>fileRef</key>
<string>6003F5B8195388D20070C39A</string>
<key>isa</key>
<string>PBXBuildFile</string>
</dict>
<key>6003F5BB195388D20070C39A</key>
<dict>
<key>isa</key>
<string>PBXFileReference</string>
<key>lastKnownFileType</key>
<string>sourcecode.c.objc</string>
<key>path</key>
<string>Tests.m</string>
<key>sourceTree</key>
<string>&lt;group&gt;</string>
</dict>
<key>6003F5BC195388D20070C39A</key>
<dict>
<key>fileRef</key>
<string>6003F5BB195388D20070C39A</string>
<key>isa</key>
<string>PBXBuildFile</string>
</dict>
<key>6003F5BD195388D20070C39A</key>
<dict>
<key>buildSettings</key>
<dict>
<key>ALWAYS_SEARCH_USER_PATHS</key>
<string>NO</string>
<key>CLANG_CXX_LANGUAGE_STANDARD</key>
<string>gnu++0x</string>
<key>CLANG_CXX_LIBRARY</key>
<string>libc++</string>
<key>CLANG_ENABLE_MODULES</key>
<string>YES</string>
<key>CLANG_ENABLE_OBJC_ARC</key>
<string>YES</string>
<key>CLANG_WARN_BOOL_CONVERSION</key>
<string>YES</string>
<key>CLANG_WARN_CONSTANT_CONVERSION</key>
<string>YES</string>
<key>CLANG_WARN_DIRECT_OBJC_ISA_USAGE</key>
<string>YES_ERROR</string>
<key>CLANG_WARN_EMPTY_BODY</key>
<string>YES</string>
<key>CLANG_WARN_ENUM_CONVERSION</key>
<string>YES</string>
<key>CLANG_WARN_INT_CONVERSION</key>
<string>YES</string>
<key>CLANG_WARN_OBJC_ROOT_CLASS</key>
<string>YES_ERROR</string>
<key>CLANG_WARN__DUPLICATE_METHOD_MATCH</key>
<string>YES</string>
<key>CODE_SIGN_IDENTITY[sdk=iphoneos*]</key>
<string>iPhone Developer</string>
<key>COPY_PHASE_STRIP</key>
<string>NO</string>
<key>ENABLE_TESTABILITY</key>
<string>YES</string>
<key>GCC_C_LANGUAGE_STANDARD</key>
<string>gnu99</string>
<key>GCC_DYNAMIC_NO_PIC</key>
<string>NO</string>
<key>GCC_OPTIMIZATION_LEVEL</key>
<string>0</string>
<key>GCC_PREPROCESSOR_DEFINITIONS</key>
<array>
<string>DEBUG=1</string>
<string>$(inherited)</string>
</array>
<key>GCC_SYMBOLS_PRIVATE_EXTERN</key>
<string>NO</string>
<key>GCC_WARN_64_TO_32_BIT_CONVERSION</key>
<string>YES</string>
<key>GCC_WARN_ABOUT_RETURN_TYPE</key>
<string>YES_ERROR</string>
<key>GCC_WARN_UNDECLARED_SELECTOR</key>
<string>YES</string>
<key>GCC_WARN_UNINITIALIZED_AUTOS</key>
<string>YES_AGGRESSIVE</string>
<key>GCC_WARN_UNUSED_FUNCTION</key>
<string>YES</string>
<key>GCC_WARN_UNUSED_VARIABLE</key>
<string>YES</string>
<key>IPHONEOS_DEPLOYMENT_TARGET</key>
<string>8.3</string>
<key>ONLY_ACTIVE_ARCH</key>
<string>YES</string>
<key>SDKROOT</key>
<string>iphoneos</string>
<key>TARGETED_DEVICE_FAMILY</key>
<string>1,2</string>
</dict>
<key>isa</key>
<string>XCBuildConfiguration</string>
<key>name</key>
<string>Debug</string>
</dict>
<key>6003F5BE195388D20070C39A</key>
<dict>
<key>buildSettings</key>
<dict>
<key>ALWAYS_SEARCH_USER_PATHS</key>
<string>NO</string>
<key>CLANG_CXX_LANGUAGE_STANDARD</key>
<string>gnu++0x</string>
<key>CLANG_CXX_LIBRARY</key>
<string>libc++</string>
<key>CLANG_ENABLE_MODULES</key>
<string>YES</string>
<key>CLANG_ENABLE_OBJC_ARC</key>
<string>YES</string>
<key>CLANG_WARN_BOOL_CONVERSION</key>
<string>YES</string>
<key>CLANG_WARN_CONSTANT_CONVERSION</key>
<string>YES</string>
<key>CLANG_WARN_DIRECT_OBJC_ISA_USAGE</key>
<string>YES_ERROR</string>
<key>CLANG_WARN_EMPTY_BODY</key>
<string>YES</string>
<key>CLANG_WARN_ENUM_CONVERSION</key>
<string>YES</string>
<key>CLANG_WARN_INT_CONVERSION</key>
<string>YES</string>
<key>CLANG_WARN_OBJC_ROOT_CLASS</key>
<string>YES_ERROR</string>
<key>CLANG_WARN__DUPLICATE_METHOD_MATCH</key>
<string>YES</string>
<key>CODE_SIGN_IDENTITY[sdk=iphoneos*]</key>
<string>iPhone Developer</string>
<key>COPY_PHASE_STRIP</key>
<string>YES</string>
<key>ENABLE_NS_ASSERTIONS</key>
<string>NO</string>
<key>GCC_C_LANGUAGE_STANDARD</key>
<string>gnu99</string>
<key>GCC_WARN_64_TO_32_BIT_CONVERSION</key>
<string>YES</string>
<key>GCC_WARN_ABOUT_RETURN_TYPE</key>
<string>YES_ERROR</string>
<key>GCC_WARN_UNDECLARED_SELECTOR</key>
<string>YES</string>
<key>GCC_WARN_UNINITIALIZED_AUTOS</key>
<string>YES_AGGRESSIVE</string>
<key>GCC_WARN_UNUSED_FUNCTION</key>
<string>YES</string>
<key>GCC_WARN_UNUSED_VARIABLE</key>
<string>YES</string>
<key>IPHONEOS_DEPLOYMENT_TARGET</key>
<string>8.3</string>
<key>SDKROOT</key>
<string>iphoneos</string>
<key>TARGETED_DEVICE_FAMILY</key>
<string>1,2</string>
<key>VALIDATE_PRODUCT</key>
<string>YES</string>
</dict>
<key>isa</key>
<string>XCBuildConfiguration</string>
<key>name</key>
<string>Release</string>
</dict>
<key>6003F5BF195388D20070C39A</key>
<dict>
<key>buildConfigurations</key>
<array>
<string>6003F5C0195388D20070C39A</string>
<string>6003F5C1195388D20070C39A</string>
</array>
<key>defaultConfigurationIsVisible</key>
<string>0</string>
<key>defaultConfigurationName</key>
<string>Release</string>
<key>isa</key>
<string>XCConfigurationList</string>
</dict>
<key>6003F5C0195388D20070C39A</key>
<dict>
<key>baseConfigurationReference</key>
<string>D7B360498240CB380AFBFDD3</string>
<key>buildSettings</key>
<dict>
<key>ASSETCATALOG_COMPILER_APPICON_NAME</key>
<string>AppIcon</string>
<key>ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME</key>
<string>LaunchImage</string>
<key>GCC_PRECOMPILE_PREFIX_HEADER</key>
<string>YES</string>
<key>GCC_PREFIX_HEADER</key>
<string>GMRefresh/GMRefresh-Prefix.pch</string>
<key>INFOPLIST_FILE</key>
<string>GMRefresh/GMRefresh-Info.plist</string>
<key>MODULE_NAME</key>
<string>ExampleApp</string>
<key>PRODUCT_BUNDLE_IDENTIFIER</key>
<string>org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}</string>
<key>PRODUCT_NAME</key>
<string>$(TARGET_NAME)</string>
<key>WRAPPER_EXTENSION</key>
<string>app</string>
</dict>
<key>isa</key>
<string>XCBuildConfiguration</string>
<key>name</key>
<string>Debug</string>
</dict>
<key>6003F5C1195388D20070C39A</key>
<dict>
<key>baseConfigurationReference</key>
<string>2F69A153C1B9B002E0E117CA</string>
<key>buildSettings</key>
<dict>
<key>ASSETCATALOG_COMPILER_APPICON_NAME</key>
<string>AppIcon</string>
<key>ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME</key>
<string>LaunchImage</string>
<key>GCC_PRECOMPILE_PREFIX_HEADER</key>
<string>YES</string>
<key>GCC_PREFIX_HEADER</key>
<string>GMRefresh/GMRefresh-Prefix.pch</string>
<key>INFOPLIST_FILE</key>
<string>GMRefresh/GMRefresh-Info.plist</string>
<key>MODULE_NAME</key>
<string>ExampleApp</string>
<key>PRODUCT_BUNDLE_IDENTIFIER</key>
<string>org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}</string>
<key>PRODUCT_NAME</key>
<string>$(TARGET_NAME)</string>
<key>WRAPPER_EXTENSION</key>
<string>app</string>
</dict>
<key>isa</key>
<string>XCBuildConfiguration</string>
<key>name</key>
<string>Release</string>
</dict>
<key>6003F5C2195388D20070C39A</key>
<dict>
<key>buildConfigurations</key>
<array>
<string>6003F5C3195388D20070C39A</string>
<string>6003F5C4195388D20070C39A</string>
</array>
<key>defaultConfigurationIsVisible</key>
<string>0</string>
<key>defaultConfigurationName</key>
<string>Release</string>
<key>isa</key>
<string>XCConfigurationList</string>
</dict>
<key>6003F5C3195388D20070C39A</key>
<dict>
<key>baseConfigurationReference</key>
<string>39F84044B9A451BB8835E35B</string>
<key>buildSettings</key>
<dict>
<key>BUNDLE_LOADER</key>
<string>$(TEST_HOST)</string>
<key>FRAMEWORK_SEARCH_PATHS</key>
<array>
<string>$(SDKROOT)/Developer/Library/Frameworks</string>
<string>$(inherited)</string>
<string>$(DEVELOPER_FRAMEWORKS_DIR)</string>
</array>
<key>GCC_PRECOMPILE_PREFIX_HEADER</key>
<string>YES</string>
<key>GCC_PREFIX_HEADER</key>
<string>Tests/Tests-Prefix.pch</string>
<key>GCC_PREPROCESSOR_DEFINITIONS</key>
<array>
<string>DEBUG=1</string>
<string>$(inherited)</string>
</array>
<key>INFOPLIST_FILE</key>
<string>Tests/Tests-Info.plist</string>
<key>PRODUCT_BUNDLE_IDENTIFIER</key>
<string>org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}</string>
<key>PRODUCT_NAME</key>
<string>$(TARGET_NAME)</string>
<key>TEST_HOST</key>
<string>$(BUILT_PRODUCTS_DIR)/GMRefresh_Example.app/GMRefresh_Example</string>
<key>WRAPPER_EXTENSION</key>
<string>xctest</string>
</dict>
<key>isa</key>
<string>XCBuildConfiguration</string>
<key>name</key>
<string>Debug</string>
</dict>
<key>6003F5C4195388D20070C39A</key>
<dict>
<key>baseConfigurationReference</key>
<string>4CE51AD89CB744BB919E4841</string>
<key>buildSettings</key>
<dict>
<key>BUNDLE_LOADER</key>
<string>$(TEST_HOST)</string>
<key>FRAMEWORK_SEARCH_PATHS</key>
<array>
<string>$(SDKROOT)/Developer/Library/Frameworks</string>
<string>$(inherited)</string>
<string>$(DEVELOPER_FRAMEWORKS_DIR)</string>
</array>
<key>GCC_PRECOMPILE_PREFIX_HEADER</key>
<string>YES</string>
<key>GCC_PREFIX_HEADER</key>
<string>Tests/Tests-Prefix.pch</string>
<key>INFOPLIST_FILE</key>
<string>Tests/Tests-Info.plist</string>
<key>PRODUCT_BUNDLE_IDENTIFIER</key>
<string>org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}</string>
<key>PRODUCT_NAME</key>
<string>$(TARGET_NAME)</string>
<key>TEST_HOST</key>
<string>$(BUILT_PRODUCTS_DIR)/GMRefresh_Example.app/GMRefresh_Example</string>
<key>WRAPPER_EXTENSION</key>
<string>xctest</string>
</dict>
<key>isa</key>
<string>XCBuildConfiguration</string>
<key>name</key>
<string>Release</string>
</dict>
<key>606FC2411953D9B200FFA9A0</key>
<dict>
<key>isa</key>
<string>PBXFileReference</string>
<key>lastKnownFileType</key>
<string>sourcecode.c.h</string>
<key>path</key>
<string>Tests-Prefix.pch</string>
<key>sourceTree</key>
<string>&lt;group&gt;</string>
</dict>
<key>60FF7A9C1954A5C5007DD14C</key>
<dict>
<key>children</key>
<array>
<string>F0090C1D186E410B67F5CCF9</string>
<string>A1A85ED1362F0742068438E9</string>
<string>F42776C651DB4979CA86498C</string>
</array>
<key>isa</key>
<string>PBXGroup</string>
<key>name</key>
<string>Podspec Metadata</string>
<key>sourceTree</key>
<string>&lt;group&gt;</string>
</dict>
<key>873B8AEA1B1F5CCA007FD442</key>
<dict>
<key>fileEncoding</key>
<string>4</string>
<key>isa</key>
<string>PBXFileReference</string>
<key>lastKnownFileType</key>
<string>file.storyboard</string>
<key>path</key>
<string>Main.storyboard</string>
<key>sourceTree</key>
<string>&lt;group&gt;</string>
</dict>
<key>873B8AEB1B1F5CCA007FD442</key>
<dict>
<key>fileRef</key>
<string>873B8AEA1B1F5CCA007FD442</string>
<key>isa</key>
<string>PBXBuildFile</string>
</dict>
<key>89D16B3F0E0ABE381CF4A274</key>
<dict>
<key>explicitFileType</key>
<string>wrapper.framework</string>
<key>includeInIndex</key>
<string>0</string>
<key>isa</key>
<string>PBXFileReference</string>
<key>path</key>
<string>Pods_GMRefresh_Tests.framework</string>
<key>sourceTree</key>
<string>BUILT_PRODUCTS_DIR</string>
</dict>
<key>981B00561020C7179B16B39B</key>
<dict>
<key>buildActionMask</key>
<string>2147483647</string>
<key>files</key>
<array/>
<key>inputPaths</key>
<array/>
<key>isa</key>
<string>PBXShellScriptBuildPhase</string>
<key>name</key>
<string>Embed Pods Frameworks</string>
<key>outputPaths</key>
<array/>
<key>runOnlyForDeploymentPostprocessing</key>
<string>0</string>
<key>shellPath</key>
<string>/bin/sh</string>
<key>shellScript</key>
<string>"${SRCROOT}/Pods/Target Support Files/Pods-GMRefresh_Example/Pods-GMRefresh_Example-frameworks.sh"
</string>
<key>showEnvVarsInLog</key>
<string>0</string>
</dict>
<key>9BB56AD5B32170CF2DA618EC</key>
<dict>
<key>buildActionMask</key>
<string>2147483647</string>
<key>files</key>
<array/>
<key>inputPaths</key>
<array/>
<key>isa</key>
<string>PBXShellScriptBuildPhase</string>
<key>name</key>
<string>Copy Pods Resources</string>
<key>outputPaths</key>
<array/>
<key>runOnlyForDeploymentPostprocessing</key>
<string>0</string>
<key>shellPath</key>
<string>/bin/sh</string>
<key>shellScript</key>
<string>"${SRCROOT}/Pods/Target Support Files/Pods-GMRefresh_Example/Pods-GMRefresh_Example-resources.sh"
</string>
<key>showEnvVarsInLog</key>
<string>0</string>
</dict>
<key>A1A85ED1362F0742068438E9</key>
<dict>
<key>includeInIndex</key>
<string>1</string>
<key>isa</key>
<string>PBXFileReference</string>
<key>name</key>
<string>README.md</string>
<key>path</key>
<string>../README.md</string>
<key>sourceTree</key>
<string>&lt;group&gt;</string>
</dict>
<key>C3A8C297F271E47E4AA20353</key>
<dict>
<key>buildActionMask</key>
<string>2147483647</string>
<key>files</key>
<array/>
<key>inputPaths</key>
<array/>
<key>isa</key>
<string>PBXShellScriptBuildPhase</string>
<key>name</key>
<string>Check Pods Manifest.lock</string>
<key>outputPaths</key>
<array/>
<key>runOnlyForDeploymentPostprocessing</key>
<string>0</string>
<key>shellPath</key>
<string>/bin/sh</string>
<key>shellScript</key>
<string>diff "${PODS_ROOT}/../Podfile.lock" "${PODS_ROOT}/Manifest.lock" &gt; /dev/null
if [[ $? != 0 ]] ; then
cat &lt;&lt; EOM
error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.
EOM
exit 1
fi
</string>
<key>showEnvVarsInLog</key>
<string>0</string>
</dict>
<key>D3F45DAD77E81DBF7176F558</key>
<dict>
<key>explicitFileType</key>
<string>wrapper.framework</string>
<key>includeInIndex</key>
<string>0</string>
<key>isa</key>
<string>PBXFileReference</string>
<key>path</key>
<string>Pods_GMRefresh_Example.framework</string>
<key>sourceTree</key>
<string>BUILT_PRODUCTS_DIR</string>
</dict>
<key>D7B360498240CB380AFBFDD3</key>
<dict>
<key>includeInIndex</key>
<string>1</string>
<key>isa</key>
<string>PBXFileReference</string>
<key>lastKnownFileType</key>
<string>text.xcconfig</string>
<key>name</key>
<string>Pods-GMRefresh_Example.debug.xcconfig</string>
<key>path</key>
<string>Pods/Target Support Files/Pods-GMRefresh_Example/Pods-GMRefresh_Example.debug.xcconfig</string>
<key>sourceTree</key>
<string>&lt;group&gt;</string>
</dict>
<key>EF09AB50850735E3C2B7714F</key>
<dict>
<key>buildActionMask</key>
<string>2147483647</string>
<key>files</key>
<array/>
<key>inputPaths</key>
<array/>
<key>isa</key>
<string>PBXShellScriptBuildPhase</string>
<key>name</key>
<string>Embed Pods Frameworks</string>
<key>outputPaths</key>
<array/>
<key>runOnlyForDeploymentPostprocessing</key>
<string>0</string>
<key>shellPath</key>
<string>/bin/sh</string>
<key>shellScript</key>
<string>"${SRCROOT}/Pods/Target Support Files/Pods-GMRefresh_Tests/Pods-GMRefresh_Tests-frameworks.sh"
</string>
<key>showEnvVarsInLog</key>
<string>0</string>
</dict>
<key>F0090C1D186E410B67F5CCF9</key>
<dict>
<key>includeInIndex</key>
<string>1</string>
<key>isa</key>
<string>PBXFileReference</string>
<key>name</key>
<string>GMRefresh.podspec</string>
<key>path</key>
<string>../GMRefresh.podspec</string>
<key>sourceTree</key>
<string>&lt;group&gt;</string>
</dict>
<key>F42776C651DB4979CA86498C</key>
<dict>
<key>includeInIndex</key>
<string>1</string>
<key>isa</key>
<string>PBXFileReference</string>
<key>name</key>
<string>LICENSE</string>
<key>path</key>
<string>../LICENSE</string>
<key>sourceTree</key>
<string>&lt;group&gt;</string>
</dict>
<key>F5A61F1C2113761CA10F4743</key>
<dict>
<key>buildActionMask</key>
<string>2147483647</string>
<key>files</key>
<array/>
<key>inputPaths</key>
<array/>
<key>isa</key>
<string>PBXShellScriptBuildPhase</string>
<key>name</key>
<string>Check Pods Manifest.lock</string>
<key>outputPaths</key>
<array/>
<key>runOnlyForDeploymentPostprocessing</key>
<string>0</string>
<key>shellPath</key>
<string>/bin/sh</string>
<key>shellScript</key>
<string>diff "${PODS_ROOT}/../Podfile.lock" "${PODS_ROOT}/Manifest.lock" &gt; /dev/null
if [[ $? != 0 ]] ; then
cat &lt;&lt; EOM
error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.
EOM
exit 1
fi
</string>
<key>showEnvVarsInLog</key>
<string>0</string>
</dict>
<key>FF7555122DDECEDD183B1CCF</key>
<dict>
<key>buildActionMask</key>
<string>2147483647</string>
<key>files</key>
<array/>
<key>inputPaths</key>
<array/>
<key>isa</key>
<string>PBXShellScriptBuildPhase</string>
<key>name</key>
<string>Copy Pods Resources</string>
<key>outputPaths</key>
<array/>
<key>runOnlyForDeploymentPostprocessing</key>
<string>0</string>
<key>shellPath</key>
<string>/bin/sh</string>
<key>shellScript</key>
<string>"${SRCROOT}/Pods/Target Support Files/Pods-GMRefresh_Tests/Pods-GMRefresh_Tests-resources.sh"
</string>
<key>showEnvVarsInLog</key>
<string>0</string>
</dict>
</dict>
<key>rootObject</key>
<string>6003F582195388D10070C39A</string>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:GMRefresh.xcodeproj">
</FileRef>
<FileRef
location = "group:Pods/Pods.xcodeproj">
</FileRef>
</Workspace>
//
// GMTableViewController.h
// GMRefresh
//
// Created by wangyang on 16/5/3.
// Copyright © 2016年 wangyang. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface GMTableViewController : UITableViewController
@end
//
// GMTableViewController.m
// GMRefresh
//
// Created by wangyang on 16/5/3.
// Copyright © 2016年 wangyang. All rights reserved.
//
#import "GMTableViewController.h"
#import <GMRefresh/GMRefreshHeader.h>
#import <GMRefresh/GMRefreshFooter.h>
@interface GMTableViewController ()
@end
@implementation GMTableViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.tableView.mj_header = [GMRefreshHeader headerWithRefreshingTarget:self refreshingAction:@selector(loadNewData)];
GMRefreshFooter *footer = [GMRefreshFooter footerWithRefreshingTarget:self refreshingAction:@selector(loadNewData)];
self.tableView.mj_footer = footer;
}
- (void)loadNewData {
}
@end
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="7706" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="whP-gf-Uak"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10116" systemVersion="15E65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="fLh-jI-GTC">
<dependencies> <dependencies>
<deployment identifier="iOS"/> <deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
</dependencies> </dependencies>
<scenes> <scenes>
<!--View Controller--> <!--View Controller-->
...@@ -21,7 +21,128 @@ ...@@ -21,7 +21,128 @@
</viewController> </viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="tc2-Qw-aMS" userLabel="First Responder" sceneMemberID="firstResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="tc2-Qw-aMS" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects> </objects>
<point key="canvasLocation" x="305" y="433"/> <point key="canvasLocation" x="293" y="334"/>
</scene>
<!--Root View Controller-->
<scene sceneID="srq-Bt-RHG">
<objects>
<tableViewController id="a5A-5V-0K1" customClass="GMTableViewController" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="static" style="plain" separatorStyle="default" rowHeight="80" sectionHeaderHeight="28" sectionFooterHeight="28" id="8w1-i4-OFz">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<sections>
<tableViewSection id="vpK-uo-6AT">
<cells>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="kR0-4A-BPh">
<rect key="frame" x="0.0" y="64" width="600" height="80"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="kR0-4A-BPh" id="Pwa-V9-uah">
<rect key="frame" x="0.0" y="0.0" width="600" height="79"/>
<autoresizingMask key="autoresizingMask"/>
</tableViewCellContentView>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="uVX-hy-IUo">
<rect key="frame" x="0.0" y="144" width="600" height="80"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="uVX-hy-IUo" id="aWm-pM-MAW">
<rect key="frame" x="0.0" y="0.0" width="600" height="79"/>
<autoresizingMask key="autoresizingMask"/>
</tableViewCellContentView>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="NEG-Wp-GCC">
<rect key="frame" x="0.0" y="224" width="600" height="80"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="NEG-Wp-GCC" id="z97-MM-z8U">
<rect key="frame" x="0.0" y="0.0" width="600" height="79"/>
<autoresizingMask key="autoresizingMask"/>
</tableViewCellContentView>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="o8P-t9-mum">
<rect key="frame" x="0.0" y="304" width="600" height="80"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="o8P-t9-mum" id="qwi-d1-nOs">
<rect key="frame" x="0.0" y="0.0" width="600" height="79"/>
<autoresizingMask key="autoresizingMask"/>
</tableViewCellContentView>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="UbO-r3-Qc7">
<rect key="frame" x="0.0" y="384" width="600" height="80"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="UbO-r3-Qc7" id="ZOY-bd-XNL">
<rect key="frame" x="0.0" y="0.0" width="600" height="79"/>
<autoresizingMask key="autoresizingMask"/>
</tableViewCellContentView>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="bvA-42-Zyk">
<rect key="frame" x="0.0" y="464" width="600" height="80"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="bvA-42-Zyk" id="Nj0-We-rwd">
<rect key="frame" x="0.0" y="0.0" width="600" height="79"/>
<autoresizingMask key="autoresizingMask"/>
</tableViewCellContentView>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="CEv-gS-u3k">
<rect key="frame" x="0.0" y="544" width="600" height="80"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="CEv-gS-u3k" id="DMg-hA-iyW">
<rect key="frame" x="0.0" y="0.0" width="600" height="79"/>
<autoresizingMask key="autoresizingMask"/>
</tableViewCellContentView>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="G4E-ML-gVD">
<rect key="frame" x="0.0" y="624" width="600" height="80"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="G4E-ML-gVD" id="DLF-i4-LmZ">
<rect key="frame" x="0.0" y="0.0" width="600" height="79"/>
<autoresizingMask key="autoresizingMask"/>
</tableViewCellContentView>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="6Tg-XL-pax">
<rect key="frame" x="0.0" y="704" width="600" height="80"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="6Tg-XL-pax" id="e3v-b3-N3D">
<rect key="frame" x="0.0" y="0.0" width="600" height="79"/>
<autoresizingMask key="autoresizingMask"/>
</tableViewCellContentView>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="PDh-72-fbG">
<rect key="frame" x="0.0" y="784" width="600" height="80"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="PDh-72-fbG" id="WC1-oq-PDH">
<rect key="frame" x="0.0" y="0.0" width="600" height="79"/>
<autoresizingMask key="autoresizingMask"/>
</tableViewCellContentView>
</tableViewCell>
</cells>
</tableViewSection>
</sections>
<connections>
<outlet property="dataSource" destination="a5A-5V-0K1" id="5rS-i3-VOT"/>
<outlet property="delegate" destination="a5A-5V-0K1" id="yaW-Tt-wXd"/>
</connections>
</tableView>
<navigationItem key="navigationItem" title="Root View Controller" id="hAB-eN-eAn"/>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="02j-iz-loj" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="892" y="714"/>
</scene>
<!--Navigation Controller-->
<scene sceneID="P2X-D0-55b">
<objects>
<navigationController id="fLh-jI-GTC" sceneMemberID="viewController">
<navigationBar key="navigationBar" contentMode="scaleToFill" id="bXn-0F-Af8">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<connections>
<segue destination="a5A-5V-0K1" kind="relationship" relationship="rootViewController" id="9sh-PP-Gqd"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="2Jh-Hj-0k1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="72" y="714"/>
</scene> </scene>
</scenes> </scenes>
</document> </document>
PODS:
- GMRefresh (0.1.0):
- MJRefresh (~> 3.1.0)
- MJRefresh (3.1.0)
DEPENDENCIES:
- GMRefresh (from `../`)
EXTERNAL SOURCES:
GMRefresh:
:path: "../"
SPEC CHECKSUMS:
GMRefresh: fc60ee05785ff73b535d5b933e1c7f13cdd6ede0
MJRefresh: 743e6404967d1c2c688472ea3ecfde247d872db4
COCOAPODS: 0.39.0
../../../../../GMRefresh/Classes/GMRefresh.h
\ No newline at end of file
../../../../../GMRefresh/Classes/GMRefreshConstant.h
\ No newline at end of file
../../../../../GMRefresh/Classes/GMRefreshFooter.h
\ No newline at end of file
../../../../../GMRefresh/Classes/GMRefreshHeader.h
\ No newline at end of file
../../../MJRefresh/MJRefresh/MJRefresh.h
\ No newline at end of file
../../../MJRefresh/MJRefresh/Base/MJRefreshAutoFooter.h
\ No newline at end of file
../../../MJRefresh/MJRefresh/Custom/Footer/Auto/MJRefreshAutoGifFooter.h
\ No newline at end of file
../../../MJRefresh/MJRefresh/Custom/Footer/Auto/MJRefreshAutoNormalFooter.h
\ No newline at end of file
../../../MJRefresh/MJRefresh/Custom/Footer/Auto/MJRefreshAutoStateFooter.h
\ No newline at end of file
../../../MJRefresh/MJRefresh/Base/MJRefreshBackFooter.h
\ No newline at end of file
../../../MJRefresh/MJRefresh/Custom/Footer/Back/MJRefreshBackGifFooter.h
\ No newline at end of file
../../../MJRefresh/MJRefresh/Custom/Footer/Back/MJRefreshBackNormalFooter.h
\ No newline at end of file
../../../MJRefresh/MJRefresh/Custom/Footer/Back/MJRefreshBackStateFooter.h
\ No newline at end of file
../../../MJRefresh/MJRefresh/Base/MJRefreshComponent.h
\ No newline at end of file
../../../MJRefresh/MJRefresh/MJRefreshConst.h
\ No newline at end of file
../../../MJRefresh/MJRefresh/Base/MJRefreshFooter.h
\ No newline at end of file
../../../MJRefresh/MJRefresh/Custom/Header/MJRefreshGifHeader.h
\ No newline at end of file
../../../MJRefresh/MJRefresh/Base/MJRefreshHeader.h
\ No newline at end of file
../../../MJRefresh/MJRefresh/Custom/Header/MJRefreshNormalHeader.h
\ No newline at end of file
../../../MJRefresh/MJRefresh/Custom/Header/MJRefreshStateHeader.h
\ No newline at end of file
../../../MJRefresh/MJRefresh/UIScrollView+MJExtension.h
\ No newline at end of file
../../../MJRefresh/MJRefresh/UIScrollView+MJRefresh.h
\ No newline at end of file
../../../MJRefresh/MJRefresh/UIView+MJExtension.h
\ No newline at end of file
{
"name": "GMRefresh",
"version": "0.1.0",
"summary": "A short description of GMRefresh.",
"homepage": "https://github.com/<GITHUB_USERNAME>/GMRefresh",
"license": "MIT",
"authors": {
"wangyang": "wangyang@wanmeizhensuo.com"
},
"source": {
"git": "https://github.com/<GITHUB_USERNAME>/GMRefresh.git",
"tag": "0.1.0"
},
"platforms": {
"ios": "8.0"
},
"dependencies": {
"MJRefresh": [
"~> 3.1.0"
]
},
"source_files": "GMRefresh/Classes/**/*",
"resource_bundles": {
"GMRefresh": [
"GMRefresh/Assets/*.png"
]
}
}
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.
//
// MJRefreshAutoFooter.h
// MJRefreshExample
//
// Created by MJ Lee on 15/4/24.
// Copyright (c) 2015年 小码哥. All rights reserved.
//
#import "MJRefreshFooter.h"
@interface MJRefreshAutoFooter : MJRefreshFooter
/** 是否自动刷新(默认为YES) */
@property (assign, nonatomic, getter=isAutomaticallyRefresh) BOOL automaticallyRefresh;
/** 当底部控件出现多少时就自动刷新(默认为1.0,也就是底部控件完全出现时,才会自动刷新) */
@property (assign, nonatomic) CGFloat appearencePercentTriggerAutoRefresh MJRefreshDeprecated("请使用automaticallyChangeAlpha属性");
/** 当底部控件出现多少时就自动刷新(默认为1.0,也就是底部控件完全出现时,才会自动刷新) */
@property (assign, nonatomic) CGFloat triggerAutomaticallyRefreshPercent;
@end
//
// MJRefreshAutoFooter.m
// MJRefreshExample
//
// Created by MJ Lee on 15/4/24.
// Copyright (c) 2015年 小码哥. All rights reserved.
//
#import "MJRefreshAutoFooter.h"
@interface MJRefreshAutoFooter()
@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;
} else { // 被移除了
if (self.hidden == NO) {
self.scrollView.mj_insetB -= self.mj_h;
}
}
}
#pragma mark - 过期方法
- (void)setAppearencePercentTriggerAutoRefresh:(CGFloat)appearencePercentTriggerAutoRefresh
{
self.triggerAutomaticallyRefreshPercent = appearencePercentTriggerAutoRefresh;
}
- (CGFloat)appearencePercentTriggerAutoRefresh
{
return self.triggerAutomaticallyRefreshPercent;
}
#pragma mark - 实现父类的方法
- (void)prepare
{
[super prepare];
// 默认底部控件100%出现时才会自动刷新
self.triggerAutomaticallyRefreshPercent = 1.0;
// 设置为默认状态
self.automaticallyRefresh = YES;
}
- (void)scrollViewContentSizeDidChange:(NSDictionary *)change
{
[super scrollViewContentSizeDidChange:change];
// 设置位置
self.mj_y = self.scrollView.mj_contentH;
}
- (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;
// 当底部刷新控件完全出现时,才刷新
[self beginRefreshing];
}
}
}
- (void)scrollViewPanStateDidChange:(NSDictionary *)change
{
[super scrollViewPanStateDidChange:change];
if (self.state != MJRefreshStateIdle) return;
if (_scrollView.panGestureRecognizer.state == UIGestureRecognizerStateEnded) {// 手松开
if (_scrollView.mj_insetT + _scrollView.mj_contentH <= _scrollView.mj_h) { // 不够一个屏幕
if (_scrollView.mj_offsetY >= - _scrollView.mj_insetT) { // 向上拽
[self beginRefreshing];
}
} else { // 超出一个屏幕
if (_scrollView.mj_offsetY >= _scrollView.mj_contentH + _scrollView.mj_insetB - _scrollView.mj_h) {
[self beginRefreshing];
}
}
}
}
- (void)setState:(MJRefreshState)state
{
MJRefreshCheckState
if (state == MJRefreshStateRefreshing) {
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[self executeRefreshingCallback];
});
}
}
- (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;
}
}
@end
//
// MJRefreshBackFooter.h
// MJRefreshExample
//
// Created by MJ Lee on 15/4/24.
// Copyright (c) 2015年 小码哥. All rights reserved.
//
#import "MJRefreshFooter.h"
@interface MJRefreshBackFooter : MJRefreshFooter
@end
//
// MJRefreshBackFooter.m
// MJRefreshExample
//
// Created by MJ Lee on 15/4/24.
// Copyright (c) 2015年 小码哥. All rights reserved.
//
#import "MJRefreshBackFooter.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.contentInset;
// 当前的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];
// 内容的高度
CGFloat contentHeight = self.scrollView.mj_contentH + self.ignoredScrollViewContentInsetBottom;
// 表格的高度
CGFloat scrollHeight = self.scrollView.mj_h - self.scrollViewOriginalInset.top - self.scrollViewOriginalInset.bottom + self.ignoredScrollViewContentInsetBottom;
// 设置位置和尺寸
self.mj_y = MAX(contentHeight, scrollHeight);
}
- (void)setState:(MJRefreshState)state
{
MJRefreshCheckState
// 根据状态来设置属性
if (state == MJRefreshStateNoMoreData || state == MJRefreshStateIdle) {
// 刷新完毕
if (MJRefreshStateRefreshing == oldState) {
[UIView animateWithDuration:MJRefreshSlowAnimationDuration animations:^{
self.scrollView.mj_insetB -= self.lastBottomDelta;
// 自动调整透明度
if (self.isAutomaticallyChangeAlpha) self.alpha = 0.0;
} completion:^(BOOL finished) {
self.pullingPercent = 0.0;
}];
}
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:MJRefreshFastAnimationDuration 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 - 公共方法
- (void)endRefreshing
{
if ([self.scrollView isKindOfClass:[UICollectionView class]]) {
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[super endRefreshing];
});
} else {
[super endRefreshing];
}
}
- (void)noticeNoMoreData
{
if ([self.scrollView isKindOfClass:[UICollectionView class]]) {
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[super noticeNoMoreData];
});
} else {
[super noticeNoMoreData];
}
}
#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
// 代码地址: https://github.com/CoderMJLee/MJRefresh
// 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000
// MJRefreshComponent.h
// MJRefreshExample
//
// Created by MJ Lee on 15/3/4.
// Copyright (c) 2015年 小码哥. All rights reserved.
// 刷新控件的基类
#import <UIKit/UIKit.h>
#import "MJRefreshConst.h"
#import "UIView+MJExtension.h"
#import "UIScrollView+MJExtension.h"
#import "UIScrollView+MJRefresh.h"
/** 刷新控件的状态 */
typedef NS_ENUM(NSInteger, MJRefreshState) {
/** 普通闲置状态 */
MJRefreshStateIdle = 1,
/** 松开就可以进行刷新的状态 */
MJRefreshStatePulling,
/** 正在刷新中的状态 */
MJRefreshStateRefreshing,
/** 即将刷新的状态 */
MJRefreshStateWillRefresh,
/** 所有数据加载完毕,没有更多的数据了 */
MJRefreshStateNoMoreData
};
/** 进入刷新状态的回调 */
typedef void (^MJRefreshComponentRefreshingBlock)();
/** 刷新控件的基类 */
@interface MJRefreshComponent : UIView
{
/** 记录scrollView刚开始的inset */
UIEdgeInsets _scrollViewOriginalInset;
/** 父控件 */
__weak UIScrollView *_scrollView;
}
#pragma mark - 刷新回调
/** 正在刷新的回调 */
@property (copy, nonatomic) MJRefreshComponentRefreshingBlock 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)endRefreshing;
/** 是否正在刷新 */
- (BOOL)isRefreshing;
/** 刷新状态 一般交给子类内部实现 */
@property (assign, nonatomic) MJRefreshState state;
#pragma mark - 交给子类去访问
/** 记录scrollView刚开始的inset */
@property (assign, nonatomic, readonly) UIEdgeInsets scrollViewOriginalInset;
/** 父控件 */
@property (weak, nonatomic, readonly) UIScrollView *scrollView;
#pragma mark - 交给子类们去实现
/** 初始化 */
- (void)prepare NS_REQUIRES_SUPER;
/** 摆放子控件frame */
- (void)placeSubviews NS_REQUIRES_SUPER;
/** 当scrollView的contentOffset发生改变的时候调用 */
- (void)scrollViewContentOffsetDidChange:(NSDictionary *)change NS_REQUIRES_SUPER;
/** 当scrollView的contentSize发生改变的时候调用 */
- (void)scrollViewContentSizeDidChange:(NSDictionary *)change NS_REQUIRES_SUPER;
/** 当scrollView的拖拽状态发生改变的时候调用 */
- (void)scrollViewPanStateDidChange:(NSDictionary *)change 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)label;
@end
// 代码地址: https://github.com/CoderMJLee/MJRefresh
// 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000
// MJRefreshComponent.m
// MJRefreshExample
//
// Created by MJ Lee on 15/3/4.
// Copyright (c) 2015年 小码哥. All rights reserved.
//
#import "MJRefreshComponent.h"
#import "MJRefreshConst.h"
#import "UIView+MJExtension.h"
#import "UIScrollView+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;
}
return self;
}
- (void)prepare
{
// 基本属性
self.autoresizingMask = UIViewAutoresizingFlexibleWidth;
self.backgroundColor = [UIColor clearColor];
}
- (void)layoutSubviews
{
[super layoutSubviews];
[self placeSubviews];
}
- (void)placeSubviews{}
- (void)willMoveToSuperview:(UIView *)newSuperview
{
[super willMoveToSuperview:newSuperview];
// 如果不是UIScrollView,不做任何事情
if (newSuperview && ![newSuperview isKindOfClass:[UIScrollView class]]) return;
// 旧的父控件移除监听
[self removeObservers];
if (newSuperview) { // 新的父控件
// 设置宽度
self.mj_w = newSuperview.mj_w;
// 设置位置
self.mj_x = 0;
// 记录UIScrollView
_scrollView = (UIScrollView *)newSuperview;
// 设置永远支持垂直弹簧效果
_scrollView.alwaysBounceVertical = YES;
// 记录UIScrollView最开始的contentInset
_scrollViewOriginalInset = _scrollView.contentInset;
// 添加监听
[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];
}
- (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{}
#pragma mark - 公共方法
#pragma mark 设置回调对象和回调方法
- (void)setRefreshingTarget:(id)target refreshingAction:(SEL)action
{
self.refreshingTarget = target;
self.refreshingAction = action;
}
#pragma mark 进入刷新状态
- (void)beginRefreshing
{
[UIView animateWithDuration:MJRefreshFastAnimationDuration animations:^{
self.alpha = 1.0;
}];
self.pullingPercent = 1.0;
// 只要正在刷新,就完全显示
if (self.window) {
self.state = MJRefreshStateRefreshing;
} else {
self.state = MJRefreshStateWillRefresh;
// 刷新(预防从另一个控制器回到这个控制器的情况,回来要重新刷新一下)
[self setNeedsDisplay];
}
}
#pragma mark 结束刷新状态
- (void)endRefreshing
{
self.state = MJRefreshStateIdle;
}
#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
{
dispatch_async(dispatch_get_main_queue(), ^{
if (self.refreshingBlock) {
self.refreshingBlock();
}
if ([self.refreshingTarget respondsToSelector:self.refreshingAction]) {
MJRefreshMsgSend(MJRefreshMsgTarget(self.refreshingTarget), self.refreshingAction, self);
}
});
}
@end
@implementation UILabel(MJRefresh)
+ (instancetype)label
{
UILabel *label = [[self alloc] init];
label.font = MJRefreshLabelFont;
label.textColor = MJRefreshLabelTextColor;
label.autoresizingMask = UIViewAutoresizingFlexibleWidth;
label.textAlignment = NSTextAlignmentCenter;
label.backgroundColor = [UIColor clearColor];
return label;
}
@end
\ No newline at end of file
// 代码地址: https://github.com/CoderMJLee/MJRefresh
// 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000
// MJRefreshFooter.h
// MJRefreshExample
//
// Created by MJ Lee on 15/3/5.
// Copyright (c) 2015年 小码哥. All rights reserved.
// 上拉刷新控件
#import "MJRefreshComponent.h"
@interface MJRefreshFooter : MJRefreshComponent
/** 创建footer */
+ (instancetype)footerWithRefreshingBlock:(MJRefreshComponentRefreshingBlock)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;
@end
// 代码地址: https://github.com/CoderMJLee/MJRefresh
// 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000
// MJRefreshFooter.m
// MJRefreshExample
//
// Created by MJ Lee on 15/3/5.
// Copyright (c) 2015年 小码哥. All rights reserved.
//
#import "MJRefreshFooter.h"
@interface MJRefreshFooter()
@end
@implementation MJRefreshFooter
#pragma mark - 构造方法
+ (instancetype)footerWithRefreshingBlock:(MJRefreshComponentRefreshingBlock)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;
}
- (void)willMoveToSuperview:(UIView *)newSuperview
{
[super willMoveToSuperview:newSuperview];
if (newSuperview) {
// 监听scrollView数据的变化
if ([self.scrollView isKindOfClass:[UITableView class]] || [self.scrollView isKindOfClass:[UICollectionView class]]) {
[self.scrollView setMj_reloadDataBlock:^(NSInteger totalDataCount) {
if (self.isAutomaticallyHidden) {
self.hidden = (totalDataCount == 0);
}
}];
}
}
}
#pragma mark - 公共方法
- (void)endRefreshingWithNoMoreData
{
self.state = MJRefreshStateNoMoreData;
}
- (void)noticeNoMoreData
{
[self endRefreshingWithNoMoreData];
}
- (void)resetNoMoreData
{
self.state = MJRefreshStateIdle;
}
@end
// 代码地址: https://github.com/CoderMJLee/MJRefresh
// 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000
// MJRefreshHeader.h
// MJRefreshExample
//
// Created by MJ Lee on 15/3/4.
// Copyright (c) 2015年 小码哥. All rights reserved.
// 下拉刷新控件:负责监控用户下拉的状态
#import "MJRefreshComponent.h"
@interface MJRefreshHeader : MJRefreshComponent
/** 创建header */
+ (instancetype)headerWithRefreshingBlock:(MJRefreshComponentRefreshingBlock)refreshingBlock;
/** 创建header */
+ (instancetype)headerWithRefreshingTarget:(id)target refreshingAction:(SEL)action;
/** 这个key用来存储上一次下拉刷新成功的时间 */
@property (copy, nonatomic) NSString *lastUpdatedTimeKey;
/** 上一次下拉刷新成功的时间 */
@property (strong, nonatomic, readonly) NSDate *lastUpdatedTime;
/** 忽略多少scrollView的contentInset的top */
@property (assign, nonatomic) CGFloat ignoredScrollViewContentInsetTop;
@end
// 代码地址: https://github.com/CoderMJLee/MJRefresh
// 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000
// MJRefreshHeader.m
// MJRefreshExample
//
// Created by MJ Lee on 15/3/4.
// Copyright (c) 2015年 小码哥. All rights reserved.
//
#import "MJRefreshHeader.h"
@interface MJRefreshHeader()
@property (assign, nonatomic) CGFloat insetTDelta;
@end
@implementation MJRefreshHeader
#pragma mark - 构造方法
+ (instancetype)headerWithRefreshingBlock:(MJRefreshComponentRefreshingBlock)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)scrollViewContentOffsetDidChange:(NSDictionary *)change
{
[super scrollViewContentOffsetDidChange:change];
// 在刷新的refreshing状态
if (self.state == MJRefreshStateRefreshing) {
if (self.window == nil) 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.scrollView.mj_insetT = insetT;
self.insetTDelta = _scrollViewOriginalInset.top - insetT;
return;
}
// 跳转到下一个控制器时,contentInset可能会变
_scrollViewOriginalInset = self.scrollView.contentInset;
// 当前的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;
// 保存刷新时间
[[NSUserDefaults standardUserDefaults] setObject:[NSDate date] forKey:self.lastUpdatedTimeKey];
[[NSUserDefaults standardUserDefaults] synchronize];
// 恢复inset和offset
[UIView animateWithDuration:MJRefreshSlowAnimationDuration animations:^{
self.scrollView.mj_insetT += self.insetTDelta;
// 自动调整透明度
if (self.isAutomaticallyChangeAlpha) self.alpha = 0.0;
} completion:^(BOOL finished) {
self.pullingPercent = 0.0;
}];
} else if (state == MJRefreshStateRefreshing) {
[UIView animateWithDuration:MJRefreshFastAnimationDuration animations:^{
// 增加滚动区域
CGFloat top = self.scrollViewOriginalInset.top + self.mj_h;
self.scrollView.mj_insetT = top;
// 设置滚动位置
self.scrollView.mj_offsetY = - top;
} completion:^(BOOL finished) {
[self executeRefreshingCallback];
}];
}
}
- (void)drawRect:(CGRect)rect
{
[super drawRect:rect];
}
#pragma mark - 公共方法
- (void)endRefreshing
{
if ([self.scrollView isKindOfClass:[UICollectionView class]]) {
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[super endRefreshing];
});
} else {
[super endRefreshing];
}
}
- (NSDate *)lastUpdatedTime
{
return [[NSUserDefaults standardUserDefaults] objectForKey:self.lastUpdatedTimeKey];
}
@end
//
// MJRefreshAutoGifFooter.h
// MJRefreshExample
//
// Created by MJ Lee on 15/4/24.
// Copyright (c) 2015年 小码哥. All rights reserved.
//
#import "MJRefreshAutoStateFooter.h"
@interface MJRefreshAutoGifFooter : MJRefreshAutoStateFooter
@property (weak, nonatomic, readonly) UIImageView *gifView;
/** 设置state状态下的动画图片images 动画持续时间duration*/
- (void)setImages:(NSArray *)images duration:(NSTimeInterval)duration forState:(MJRefreshState)state;
- (void)setImages:(NSArray *)images forState:(MJRefreshState)state;
@end
//
// MJRefreshAutoGifFooter.m
// MJRefreshExample
//
// Created by MJ Lee on 15/4/24.
// Copyright (c) 2015年 小码哥. All rights reserved.
//
#import "MJRefreshAutoGifFooter.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 - 公共方法
- (void)setImages:(NSArray *)images duration:(NSTimeInterval)duration forState:(MJRefreshState)state
{
if (images == nil) return;
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;
}
}
- (void)setImages:(NSArray *)images forState:(MJRefreshState)state
{
[self setImages:images duration:images.count * 0.1 forState:state];
}
#pragma mark - 实现父类的方法
- (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 - 90;
}
}
- (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;
}
}
@end
//
// MJRefreshAutoNormalFooter.h
// MJRefreshExample
//
// Created by MJ Lee on 15/4/24.
// Copyright (c) 2015年 小码哥. All rights reserved.
//
#import "MJRefreshAutoStateFooter.h"
@interface MJRefreshAutoNormalFooter : MJRefreshAutoStateFooter
/** 菊花的样式 */
@property (assign, nonatomic) UIActivityIndicatorViewStyle activityIndicatorViewStyle;
@end
//
// MJRefreshAutoNormalFooter.m
// MJRefreshExample
//
// Created by MJ Lee on 15/4/24.
// Copyright (c) 2015年 小码哥. All rights reserved.
//
#import "MJRefreshAutoNormalFooter.h"
@interface MJRefreshAutoNormalFooter()
@property (weak, nonatomic) UIActivityIndicatorView *loadingView;
@end
@implementation MJRefreshAutoNormalFooter
#pragma mark - 懒加载子控件
- (UIActivityIndicatorView *)loadingView
{
if (!_loadingView) {
UIActivityIndicatorView *loadingView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:self.activityIndicatorViewStyle];
loadingView.hidesWhenStopped = YES;
[self addSubview:_loadingView = loadingView];
}
return _loadingView;
}
- (void)setActivityIndicatorViewStyle:(UIActivityIndicatorViewStyle)activityIndicatorViewStyle
{
_activityIndicatorViewStyle = activityIndicatorViewStyle;
self.loadingView = nil;
[self setNeedsLayout];
}
#pragma makr - 重写父类的方法
- (void)prepare
{
[super prepare];
self.activityIndicatorViewStyle = UIActivityIndicatorViewStyleGray;
}
- (void)placeSubviews
{
[super placeSubviews];
if (self.loadingView.constraints.count) return;
// 圈圈
CGFloat loadingCenterX = self.mj_w * 0.5;
if (!self.isRefreshingTitleHidden) {
loadingCenterX -= 100;
}
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
//
// MJRefreshAutoStateFooter.h
// MJRefreshExample
//
// Created by MJ Lee on 15/6/13.
// Copyright © 2015年 小码哥. All rights reserved.
//
#import "MJRefreshAutoFooter.h"
@interface MJRefreshAutoStateFooter : MJRefreshAutoFooter
/** 显示刷新状态的label */
@property (weak, nonatomic, readonly) UILabel *stateLabel;
/** 设置state状态下的文字 */
- (void)setTitle:(NSString *)title forState:(MJRefreshState)state;
/** 隐藏刷新状态的文字 */
@property (assign, nonatomic, getter=isRefreshingTitleHidden) BOOL refreshingTitleHidden;
@end
//
// MJRefreshAutoStateFooter.m
// MJRefreshExample
//
// Created by MJ Lee on 15/6/13.
// Copyright © 2015年 小码哥. All rights reserved.
//
#import "MJRefreshAutoStateFooter.h"
@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 label]];
}
return _stateLabel;
}
#pragma mark - 公共方法
- (void)setTitle:(NSString *)title forState:(MJRefreshState)state
{
if (title == nil) return;
self.stateTitles[@(state)] = title;
self.stateLabel.text = self.stateTitles[@(self.state)];
}
#pragma mark - 私有方法
- (void)stateLabelClick
{
if (self.state == MJRefreshStateIdle) {
[self beginRefreshing];
}
}
#pragma mark - 重写父类的方法
- (void)prepare
{
[super prepare];
// 初始化文字
[self setTitle:MJRefreshAutoFooterIdleText forState:MJRefreshStateIdle];
[self setTitle:MJRefreshAutoFooterRefreshingText forState:MJRefreshStateRefreshing];
[self setTitle:MJRefreshAutoFooterNoMoreDataText forState:MJRefreshStateNoMoreData];
// 监听label
self.stateLabel.userInteractionEnabled = YES;
[self.stateLabel addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(stateLabelClick)]];
}
- (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)];
}
}
@end
\ No newline at end of file
//
// MJRefreshBackGifFooter.h
// MJRefreshExample
//
// Created by MJ Lee on 15/4/24.
// Copyright (c) 2015年 小码哥. All rights reserved.
//
#import "MJRefreshBackStateFooter.h"
@interface MJRefreshBackGifFooter : MJRefreshBackStateFooter
@property (weak, nonatomic, readonly) UIImageView *gifView;
/** 设置state状态下的动画图片images 动画持续时间duration*/
- (void)setImages:(NSArray *)images duration:(NSTimeInterval)duration forState:(MJRefreshState)state;
- (void)setImages:(NSArray *)images forState:(MJRefreshState)state;
@end
//
// MJRefreshBackGifFooter.m
// MJRefreshExample
//
// Created by MJ Lee on 15/4/24.
// Copyright (c) 2015年 小码哥. All rights reserved.
//
#import "MJRefreshBackGifFooter.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 - 公共方法
- (void)setImages:(NSArray *)images duration:(NSTimeInterval)duration forState:(MJRefreshState)state
{
if (images == nil) return;
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;
}
}
- (void)setImages:(NSArray *)images forState:(MJRefreshState)state
{
[self setImages:images duration:images.count * 0.1 forState:state];
}
#pragma mark - 实现父类的方法
- (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 - 90;
}
}
- (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;
}
}
@end
//
// MJRefreshBackNormalFooter.h
// MJRefreshExample
//
// Created by MJ Lee on 15/4/24.
// Copyright (c) 2015年 小码哥. All rights reserved.
//
#import "MJRefreshBackStateFooter.h"
@interface MJRefreshBackNormalFooter : MJRefreshBackStateFooter
@property (weak, nonatomic, readonly) UIImageView *arrowView;
/** 菊花的样式 */
@property (assign, nonatomic) UIActivityIndicatorViewStyle activityIndicatorViewStyle;
@end
//
// MJRefreshBackNormalFooter.m
// MJRefreshExample
//
// Created by MJ Lee on 15/4/24.
// Copyright (c) 2015年 小码哥. All rights reserved.
//
#import "MJRefreshBackNormalFooter.h"
@interface MJRefreshBackNormalFooter()
{
__unsafe_unretained UIImageView *_arrowView;
}
@property (weak, nonatomic) UIActivityIndicatorView *loadingView;
@end
@implementation MJRefreshBackNormalFooter
#pragma mark - 懒加载子控件
- (UIImageView *)arrowView
{
if (!_arrowView) {
UIImage *image = [UIImage imageNamed:MJRefreshSrcName(@"arrow.png")] ?: [UIImage imageNamed:MJRefreshFrameworkSrcName(@"arrow.png")];
UIImageView *arrowView = [[UIImageView alloc] initWithImage:image];
[self addSubview:_arrowView = arrowView];
}
return _arrowView;
}
- (UIActivityIndicatorView *)loadingView
{
if (!_loadingView) {
UIActivityIndicatorView *loadingView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:self.activityIndicatorViewStyle];
loadingView.hidesWhenStopped = YES;
[self addSubview:_loadingView = loadingView];
}
return _loadingView;
}
- (void)setActivityIndicatorViewStyle:(UIActivityIndicatorViewStyle)activityIndicatorViewStyle
{
_activityIndicatorViewStyle = activityIndicatorViewStyle;
self.loadingView = nil;
[self setNeedsLayout];
}
#pragma makr - 重写父类的方法
- (void)prepare
{
[super prepare];
self.activityIndicatorViewStyle = UIActivityIndicatorViewStyleGray;
}
- (void)placeSubviews
{
[super placeSubviews];
// 箭头的中心点
CGFloat arrowCenterX = self.mj_w * 0.5;
if (!self.stateLabel.hidden) {
arrowCenterX -= 100;
}
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;
}
}
- (void)setState:(MJRefreshState)state
{
MJRefreshCheckState
// 根据状态做事情
if (state == MJRefreshStateIdle) {
if (oldState == MJRefreshStateRefreshing) {
self.arrowView.transform = CGAffineTransformMakeRotation(0.000001 - M_PI);
[UIView animateWithDuration:MJRefreshSlowAnimationDuration animations:^{
self.loadingView.alpha = 0.0;
} completion:^(BOOL finished) {
self.loadingView.alpha = 1.0;
[self.loadingView stopAnimating];
self.arrowView.hidden = NO;
}];
} else {
self.arrowView.hidden = NO;
[self.loadingView stopAnimating];
[UIView animateWithDuration:MJRefreshFastAnimationDuration animations:^{
self.arrowView.transform = CGAffineTransformMakeRotation(0.000001 - M_PI);
}];
}
} else if (state == MJRefreshStatePulling) {
self.arrowView.hidden = NO;
[self.loadingView stopAnimating];
[UIView animateWithDuration:MJRefreshFastAnimationDuration 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];
}
}
@end
//
// MJRefreshBackStateFooter.h
// MJRefreshExample
//
// Created by MJ Lee on 15/6/13.
// Copyright © 2015年 小码哥. All rights reserved.
//
#import "MJRefreshBackFooter.h"
@interface MJRefreshBackStateFooter : MJRefreshBackFooter
/** 显示刷新状态的label */
@property (weak, nonatomic, readonly) UILabel *stateLabel;
/** 设置state状态下的文字 */
- (void)setTitle:(NSString *)title forState:(MJRefreshState)state;
/** 获取state状态下的title */
- (NSString *)titleForState:(MJRefreshState)state;
@end
//
// MJRefreshBackStateFooter.m
// MJRefreshExample
//
// Created by MJ Lee on 15/6/13.
// Copyright © 2015年 小码哥. All rights reserved.
//
#import "MJRefreshBackStateFooter.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 label]];
}
return _stateLabel;
}
#pragma mark - 公共方法
- (void)setTitle:(NSString *)title forState:(MJRefreshState)state
{
if (title == nil) return;
self.stateTitles[@(state)] = title;
self.stateLabel.text = self.stateTitles[@(self.state)];
}
- (NSString *)titleForState:(MJRefreshState)state {
return self.stateTitles[@(state)];
}
#pragma mark - 重写父类的方法
- (void)prepare
{
[super prepare];
// 初始化文字
[self setTitle:MJRefreshBackFooterIdleText forState:MJRefreshStateIdle];
[self setTitle:MJRefreshBackFooterPullingText forState:MJRefreshStatePulling];
[self setTitle:MJRefreshBackFooterRefreshingText forState:MJRefreshStateRefreshing];
[self setTitle:MJRefreshBackFooterNoMoreDataText forState:MJRefreshStateNoMoreData];
}
- (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)];
}
@end
//
// MJRefreshGifHeader.h
// MJRefreshExample
//
// Created by MJ Lee on 15/4/24.
// Copyright (c) 2015年 小码哥. All rights reserved.
//
#import "MJRefreshStateHeader.h"
@interface MJRefreshGifHeader : MJRefreshStateHeader
@property (weak, nonatomic, readonly) UIImageView *gifView;
/** 设置state状态下的动画图片images 动画持续时间duration*/
- (void)setImages:(NSArray *)images duration:(NSTimeInterval)duration forState:(MJRefreshState)state;
- (void)setImages:(NSArray *)images forState:(MJRefreshState)state;
@end
//
// MJRefreshGifHeader.m
// MJRefreshExample
//
// Created by MJ Lee on 15/4/24.
// Copyright (c) 2015年 小码哥. All rights reserved.
//
#import "MJRefreshGifHeader.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 - 公共方法
- (void)setImages:(NSArray *)images duration:(NSTimeInterval)duration forState:(MJRefreshState)state
{
if (images == nil) return;
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;
}
}
- (void)setImages:(NSArray *)images forState:(MJRefreshState)state
{
[self setImages:images duration:images.count * 0.1 forState:state];
}
#pragma mark - 实现父类的方法
- (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;
self.gifView.mj_w = self.mj_w * 0.5 - 90;
}
}
- (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];
}
}
@end
//
// MJRefreshNormalHeader.h
// MJRefreshExample
//
// Created by MJ Lee on 15/4/24.
// Copyright (c) 2015年 小码哥. All rights reserved.
//
#import "MJRefreshStateHeader.h"
@interface MJRefreshNormalHeader : MJRefreshStateHeader
@property (weak, nonatomic, readonly) UIImageView *arrowView;
/** 菊花的样式 */
@property (assign, nonatomic) UIActivityIndicatorViewStyle activityIndicatorViewStyle;
@end
//
// MJRefreshNormalHeader.m
// MJRefreshExample
//
// Created by MJ Lee on 15/4/24.
// Copyright (c) 2015年 小码哥. All rights reserved.
//
#import "MJRefreshNormalHeader.h"
@interface MJRefreshNormalHeader()
{
__unsafe_unretained UIImageView *_arrowView;
}
@property (weak, nonatomic) UIActivityIndicatorView *loadingView;
@end
@implementation MJRefreshNormalHeader
#pragma mark - 懒加载子控件
- (UIImageView *)arrowView
{
if (!_arrowView) {
UIImage *image = [UIImage imageNamed:MJRefreshSrcName(@"arrow.png")] ?: [UIImage imageNamed:MJRefreshFrameworkSrcName(@"arrow.png")];
UIImageView *arrowView = [[UIImageView alloc] initWithImage:image];
[self addSubview:_arrowView = arrowView];
}
return _arrowView;
}
- (UIActivityIndicatorView *)loadingView
{
if (!_loadingView) {
UIActivityIndicatorView *loadingView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:self.activityIndicatorViewStyle];
loadingView.hidesWhenStopped = YES;
[self addSubview:_loadingView = loadingView];
}
return _loadingView;
}
#pragma mark - 公共方法
- (void)setActivityIndicatorViewStyle:(UIActivityIndicatorViewStyle)activityIndicatorViewStyle
{
_activityIndicatorViewStyle = activityIndicatorViewStyle;
self.loadingView = nil;
[self setNeedsLayout];
}
#pragma makr - 重写父类的方法
- (void)prepare
{
[super prepare];
self.activityIndicatorViewStyle = UIActivityIndicatorViewStyleGray;
}
- (void)placeSubviews
{
[super placeSubviews];
// 箭头的中心点
CGFloat arrowCenterX = self.mj_w * 0.5;
if (!self.stateLabel.hidden) {
arrowCenterX -= 100;
}
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;
}
}
- (void)setState:(MJRefreshState)state
{
MJRefreshCheckState
// 根据状态做事情
if (state == MJRefreshStateIdle) {
if (oldState == MJRefreshStateRefreshing) {
self.arrowView.transform = CGAffineTransformIdentity;
[UIView animateWithDuration:MJRefreshSlowAnimationDuration 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:MJRefreshFastAnimationDuration animations:^{
self.arrowView.transform = CGAffineTransformIdentity;
}];
}
} else if (state == MJRefreshStatePulling) {
[self.loadingView stopAnimating];
self.arrowView.hidden = NO;
[UIView animateWithDuration:MJRefreshFastAnimationDuration 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;
}
}
@end
//
// MJRefreshStateHeader.h
// MJRefreshExample
//
// Created by MJ Lee on 15/4/24.
// Copyright (c) 2015年 小码哥. All rights reserved.
//
#import "MJRefreshHeader.h"
@interface MJRefreshStateHeader : MJRefreshHeader
#pragma mark - 刷新时间相关
/** 利用这个block来决定显示的更新时间文字 */
@property (copy, nonatomic) NSString *(^lastUpdatedTimeText)(NSDate *lastUpdatedTime);
/** 显示上一次刷新时间的label */
@property (weak, nonatomic, readonly) UILabel *lastUpdatedTimeLabel;
#pragma mark - 状态相关
/** 显示刷新状态的label */
@property (weak, nonatomic, readonly) UILabel *stateLabel;
/** 设置state状态下的文字 */
- (void)setTitle:(NSString *)title forState:(MJRefreshState)state;
@end
//
// MJRefreshStateHeader.m
// MJRefreshExample
//
// Created by MJ Lee on 15/4/24.
// Copyright (c) 2015年 小码哥. All rights reserved.
//
#import "MJRefreshStateHeader.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 label]];
}
return _stateLabel;
}
- (UILabel *)lastUpdatedTimeLabel
{
if (!_lastUpdatedTimeLabel) {
[self addSubview:_lastUpdatedTimeLabel = [UILabel label]];
}
return _lastUpdatedTimeLabel;
}
#pragma mark - 公共方法
- (void)setTitle:(NSString *)title forState:(MJRefreshState)state
{
if (title == nil) return;
self.stateTitles[@(state)] = title;
self.stateLabel.text = self.stateTitles[@(self.state)];
}
#pragma mark - 日历获取在9.x之后的系统使用currentCalendar会出异常。在8.0之后使用系统新API。
- (NSCalendar *)currentCalendar {
if ([NSCalendar respondsToSelector:@selector(calendarWithIdentifier:)]) {
return [NSCalendar calendarWithIdentifier:NSCalendarIdentifierGregorian];
}
return [NSCalendar currentCalendar];
}
#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 = [self currentCalendar];
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];
if ([cmp1 day] == [cmp2 day]) { // 今天
formatter.dateFormat = @"今天 HH:mm";
} 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:@"最后更新:%@", time];
} else {
self.lastUpdatedTimeLabel.text = @"最后更新:无记录";
}
}
#pragma mark - 覆盖父类的方法
- (void)prepare
{
[super prepare];
// 初始化文字
[self setTitle:MJRefreshHeaderIdleText forState:MJRefreshStateIdle];
[self setTitle:MJRefreshHeaderPullingText forState:MJRefreshStatePulling];
[self setTitle:MJRefreshHeaderRefreshingText forState:MJRefreshStateRefreshing];
}
- (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;
}
@end
// 代码地址: https://github.com/CoderMJLee/MJRefresh
// 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000
#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"
\ No newline at end of file
// 代码地址: https://github.com/CoderMJLee/MJRefresh
// 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000
#import <UIKit/UIKit.h>
#import <objc/message.h>
// 弱引用
#define MJWeakSelf __weak typeof(self) weakSelf = self;
// 日志输出
#ifdef DEBUG
#define MJRefreshLog(...) NSLog(__VA_ARGS__)
#else
#define MJRefreshLog(...)
#endif
// 过期提醒
#define MJRefreshDeprecated(instead) NS_DEPRECATED(2_0, 2_0, 2_0, 2_0, instead)
// 运行时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]
// 图片路径
#define MJRefreshSrcName(file) [@"MJRefresh.bundle" stringByAppendingPathComponent:file]
#define MJRefreshFrameworkSrcName(file) [@"Frameworks/MJRefresh.framework/MJRefresh.bundle" stringByAppendingPathComponent:file]
// 常量
UIKIT_EXTERN const CGFloat MJRefreshHeaderHeight;
UIKIT_EXTERN const CGFloat MJRefreshFooterHeight;
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 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;
// 状态检查
#define MJRefreshCheckState \
MJRefreshState oldState = self.state; \
if (state == oldState) return; \
[super setState:state];
// 代码地址: https://github.com/CoderMJLee/MJRefresh
// 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000
#import <UIKit/UIKit.h>
const CGFloat MJRefreshHeaderHeight = 54.0;
const CGFloat MJRefreshFooterHeight = 44.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 = @"下拉可以刷新";
NSString *const MJRefreshHeaderPullingText = @"松开立即刷新";
NSString *const MJRefreshHeaderRefreshingText = @"正在刷新数据中...";
NSString *const MJRefreshAutoFooterIdleText = @"点击或上拉加载更多";
NSString *const MJRefreshAutoFooterRefreshingText = @"正在加载更多的数据...";
NSString *const MJRefreshAutoFooterNoMoreDataText = @"已经全部加载完毕";
NSString *const MJRefreshBackFooterIdleText = @"上拉可以加载更多";
NSString *const MJRefreshBackFooterPullingText = @"松开立即加载更多";
NSString *const MJRefreshBackFooterRefreshingText = @"正在加载更多的数据...";
NSString *const MJRefreshBackFooterNoMoreDataText = @"已经全部加载完毕";
\ No newline at end of file
// 代码地址: https://github.com/CoderMJLee/MJRefresh
// 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000
// UIScrollView+Extension.h
// MJRefreshExample
//
// Created by MJ Lee on 14-5-28.
// Copyright (c) 2014年 小码哥. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UIScrollView (MJExtension)
@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
// 代码地址: https://github.com/CoderMJLee/MJRefresh
// 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000
// UIScrollView+Extension.m
// MJRefreshExample
//
// Created by MJ Lee on 14-5-28.
// Copyright (c) 2014年 小码哥. All rights reserved.
//
#import "UIScrollView+MJExtension.h"
#import <objc/runtime.h>
@implementation UIScrollView (MJExtension)
- (void)setMj_insetT:(CGFloat)mj_insetT
{
UIEdgeInsets inset = self.contentInset;
inset.top = mj_insetT;
self.contentInset = inset;
}
- (CGFloat)mj_insetT
{
return self.contentInset.top;
}
- (void)setMj_insetB:(CGFloat)mj_insetB
{
UIEdgeInsets inset = self.contentInset;
inset.bottom = mj_insetB;
self.contentInset = inset;
}
- (CGFloat)mj_insetB
{
return self.contentInset.bottom;
}
- (void)setMj_insetL:(CGFloat)mj_insetL
{
UIEdgeInsets inset = self.contentInset;
inset.left = mj_insetL;
self.contentInset = inset;
}
- (CGFloat)mj_insetL
{
return self.contentInset.left;
}
- (void)setMj_insetR:(CGFloat)mj_insetR
{
UIEdgeInsets inset = self.contentInset;
inset.right = mj_insetR;
self.contentInset = inset;
}
- (CGFloat)mj_insetR
{
return self.contentInset.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
// 代码地址: https://github.com/CoderMJLee/MJRefresh
// 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000
// UIScrollView+MJRefresh.h
// MJRefreshExample
//
// Created by MJ Lee on 15/3/4.
// Copyright (c) 2015年 小码哥. All rights reserved.
// 给ScrollView增加下拉刷新、上拉刷新的功能
#import <UIKit/UIKit.h>
#import "MJRefreshConst.h"
@class MJRefreshHeader, MJRefreshFooter;
@interface UIScrollView (MJRefresh)
/** 下拉刷新控件 */
@property (strong, nonatomic) MJRefreshHeader *mj_header;
@property (strong, nonatomic) MJRefreshHeader *header MJRefreshDeprecated("使用mj_header");
/** 上拉刷新控件 */
@property (strong, nonatomic) MJRefreshFooter *mj_footer;
@property (strong, nonatomic) MJRefreshFooter *footer MJRefreshDeprecated("使用mj_footer");
#pragma mark - other
- (NSInteger)mj_totalDataCount;
@property (copy, nonatomic) void (^mj_reloadDataBlock)(NSInteger totalDataCount);
@end
// 代码地址: https://github.com/CoderMJLee/MJRefresh
// 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000
// UIScrollView+MJRefresh.m
// MJRefreshExample
//
// 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 <objc/runtime.h>
@implementation NSObject (MJRefresh)
+ (void)exchangeInstanceMethod1:(SEL)method1 method2:(SEL)method2
{
method_exchangeImplementations(class_getInstanceMethod(self, method1), class_getInstanceMethod(self, method2));
}
+ (void)exchangeClassMethod1:(SEL)method1 method2:(SEL)method2
{
method_exchangeImplementations(class_getClassMethod(self, method1), class_getClassMethod(self, method2));
}
@end
@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];
[self insertSubview:mj_header atIndex:0];
// 存储新的
[self willChangeValueForKey:@"mj_header"]; // KVO
objc_setAssociatedObject(self, &MJRefreshHeaderKey,
mj_header, OBJC_ASSOCIATION_ASSIGN);
[self didChangeValueForKey:@"mj_header"]; // KVO
}
}
- (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];
[self addSubview:mj_footer];
// 存储新的
[self willChangeValueForKey:@"mj_footer"]; // KVO
objc_setAssociatedObject(self, &MJRefreshFooterKey,
mj_footer, OBJC_ASSOCIATION_ASSIGN);
[self didChangeValueForKey:@"mj_footer"]; // KVO
}
}
- (MJRefreshFooter *)mj_footer
{
return objc_getAssociatedObject(self, &MJRefreshFooterKey);
}
#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;
}
static const char MJRefreshReloadDataBlockKey = '\0';
- (void)setMj_reloadDataBlock:(void (^)(NSInteger))mj_reloadDataBlock
{
[self willChangeValueForKey:@"mj_reloadDataBlock"]; // KVO
objc_setAssociatedObject(self, &MJRefreshReloadDataBlockKey, mj_reloadDataBlock, OBJC_ASSOCIATION_COPY_NONATOMIC);
[self didChangeValueForKey:@"mj_reloadDataBlock"]; // KVO
}
- (void (^)(NSInteger))mj_reloadDataBlock
{
return objc_getAssociatedObject(self, &MJRefreshReloadDataBlockKey);
}
- (void)executeReloadDataBlock
{
!self.mj_reloadDataBlock ? : self.mj_reloadDataBlock(self.mj_totalDataCount);
}
@end
@implementation UITableView (MJRefresh)
+ (void)load
{
[self exchangeInstanceMethod1:@selector(reloadData) method2:@selector(mj_reloadData)];
}
- (void)mj_reloadData
{
[self mj_reloadData];
[self executeReloadDataBlock];
}
@end
@implementation UICollectionView (MJRefresh)
+ (void)load
{
[self exchangeInstanceMethod1:@selector(reloadData) method2:@selector(mj_reloadData)];
}
- (void)mj_reloadData
{
[self mj_reloadData];
[self executeReloadDataBlock];
}
@end
// 代码地址: https://github.com/CoderMJLee/MJRefresh
// 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000
// UIView+Extension.h
// MJRefreshExample
//
// Created by MJ Lee on 14-5-28.
// Copyright (c) 2014年 小码哥. All rights reserved.
//
#import <UIKit/UIKit.h>
@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
// 代码地址: https://github.com/CoderMJLee/MJRefresh
// 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000
// UIView+Extension.m
// MJRefreshExample
//
// 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
![(logo)](http://images.cnitblog.com/blog2015/497279/201505/051004492043385.png)
## MJRefresh
* An easy way to use pull-to-refresh
* 用法简单的下拉刷新框架:一行代码搞定
## Contents
* Getting Started
* [Features【支持哪些控件的刷新】](#支持哪些控件的刷新)
* [Installation【如何使用MJRefresh】](#如何使用MJRefresh)
* [Who's using【已经超过上百个App正在使用MJRefresh】](#已经超过上百个App正在使用MJRefresh)
* [Classes【MJRefresh类结构图】](#MJRefresh类结构图)
* 常见API
* [MJRefreshComponent.h](#MJRefreshComponent.h)
* [MJRefreshHeader.h](#MJRefreshHeader.h)
* [MJRefreshFooter.h](#MJRefreshFooter.h)
* [MJRefreshAutoFooter.h](#MJRefreshAutoFooter.h)
* Examples
* [Reference【参考】](#参考)
* [下拉刷新01-默认](#下拉刷新01-默认)
* [下拉刷新02-动画图片](#下拉刷新02-动画图片)
* [下拉刷新03-隐藏时间](#下拉刷新03-隐藏时间)
* [下拉刷新04-隐藏状态和时间](#下拉刷新04-隐藏状态和时间)
* [下拉刷新05-自定义文字](#下拉刷新05-自定义文字)
* [下拉刷新06-自定义刷新控件](#下拉刷新06-自定义刷新控件)
* [上拉刷新01-默认](#上拉刷新01-默认)
* [上拉刷新02-动画图片](#上拉刷新02-动画图片)
* [上拉刷新03-隐藏刷新状态的文字](#上拉刷新03-隐藏刷新状态的文字)
* [上拉刷新04-全部加载完毕](#上拉刷新04-全部加载完毕)
* [上拉刷新05-自定义文字](#上拉刷新05-自定义文字)
* [上拉刷新06-加载后隐藏](#上拉刷新06-加载后隐藏)
* [上拉刷新07-自动回弹的上拉01](#上拉刷新07-自动回弹的上拉01)
* [上拉刷新08-自动回弹的上拉02](#上拉刷新08-自动回弹的上拉02)
* [上拉刷新09-自定义刷新控件(自动刷新)](#上拉刷新09-自定义刷新控件(自动刷新))
* [上拉刷新10-自定义刷新控件(自动回弹)](#上拉刷新10-自定义刷新控件(自动回弹))
* [UICollectionView01-上下拉刷新](#UICollectionView01-上下拉刷新)
* [UIWebView01-下拉刷新](#UIWebView01-下拉刷新)
* [期待](#期待)
## <a id="支持哪些控件的刷新"></a>支持哪些控件的刷新
* `UIScrollView``UITableView``UICollectionView``UIWebView`
## <a id="如何使用MJRefresh"></a>如何使用MJRefresh
* cocoapods导入:`pod 'MJRefresh'`
* 手动导入:
*`MJRefresh`文件夹中的所有文件拽入项目中
* 导入主头文件:`#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="已经超过上百个App正在使用MJRefresh"></a>已经超过上百个App正在使用MJRefresh
<img src="http://images0.cnblogs.com/blog2015/497279/201506/141212365041650.png" width="200" height="300">
* 更多App信息可以关注:[M了个J-博客园](http://www.cnblogs.com/mjios/p/4409853.html)
## <a id="MJRefresh类结构图"></a>MJRefresh类结构图
![](http://images0.cnblogs.com/blog2015/497279/201506/132232456139177.png)
- 图中`红色文字的类`:可以直接拿来用
- 下拉刷新控件的种类
- 默认(Normal):`MJRefreshNormalHeader`
- 动图(Gif):`MJRefreshGifHeader`
- 上拉刷新控件的种类
- 自动刷新(Auto)
- 默认(Normal):`MJRefreshAutoNormalFooter`
- 动图(Gif):`MJRefreshAutoGifFooter`
- 自动回弹(Back)
- 默认(Normal):`MJRefreshBackNormalFooter`
- 动图(Gif):`MJRefreshBackGifFooter`
- 图中`非红色文字的类`:拿来继承,用于自定义刷新控件
- 关于如何自定义刷新控件,可以参考下图的类<br>
<img src="http://images0.cnblogs.com/blog2015/497279/201506/141358159107893.png" width="30%" height="30%">
## <a id="MJRefreshComponent.h"></a>MJRefreshComponent.h
```objc
/** 刷新控件的基类 */
@interface MJRefreshComponent : UIView
#pragma mark - 刷新状态控制
/** 进入刷新状态 */
- (void)beginRefreshing;
/** 结束刷新状态 */
- (void)endRefreshing;
/** 是否正在刷新 */
- (BOOL)isRefreshing;
#pragma mark - 其他
/** 根据拖拽比例自动切换透明度 */
@property (assign, nonatomic, getter=isAutomaticallyChangeAlpha) BOOL automaticallyChangeAlpha;
@end
```
## <a id="MJRefreshHeader.h"></a>MJRefreshHeader.h
```objc
@interface MJRefreshHeader : MJRefreshComponent
/** 创建header */
+ (instancetype)headerWithRefreshingBlock:(MJRefreshComponentRefreshingBlock)refreshingBlock;
/** 创建header */
+ (instancetype)headerWithRefreshingTarget:(id)target refreshingAction:(SEL)action;
/** 这个key用来存储上一次下拉刷新成功的时间 */
@property (copy, nonatomic) NSString *lastUpdatedTimeKey;
/** 上一次下拉刷新成功的时间 */
@property (strong, nonatomic, readonly) NSDate *lastUpdatedTime;
/** 忽略多少scrollView的contentInset的top */
@property (assign, nonatomic) CGFloat ignoredScrollViewContentInsetTop;
@end
```
## <a id="MJRefreshFooter.h"></a>MJRefreshFooter.h
```objc
@interface MJRefreshFooter : MJRefreshComponent
/** 创建footer */
+ (instancetype)footerWithRefreshingBlock:(MJRefreshComponentRefreshingBlock)refreshingBlock;
/** 创建footer */
+ (instancetype)footerWithRefreshingTarget:(id)target refreshingAction:(SEL)action;
/** 提示没有更多的数据 */
- (void)endRefreshingWithNoMoreData;
/** 重置没有更多的数据(消除没有更多数据的状态) */
- (void)resetNoMoreData;
/** 忽略多少scrollView的contentInset的bottom */
@property (assign, nonatomic) CGFloat ignoredScrollViewContentInsetBottom;
/** 自动根据有无数据来显示和隐藏(有数据就显示,没有数据隐藏) */
@property (assign, nonatomic) BOOL automaticallyHidden;
@end
```
## <a id="MJRefreshAutoFooter.h"></a>MJRefreshAutoFooter.h
```objc
@interface MJRefreshAutoFooter : MJRefreshFooter
/** 是否自动刷新(默认为YES) */
@property (assign, nonatomic, getter=isAutomaticallyRefresh) BOOL automaticallyRefresh;
/** 当底部控件出现多少时就自动刷新(默认为1.0,也就是底部控件完全出现时,才会自动刷新) */
@property (assign, nonatomic) CGFloat triggerAutomaticallyRefreshPercent;
@end
```
## <a id="参考"></a>参考
```objc
* 由于这个框架的功能较多,就不写具体文字描述其用法
* 大家可以直接参考示例中的MJTableViewControllerMJCollectionViewControllerMJWebViewController,更为直观快速
```
<img src="http://images0.cnblogs.com/blog2015/497279/201506/141345470048120.png" width="30%" height="30%">
## <a id="下拉刷新01-默认"></a>下拉刷新01-默认
```objc
self.tableView.header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
// 进入刷新状态后会自动调用这个block
}];
// 设置回调(一旦进入刷新状态,就调用target的action,也就是调用self的loadNewData方法)
self.tableView.header = [MJRefreshNormalHeader headerWithRefreshingTarget:self refreshingAction:@selector(loadNewData)];
// 马上进入刷新状态
[self.tableView.header beginRefreshing];
```
![(下拉刷新01-普通)](http://images0.cnblogs.com/blog2015/497279/201506/141204343486151.gif)
## <a id="下拉刷新02-动画图片"></a>下拉刷新02-动画图片
```objc
// 设置回调(一旦进入刷新状态,就调用target的action,也就是调用self的loadNewData方法)
MJRefreshGifHeader *header = [MJRefreshGifHeader headerWithRefreshingTarget:self refreshingAction:@selector(loadNewData)];
// 设置普通状态的动画图片
[header setImages:idleImages forState:MJRefreshStateIdle];
// 设置即将刷新状态的动画图片(一松开就会刷新的状态)
[header setImages:pullingImages forState:MJRefreshStatePulling];
// 设置正在刷新状态的动画图片
[header setImages:refreshingImages forState:MJRefreshStateRefreshing];
// 设置header
self.tableView.mj_header = header;
```
![(下拉刷新02-动画图片)](http://images0.cnblogs.com/blog2015/497279/201506/141204402238389.gif)
## <a id="下拉刷新03-隐藏时间"></a>下拉刷新03-隐藏时间
```objc
// 隐藏时间
header.lastUpdatedTimeLabel.hidden = YES;
```
![(下拉刷新03-隐藏时间)](http://images0.cnblogs.com/blog2015/497279/201506/141204456132944.gif)
## <a id="下拉刷新04-隐藏状态和时间"></a>下拉刷新04-隐藏状态和时间
```objc
// 隐藏时间
header.lastUpdatedTimeLabel.hidden = YES;
// 隐藏状态
header.stateLabel.hidden = YES;
```
![(下拉刷新04-隐藏状态和时间0)](http://images0.cnblogs.com/blog2015/497279/201506/141204508639539.gif)
## <a id="下拉刷新05-自定义文字"></a>下拉刷新05-自定义文字
```objc
// 设置文字
[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];
```
![(下拉刷新05-自定义文字)](http://images0.cnblogs.com/blog2015/497279/201506/141204563633593.gif)
## <a id="下拉刷新06-自定义刷新控件"></a>下拉刷新06-自定义刷新控件
```objc
self.tableView.mj_header = [MJDIYHeader headerWithRefreshingTarget:self refreshingAction:@selector(loadNewData)];
// 具体实现参考MJDIYHeader.h和MJDIYHeader.m
```
![(下拉刷新06-自定义刷新控件)](http://images0.cnblogs.com/blog2015/497279/201506/141205019261159.gif)
## <a id="上拉刷新01-默认"></a>上拉刷新01-默认
```objc
self.tableView.mj_footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{
// 进入刷新状态后会自动调用这个block
}];
// 设置回调(一旦进入刷新状态,就调用target的action,也就是调用self的loadMoreData方法)
self.tableView.mj_footer = [MJRefreshAutoNormalFooter footerWithRefreshingTarget:self refreshingAction:@selector(loadMoreData)];
```
![(上拉刷新01-默认)](http://images0.cnblogs.com/blog2015/497279/201506/141205090047696.gif)
## <a id="上拉刷新02-动画图片"></a>上拉刷新02-动画图片
```objc
// 设置回调(一旦进入刷新状态,就调用target的action,也就是调用self的loadMoreData方法)
MJRefreshAutoGifFooter *footer = [MJRefreshAutoGifFooter footerWithRefreshingTarget:self refreshingAction:@selector(loadMoreData)];
// 设置刷新图片
[footer setImages:refreshingImages forState:MJRefreshStateRefreshing];
// 设置尾部
self.tableView.mj_footer = footer;
```
![(上拉刷新02-动画图片)](http://images0.cnblogs.com/blog2015/497279/201506/141205141445793.gif)
## <a id="上拉刷新03-隐藏刷新状态的文字"></a>上拉刷新03-隐藏刷新状态的文字
```objc
// 隐藏刷新状态的文字
footer.refreshingTitleHidden = YES;
// 如果没有上面的方法,就用footer.stateLabel.hidden = YES;
```
![(上拉刷新03-隐藏刷新状态的文字)](http://images0.cnblogs.com/blog2015/497279/201506/141205200985774.gif)
## <a id="上拉刷新04-全部加载完毕"></a>上拉刷新04-全部加载完毕
```objc
// 变为没有更多数据的状态
[footer endRefreshingWithNoMoreData];
```
![(上拉刷新04-全部加载完毕)](http://images0.cnblogs.com/blog2015/497279/201506/141205248634686.gif)
## <a id="上拉刷新05-自定义文字"></a>上拉刷新05-自定义文字
```objc
// 设置文字
[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];
```
![(上拉刷新05-自定义文字)](http://images0.cnblogs.com/blog2015/497279/201506/141205295511153.gif)
## <a id="上拉刷新06-加载后隐藏"></a>上拉刷新06-加载后隐藏
```objc
// 隐藏当前的上拉刷新控件
self.tableView.mj_footer.hidden = YES;
```
![(上拉刷新06-加载后隐藏)](http://images0.cnblogs.com/blog2015/497279/201506/141205343481821.gif)
## <a id="上拉刷新07-自动回弹的上拉01"></a>上拉刷新07-自动回弹的上拉01
```objc
self.tableView.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingTarget:self refreshingAction:@selector(loadMoreData)];
```
![(上拉刷新07-自动回弹的上拉01)](http://images0.cnblogs.com/blog2015/497279/201506/141205392239231.gif)
## <a id="上拉刷新08-自动回弹的上拉02"></a>上拉刷新08-自动回弹的上拉02
```objc
MJRefreshBackGifFooter *footer = [MJRefreshBackGifFooter footerWithRefreshingTarget:self refreshingAction:@selector(loadMoreData)];
// 设置普通状态的动画图片
[footer setImages:idleImages forState:MJRefreshStateIdle];
// 设置即将刷新状态的动画图片(一松开就会刷新的状态)
[footer setImages:pullingImages forState:MJRefreshStatePulling];
// 设置正在刷新状态的动画图片
[footer setImages:refreshingImages forState:MJRefreshStateRefreshing];
// 设置尾部
self.tableView.mj_footer = footer;
```
![(上拉刷新07-自动回弹的上拉02)](http://images0.cnblogs.com/blog2015/497279/201506/141205441443628.gif)
## <a id="上拉刷新09-自定义刷新控件(自动刷新)"></a>上拉刷新09-自定义刷新控件(自动刷新)
```objc
self.tableView.mj_footer = [MJDIYAutoFooter footerWithRefreshingTarget:self refreshingAction:@selector(loadMoreData)];
// 具体实现参考MJDIYAutoFooter.h和MJDIYAutoFooter.m
```
![(上拉刷新09-自定义刷新控件(自动刷新))](http://images0.cnblogs.com/blog2015/497279/201506/141205500195866.gif)
## <a id="上拉刷新10-自定义刷新控件(自动回弹)"></a>上拉刷新10-自定义刷新控件(自动回弹)
```objc
self.tableView.mj_footer = [MJDIYBackFooter footerWithRefreshingTarget:self refreshingAction:@selector(loadMoreData)];
// 具体实现参考MJDIYBackFooter.h和MJDIYBackFooter.m
```
![(上拉刷新10-自定义刷新控件(自动回弹))](http://images0.cnblogs.com/blog2015/497279/201506/141205560666819.gif)
## <a id="UICollectionView01-上下拉刷新"></a>UICollectionView01-上下拉刷新
```objc
// 下拉刷新
self.collectionView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
// 进入刷新状态后会自动调用这个block
}];
// 上拉刷新
self.collectionView.mj_footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{
// 进入刷新状态后会自动调用这个block
}];
```
![(UICollectionView01-上下拉刷新)](http://images0.cnblogs.com/blog2015/497279/201506/141206021603758.gif)
## <a id="UIWebView01-下拉刷新"></a>UIWebView01-下拉刷新
```objc
// 添加下拉刷新控件
self.webView.scrollView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
// 进入刷新状态后会自动调用这个block
}];
```
![(UICollectionView01-上下拉刷新)](http://images0.cnblogs.com/blog2015/497279/201506/141206080514524.gif)
## 提醒
* 本框架纯ARC,兼容的系统>=iOS6.0、iPhone\iPad横竖屏
## <a id="期待"></a>期待
* 如果在使用过程中遇到BUG,希望你能Issues我,谢谢(或者尝试下载最新的框架代码看看BUG修复没有)
* 如果在使用过程中发现功能不够用,希望你能Issues我,我非常想为这个框架增加更多好用的功能,谢谢
* 如果你想为MJRefresh输出代码,请拼命Pull Requests我
* 如果你开发的应用中用到了MJRefresh,希望你能到[CocoaControls](https://www.cocoacontrols.com/controls/mjrefresh)添加你应用的iTunes路径,我将会安装使用你的应用,并且根据众多应用的使用情况,对MJRefresh进行一个更好的设计和完善,提供更多好用的功能,谢谢
* 步骤01(微信是举个例子,百度“你的应用名称 itunes”)
![(step01)](http://ww4.sinaimg.cn/mw1024/800cdf9ctw1eq0viiv5rsj20sm0ea41t.jpg)
* 步骤02
![(step02)](http://ww2.sinaimg.cn/mw1024/800cdf9ctw1eq0vilejxlj20tu0me7a0.jpg)
* 步骤03
![(step03)](http://ww1.sinaimg.cn/mw1024/800cdf9ctw1eq0viocpo5j20wc0dc0un.jpg)
* 步骤04
![(step04)](http://ww3.sinaimg.cn/mw1024/800cdf9ctw1eq0vir137xj20si0gewgu.jpg)
PODS:
- GMRefresh (0.1.0):
- MJRefresh (~> 3.1.0)
- MJRefresh (3.1.0)
DEPENDENCIES:
- GMRefresh (from `../`)
EXTERNAL SOURCES:
GMRefresh:
:path: "../"
SPEC CHECKSUMS:
GMRefresh: fc60ee05785ff73b535d5b933e1c7f13cdd6ede0
MJRefresh: 743e6404967d1c2c688472ea3ecfde247d872db4
COCOAPODS: 0.39.0
This source diff could not be displayed because it is too large. You can view the blob instead.
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0700"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForAnalyzing = "YES"
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES">
<BuildableReference
BuildableIdentifier = 'primary'
BlueprintIdentifier = '9C85BB2C94B5EA4880AC537A'
BlueprintName = 'GMRefresh'
ReferencedContainer = 'container:Pods.xcodeproj'
BuildableName = 'GMRefresh.framework'>
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
buildConfiguration = "Debug"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES"
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
#import <Foundation/Foundation.h>
@interface PodsDummy_GMRefresh : NSObject
@end
@implementation PodsDummy_GMRefresh
@end
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#endif
#import <UIKit/UIKit.h>
#import "GMRefresh.h"
#import "GMRefreshConstant.h"
#import "GMRefreshFooter.h"
#import "GMRefreshHeader.h"
FOUNDATION_EXPORT double GMRefreshVersionNumber;
FOUNDATION_EXPORT const unsigned char GMRefreshVersionString[];
framework module GMRefresh {
umbrella header "GMRefresh-umbrella.h"
export *
module * { export * }
}
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/GMRefresh" "${PODS_ROOT}/Headers/Public"
PODS_ROOT = ${SRCROOT}
SKIP_INSTALL = YES
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>org.cocoapods.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>0.1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>${CURRENT_PROJECT_VERSION}</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>org.cocoapods.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>3.1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>${CURRENT_PROJECT_VERSION}</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
#import <Foundation/Foundation.h>
@interface PodsDummy_MJRefresh : NSObject
@end
@implementation PodsDummy_MJRefresh
@end
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#endif
#import <UIKit/UIKit.h>
#import "MJRefreshAutoFooter.h"
#import "MJRefreshBackFooter.h"
#import "MJRefreshComponent.h"
#import "MJRefreshFooter.h"
#import "MJRefreshHeader.h"
#import "MJRefreshAutoGifFooter.h"
#import "MJRefreshAutoNormalFooter.h"
#import "MJRefreshAutoStateFooter.h"
#import "MJRefreshBackGifFooter.h"
#import "MJRefreshBackNormalFooter.h"
#import "MJRefreshBackStateFooter.h"
#import "MJRefreshGifHeader.h"
#import "MJRefreshNormalHeader.h"
#import "MJRefreshStateHeader.h"
#import "MJRefresh.h"
#import "MJRefreshConst.h"
#import "UIScrollView+MJExtension.h"
#import "UIScrollView+MJRefresh.h"
#import "UIView+MJExtension.h"
FOUNDATION_EXPORT double MJRefreshVersionNumber;
FOUNDATION_EXPORT const unsigned char MJRefreshVersionString[];
framework module MJRefresh {
umbrella header "MJRefresh-umbrella.h"
export *
module * { export * }
}
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/MJRefresh" "${PODS_ROOT}/Headers/Public"
PODS_ROOT = ${SRCROOT}
SKIP_INSTALL = YES
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>org.cocoapods.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>${CURRENT_PROJECT_VERSION}</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
# Acknowledgements
This application makes use of the following third party libraries:
## GMRefresh
Copyright (c) 2016 wangyang <wangyang@wanmeizhensuo.com>
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.
## MJRefresh
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.
Generated by CocoaPods - http://cocoapods.org
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PreferenceSpecifiers</key>
<array>
<dict>
<key>FooterText</key>
<string>This application makes use of the following third party libraries:</string>
<key>Title</key>
<string>Acknowledgements</string>
<key>Type</key>
<string>PSGroupSpecifier</string>
</dict>
<dict>
<key>FooterText</key>
<string>Copyright (c) 2016 wangyang &lt;wangyang@wanmeizhensuo.com&gt;
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.
</string>
<key>Title</key>
<string>GMRefresh</string>
<key>Type</key>
<string>PSGroupSpecifier</string>
</dict>
<dict>
<key>FooterText</key>
<string>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.
</string>
<key>Title</key>
<string>MJRefresh</string>
<key>Type</key>
<string>PSGroupSpecifier</string>
</dict>
<dict>
<key>FooterText</key>
<string>Generated by CocoaPods - http://cocoapods.org</string>
<key>Title</key>
<string></string>
<key>Type</key>
<string>PSGroupSpecifier</string>
</dict>
</array>
<key>StringsTable</key>
<string>Acknowledgements</string>
<key>Title</key>
<string>Acknowledgements</string>
</dict>
</plist>
#import <Foundation/Foundation.h>
@interface PodsDummy_Pods_GMRefresh_Example : NSObject
@end
@implementation PodsDummy_Pods_GMRefresh_Example
@end
#!/bin/sh
set -e
echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
install_framework()
{
if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
local source="${BUILT_PRODUCTS_DIR}/$1"
elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then
local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")"
elif [ -r "$1" ]; then
local source="$1"
fi
local destination="${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
if [ -L "${source}" ]; then
echo "Symlinked..."
source="$(readlink "${source}")"
fi
# use filter instead of exclude so missing patterns dont' throw errors
echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\""
rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}"
local basename
basename="$(basename -s .framework "$1")"
binary="${destination}/${basename}.framework/${basename}"
if ! [ -r "$binary" ]; then
binary="${destination}/${basename}"
fi
# Strip invalid architectures so "fat" simulator / device frameworks work on device
if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then
strip_invalid_archs "$binary"
fi
# Resign the code if required by the build settings to avoid unstable apps
code_sign_if_enabled "${destination}/$(basename "$1")"
# Embed linked Swift runtime libraries. No longer necessary as of Xcode 7.
if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then
local swift_runtime_libs
swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]})
for lib in $swift_runtime_libs; do
echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\""
rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}"
code_sign_if_enabled "${destination}/${lib}"
done
fi
}
# Signs a framework with the provided identity
code_sign_if_enabled() {
if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then
# Use the current code_sign_identitiy
echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements \"$1\""
/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements "$1"
fi
}
# Strip invalid architectures
strip_invalid_archs() {
binary="$1"
# Get architectures for current file
archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)"
stripped=""
for arch in $archs; do
if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then
# Strip non-valid architectures in-place
lipo -remove "$arch" -output "$binary" "$binary" || exit 1
stripped="$stripped $arch"
fi
done
if [[ "$stripped" ]]; then
echo "Stripped $binary of architectures:$stripped"
fi
}
if [[ "$CONFIGURATION" == "Debug" ]]; then
install_framework "Pods-GMRefresh_Example/GMRefresh.framework"
install_framework "Pods-GMRefresh_Example/MJRefresh.framework"
fi
if [[ "$CONFIGURATION" == "Release" ]]; then
install_framework "Pods-GMRefresh_Example/GMRefresh.framework"
install_framework "Pods-GMRefresh_Example/MJRefresh.framework"
fi
#!/bin/sh
set -e
mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
> "$RESOURCES_TO_COPY"
XCASSET_FILES=()
realpath() {
DIRECTORY="$(cd "${1%/*}" && pwd)"
FILENAME="${1##*/}"
echo "$DIRECTORY/$FILENAME"
}
install_resource()
{
case $1 in
*.storyboard)
echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}"
ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}"
;;
*.xib)
echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}"
ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}"
;;
*.framework)
echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
;;
*.xcdatamodel)
echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\""
xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom"
;;
*.xcdatamodeld)
echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\""
xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd"
;;
*.xcmappingmodel)
echo "xcrun mapc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm\""
xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm"
;;
*.xcassets)
ABSOLUTE_XCASSET_FILE=$(realpath "${PODS_ROOT}/$1")
XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
;;
/*)
echo "$1"
echo "$1" >> "$RESOURCES_TO_COPY"
;;
*)
echo "${PODS_ROOT}/$1"
echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY"
;;
esac
}
mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then
mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
fi
rm -f "$RESOURCES_TO_COPY"
if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ]
then
case "${TARGETED_DEVICE_FAMILY}" in
1,2)
TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
;;
1)
TARGET_DEVICE_ARGS="--target-device iphone"
;;
2)
TARGET_DEVICE_ARGS="--target-device ipad"
;;
*)
TARGET_DEVICE_ARGS="--target-device mac"
;;
esac
# Find all other xcassets (this unfortunately includes those of path pods and other targets).
OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d)
while read line; do
if [[ $line != "`realpath $PODS_ROOT`*" ]]; then
XCASSET_FILES+=("$line")
fi
done <<<"$OTHER_XCASSETS"
printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
fi
#import <UIKit/UIKit.h>
FOUNDATION_EXPORT double Pods_GMRefresh_ExampleVersionNumber;
FOUNDATION_EXPORT const unsigned char Pods_GMRefresh_ExampleVersionString[];
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/GMRefresh.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/MJRefresh.framework/Headers"
OTHER_LDFLAGS = $(inherited) -framework "GMRefresh" -framework "MJRefresh"
PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-GMRefresh_Example
PODS_ROOT = ${SRCROOT}/Pods
\ No newline at end of file
framework module Pods_GMRefresh_Example {
umbrella header "Pods-GMRefresh_Example-umbrella.h"
export *
module * { export * }
}
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/GMRefresh.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/MJRefresh.framework/Headers"
OTHER_LDFLAGS = $(inherited) -framework "GMRefresh" -framework "MJRefresh"
PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-GMRefresh_Example
PODS_ROOT = ${SRCROOT}/Pods
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>org.cocoapods.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>${CURRENT_PROJECT_VERSION}</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
# Acknowledgements
This application makes use of the following third party libraries:
## GMRefresh
Copyright (c) 2016 wangyang <wangyang@wanmeizhensuo.com>
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.
## MJRefresh
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.
Generated by CocoaPods - http://cocoapods.org
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PreferenceSpecifiers</key>
<array>
<dict>
<key>FooterText</key>
<string>This application makes use of the following third party libraries:</string>
<key>Title</key>
<string>Acknowledgements</string>
<key>Type</key>
<string>PSGroupSpecifier</string>
</dict>
<dict>
<key>FooterText</key>
<string>Copyright (c) 2016 wangyang &lt;wangyang@wanmeizhensuo.com&gt;
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.
</string>
<key>Title</key>
<string>GMRefresh</string>
<key>Type</key>
<string>PSGroupSpecifier</string>
</dict>
<dict>
<key>FooterText</key>
<string>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.
</string>
<key>Title</key>
<string>MJRefresh</string>
<key>Type</key>
<string>PSGroupSpecifier</string>
</dict>
<dict>
<key>FooterText</key>
<string>Generated by CocoaPods - http://cocoapods.org</string>
<key>Title</key>
<string></string>
<key>Type</key>
<string>PSGroupSpecifier</string>
</dict>
</array>
<key>StringsTable</key>
<string>Acknowledgements</string>
<key>Title</key>
<string>Acknowledgements</string>
</dict>
</plist>
#import <Foundation/Foundation.h>
@interface PodsDummy_Pods_GMRefresh_Tests : NSObject
@end
@implementation PodsDummy_Pods_GMRefresh_Tests
@end
#!/bin/sh
set -e
echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
install_framework()
{
if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
local source="${BUILT_PRODUCTS_DIR}/$1"
elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then
local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")"
elif [ -r "$1" ]; then
local source="$1"
fi
local destination="${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
if [ -L "${source}" ]; then
echo "Symlinked..."
source="$(readlink "${source}")"
fi
# use filter instead of exclude so missing patterns dont' throw errors
echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\""
rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}"
local basename
basename="$(basename -s .framework "$1")"
binary="${destination}/${basename}.framework/${basename}"
if ! [ -r "$binary" ]; then
binary="${destination}/${basename}"
fi
# Strip invalid architectures so "fat" simulator / device frameworks work on device
if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then
strip_invalid_archs "$binary"
fi
# Resign the code if required by the build settings to avoid unstable apps
code_sign_if_enabled "${destination}/$(basename "$1")"
# Embed linked Swift runtime libraries. No longer necessary as of Xcode 7.
if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then
local swift_runtime_libs
swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]})
for lib in $swift_runtime_libs; do
echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\""
rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}"
code_sign_if_enabled "${destination}/${lib}"
done
fi
}
# Signs a framework with the provided identity
code_sign_if_enabled() {
if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then
# Use the current code_sign_identitiy
echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements \"$1\""
/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements "$1"
fi
}
# Strip invalid architectures
strip_invalid_archs() {
binary="$1"
# Get architectures for current file
archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)"
stripped=""
for arch in $archs; do
if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then
# Strip non-valid architectures in-place
lipo -remove "$arch" -output "$binary" "$binary" || exit 1
stripped="$stripped $arch"
fi
done
if [[ "$stripped" ]]; then
echo "Stripped $binary of architectures:$stripped"
fi
}
if [[ "$CONFIGURATION" == "Debug" ]]; then
install_framework "Pods-GMRefresh_Tests/GMRefresh.framework"
install_framework "Pods-GMRefresh_Tests/MJRefresh.framework"
fi
if [[ "$CONFIGURATION" == "Release" ]]; then
install_framework "Pods-GMRefresh_Tests/GMRefresh.framework"
install_framework "Pods-GMRefresh_Tests/MJRefresh.framework"
fi
#!/bin/sh
set -e
mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
> "$RESOURCES_TO_COPY"
XCASSET_FILES=()
realpath() {
DIRECTORY="$(cd "${1%/*}" && pwd)"
FILENAME="${1##*/}"
echo "$DIRECTORY/$FILENAME"
}
install_resource()
{
case $1 in
*.storyboard)
echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}"
ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}"
;;
*.xib)
echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}"
ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}"
;;
*.framework)
echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
;;
*.xcdatamodel)
echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\""
xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom"
;;
*.xcdatamodeld)
echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\""
xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd"
;;
*.xcmappingmodel)
echo "xcrun mapc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm\""
xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm"
;;
*.xcassets)
ABSOLUTE_XCASSET_FILE=$(realpath "${PODS_ROOT}/$1")
XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
;;
/*)
echo "$1"
echo "$1" >> "$RESOURCES_TO_COPY"
;;
*)
echo "${PODS_ROOT}/$1"
echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY"
;;
esac
}
mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then
mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
fi
rm -f "$RESOURCES_TO_COPY"
if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ]
then
case "${TARGETED_DEVICE_FAMILY}" in
1,2)
TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
;;
1)
TARGET_DEVICE_ARGS="--target-device iphone"
;;
2)
TARGET_DEVICE_ARGS="--target-device ipad"
;;
*)
TARGET_DEVICE_ARGS="--target-device mac"
;;
esac
# Find all other xcassets (this unfortunately includes those of path pods and other targets).
OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d)
while read line; do
if [[ $line != "`realpath $PODS_ROOT`*" ]]; then
XCASSET_FILES+=("$line")
fi
done <<<"$OTHER_XCASSETS"
printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
fi
#import <UIKit/UIKit.h>
FOUNDATION_EXPORT double Pods_GMRefresh_TestsVersionNumber;
FOUNDATION_EXPORT const unsigned char Pods_GMRefresh_TestsVersionString[];
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/GMRefresh.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/MJRefresh.framework/Headers"
OTHER_LDFLAGS = $(inherited) -framework "GMRefresh" -framework "MJRefresh"
PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-GMRefresh_Tests
PODS_ROOT = ${SRCROOT}/Pods
\ No newline at end of file
framework module Pods_GMRefresh_Tests {
umbrella header "Pods-GMRefresh_Tests-umbrella.h"
export *
module * { export * }
}
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/GMRefresh.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/MJRefresh.framework/Headers"
OTHER_LDFLAGS = $(inherited) -framework "GMRefresh" -framework "MJRefresh"
PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-GMRefresh_Tests
PODS_ROOT = ${SRCROOT}/Pods
\ No newline at end of file
...@@ -9,34 +9,16 @@ ...@@ -9,34 +9,16 @@
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = "GMRefresh" s.name = "GMRefresh"
s.version = "0.1.0" s.version = "0.1.0"
s.summary = "A short description of GMRefresh." s.summary = "基于MJRefresh做的下拉刷新,自动加载更多"
s.homepage = "http://git.gengmei.cc/gengmeiios/GMLibrary/GMRefresh"
# This description is used to generate tags and improve search results.
# * Think: What does it do? Why did you write it? What is the focus?
# * Try to keep it short, snappy and to the point.
# * Write the description between the DESC delimiters below.
# * Finally, don't worry about the indent, CocoaPods strips it!
s.description = <<-DESC
TODO: Add long description of the pod here.
DESC
s.homepage = "https://github.com/<GITHUB_USERNAME>/GMRefresh"
# s.screenshots = "www.example.com/screenshots_1", "www.example.com/screenshots_2"
s.license = 'MIT' s.license = 'MIT'
s.author = { "wangyang" => "wangyang@wanmeizhensuo.com" } s.author = { "wangyang" => "wangyang@gmei.com" }
s.source = { :git => "https://github.com/<GITHUB_USERNAME>/GMRefresh.git", :tag => s.version.to_s } s.source = { :git => "http://git.gengmei.cc/gengmeiios/GMRefresh.git", :tag => s.version.to_s }
# s.social_media_url = 'https://twitter.com/<TWITTER_USERNAME>'
s.ios.deployment_target = '8.0' s.ios.deployment_target = '8.0'
s.dependency 'MJRefresh', '~> 3.1.0'
s.source_files = 'GMRefresh/Classes/**/*' s.source_files = 'GMRefresh/Classes/**/*'
s.resource_bundles = {
# s.resource_bundles = { 'GMRefresh' => ['GMRefresh/Assets/*.png'],
# 'GMRefresh' => ['GMRefresh/Assets/*.png'] }
# }
# s.public_header_files = 'Pod/Classes/**/*.h'
# s.frameworks = 'UIKit', 'MapKit'
# s.dependency 'AFNetworking', '~> 2.3'
end end
//
// GMRefresh.h
// Pods
//
// Created by wangyang on 16/5/4.
//
//
#ifndef GMRefresh_h
#define GMRefresh_h
#import "GMRefreshFooter.h"
#import "GMRefreshHeader.h"
#endif /* GMRefresh_h */
//
// GMRefreshConstant.h
// Pods
//
// Created by wangyang on 16/5/4.
//
//
#ifndef GMRefreshConstant_h
#define GMRefreshConstant_h
#define GMRefreshImageName(file) [@"Frameworks/GMRefresh.framework/GMRefresh.bundle" stringByAppendingPathComponent:file]
#endif /* GMRefreshConstant_h */
//
// GMRefreshFooter.h
// GengmeiDoctor
//
// Created by Terminator on 16/4/29.
// Copyright © 2016年 wanmeizhensuo. All rights reserved.
//
#import <MJRefresh/MJRefresh.h>
@interface GMRefreshFooter : MJRefreshAutoGifFooter
@end
//
// GMRefreshFooter.m
// GengmeiDoctor
//
// Created by Terminator on 16/4/29.
// Copyright © 2016年 wanmeizhensuo. All rights reserved.
//
#import "GMRefreshFooter.h"
#import "GMRefreshConstant.h"
@interface GMRefreshFooter()
@property (nonatomic, strong) UIImageView *prepareImageView;
@end
@implementation GMRefreshFooter
- (void)prepare
{
[super prepare];
//隐藏文字显示
self.refreshingTitleHidden = YES;
self.stateLabel.hidden = YES;
// 设置正在刷新状态的动画图片
NSMutableArray *refreshingImages = [NSMutableArray array];
for (NSUInteger i = 1; i<=20; i++) {
NSString *imageName = [NSString stringWithFormat:@"pullLoading%ld", i];
NSString *imagePath = GMRefreshImageName(imageName);
UIImage *image = [UIImage imageNamed:imagePath];
[refreshingImages addObject:image];
}
[self setImages:refreshingImages forState:MJRefreshStateRefreshing];
}
@end
//
// GMRefreshHeader.h
// MJRefreshExample
//
// Created by wangyang on 16/3/1.
// Copyright © 2016年 wanmeizhensuo. All rights reserved.
//
#import <MJRefresh/MJRefresh.h>
@interface GMRefreshHeader : MJRefreshGifHeader
@end
//
// GMRefreshHeader.m
// MJRefreshExample
//
// Created by wangyang on 16/3/1.
// Copyright © 2016年 wanmeizhensuo. All rights reserved.
//
#import "GMRefreshHeader.h"
#import "GMRefreshConstant.h"
#define GM_REFRESH_WIDTH 46
#define GM_REFRESH_HEIGHT 14
@implementation GMRefreshHeader
{
UIImageView *_prepareImageView;
}
- (void)prepare
{
[super prepare];
// 隐藏时间
self.lastUpdatedTimeLabel.hidden = YES;
// 隐藏状态
self.stateLabel.hidden = YES;
[self setImages:@[[UIImage imageNamed:GMRefreshImageName(@"pullLoading1")]] forState:MJRefreshStatePulling];
// 设置正在刷新状态的动画图片
NSMutableArray *refreshingImages = [NSMutableArray array];
for (NSUInteger i = 1; i<=20; i++) {
NSString *imageName = [NSString stringWithFormat:@"pullLoading%ld", i];
NSString *imagePath = GMRefreshImageName(imageName);
UIImage *image = [UIImage imageNamed:imagePath];
[refreshingImages addObject:image];
}
[self setImages:refreshingImages forState:MJRefreshStateRefreshing];
// 手动下拉过程中的图片
_prepareImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:GMRefreshImageName(@"pullLoading1")]];
_prepareImageView.mj_w = GM_REFRESH_WIDTH;
_prepareImageView.mj_h = GM_REFRESH_HEIGHT;
_prepareImageView.mj_y = self.mj_h -_prepareImageView.mj_h / 2;
_prepareImageView.mj_x = (self.mj_w - _prepareImageView.mj_w) / 2;
_prepareImageView.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin;
_prepareImageView.hidden = YES;
[self addSubview:_prepareImageView];
}
- (void)setPullingPercent:(CGFloat)pullingPercent
{
[super setPullingPercent:pullingPercent];
// 隐藏时间
self.lastUpdatedTimeLabel.hidden = YES;
// 隐藏状态
self.stateLabel.hidden = YES;
if (self.state == MJRefreshStateIdle && pullingPercent != 0.0) {
_prepareImageView.hidden = NO;
if (pullingPercent <= 1.0 ) {
NSLog(@"%f", pullingPercent);
// 下拉过程中
self.gifView.hidden = YES;
CGFloat translation = self.mj_h * pullingPercent / 2;
_prepareImageView.transform = CGAffineTransformMakeTranslation(0, -translation);
_prepareImageView.transform = CGAffineTransformScale(_prepareImageView.transform, pullingPercent, pullingPercent);
}else{
// pullingPercent 超过 1 时,位置固定
self.gifView.hidden = NO;
CGFloat translation = self.mj_h * 1 / 2;
_prepareImageView.transform = CGAffineTransformMakeTranslation(0, -translation);
_prepareImageView.transform = CGAffineTransformScale(_prepareImageView.transform, pullingPercent, pullingPercent);
}
}
}
@end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment