diff --git a/.gitignore b/.gitignore index f0d75ba..1fff33a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,9 @@ # OS X folder attributes .DS_Store -# user-specific XCode stuff +# user-specific Xcode stuff *.mode1v3 *.mode2v3 *.pbxuser *.perspectivev3 -*.xcuserdatad +*.xcuserdatad \ No newline at end of file diff --git a/Demo/Default-568h@2x.png b/Demo/Default-568h@2x.png new file mode 100644 index 0000000..0891b7a Binary files /dev/null and b/Demo/Default-568h@2x.png differ diff --git a/Demo/ODRefreshControlDemo.xcodeproj/project.pbxproj b/Demo/ODRefreshControlDemo.xcodeproj/project.pbxproj old mode 100644 new mode 100755 index 78f5726..25dbd4b --- a/Demo/ODRefreshControlDemo.xcodeproj/project.pbxproj +++ b/Demo/ODRefreshControlDemo.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + 0116444A1BC2204600C21BC9 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 011644491BC2204600C21BC9 /* Default-568h@2x.png */; settings = {ASSET_TAGS = (); }; }; E5013A2115A43A940035F4A0 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E5013A2015A43A940035F4A0 /* UIKit.framework */; }; E5013A2315A43A940035F4A0 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E5013A2215A43A940035F4A0 /* Foundation.framework */; }; E5013A2515A43A940035F4A0 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E5013A2415A43A940035F4A0 /* CoreGraphics.framework */; }; @@ -19,6 +20,7 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + 011644491BC2204600C21BC9 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; E5013A1C15A43A940035F4A0 /* ODRefreshControlDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ODRefreshControlDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; E5013A2015A43A940035F4A0 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; E5013A2215A43A940035F4A0 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; @@ -54,6 +56,7 @@ E5013A1115A43A930035F4A0 = { isa = PBXGroup; children = ( + 011644491BC2204600C21BC9 /* Default-568h@2x.png */, E5013A2615A43A940035F4A0 /* ODRefreshControlDemo */, E5013A1F15A43A940035F4A0 /* Frameworks */, E5013A1D15A43A940035F4A0 /* Products */, @@ -139,7 +142,7 @@ E5013A1315A43A930035F4A0 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0430; + LastUpgradeCheck = 0700; }; buildConfigurationList = E5013A1615A43A930035F4A0 /* Build configuration list for PBXProject "ODRefreshControlDemo" */; compatibilityVersion = "Xcode 3.2"; @@ -164,6 +167,7 @@ buildActionMask = 2147483647; files = ( E5013A2B15A43A940035F4A0 /* InfoPlist.strings in Resources */, + 0116444A1BC2204600C21BC9 /* Default-568h@2x.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -199,12 +203,21 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", @@ -212,10 +225,14 @@ ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 5.1; + ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -225,14 +242,25 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 5.1; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; @@ -248,7 +276,8 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "ODRefreshControlDemo/ODRefreshControlDemo-Prefix.pch"; INFOPLIST_FILE = "ODRefreshControlDemo/ODRefreshControlDemo-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 4.0; + IPHONEOS_DEPLOYMENT_TARGET = 6.0; + PRODUCT_BUNDLE_IDENTIFIER = "com.orangeinaday.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; @@ -260,7 +289,8 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "ODRefreshControlDemo/ODRefreshControlDemo-Prefix.pch"; INFOPLIST_FILE = "ODRefreshControlDemo/ODRefreshControlDemo-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 4.0; + IPHONEOS_DEPLOYMENT_TARGET = 6.0; + PRODUCT_BUNDLE_IDENTIFIER = "com.orangeinaday.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; diff --git a/Demo/ODRefreshControlDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Demo/ODRefreshControlDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata old mode 100644 new mode 100755 diff --git a/Demo/ODRefreshControlDemo/AppDelegate.h b/Demo/ODRefreshControlDemo/AppDelegate.h old mode 100644 new mode 100755 diff --git a/Demo/ODRefreshControlDemo/AppDelegate.m b/Demo/ODRefreshControlDemo/AppDelegate.m old mode 100644 new mode 100755 diff --git a/Demo/ODRefreshControlDemo/ODRefreshControlDemo-Info.plist b/Demo/ODRefreshControlDemo/ODRefreshControlDemo-Info.plist old mode 100644 new mode 100755 index c7b7a45..6a012bd --- a/Demo/ODRefreshControlDemo/ODRefreshControlDemo-Info.plist +++ b/Demo/ODRefreshControlDemo/ODRefreshControlDemo-Info.plist @@ -9,7 +9,7 @@ CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier - com.orangeinaday.${PRODUCT_NAME:rfc1034identifier} + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/Demo/ODRefreshControlDemo/ODRefreshControlDemo-Prefix.pch b/Demo/ODRefreshControlDemo/ODRefreshControlDemo-Prefix.pch old mode 100644 new mode 100755 diff --git a/Demo/ODRefreshControlDemo/ViewController.h b/Demo/ODRefreshControlDemo/ViewController.h old mode 100644 new mode 100755 diff --git a/Demo/ODRefreshControlDemo/ViewController.m b/Demo/ODRefreshControlDemo/ViewController.m old mode 100644 new mode 100755 index fe120b1..2eec020 --- a/Demo/ODRefreshControlDemo/ViewController.m +++ b/Demo/ODRefreshControlDemo/ViewController.m @@ -30,7 +30,7 @@ - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interface - (void)dropViewDidBeginRefreshing:(ODRefreshControl *)refreshControl { - double delayInSeconds = 3.0; + double delayInSeconds = 1.5; dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, delayInSeconds * NSEC_PER_SEC); dispatch_after(popTime, dispatch_get_main_queue(), ^(void){ [refreshControl endRefreshing]; diff --git a/Demo/ODRefreshControlDemo/en.lproj/InfoPlist.strings b/Demo/ODRefreshControlDemo/en.lproj/InfoPlist.strings old mode 100644 new mode 100755 diff --git a/Demo/ODRefreshControlDemo/main.m b/Demo/ODRefreshControlDemo/main.m old mode 100644 new mode 100755 diff --git a/ODRefreshControl.podspec b/ODRefreshControl.podspec old mode 100644 new mode 100755 index cd4c629..abd9adb --- a/ODRefreshControl.podspec +++ b/ODRefreshControl.podspec @@ -1,14 +1,13 @@ Pod::Spec.new do |s| s.name = 'ODRefreshControl' - s.version = '1.2' + s.version = '0.1' s.license = 'MIT' - s.summary = "A pull down to refresh control like the one in Apple's iOS6 Mail App." - s.homepage = 'https://github.com/Sephiroth87/ODRefreshControl' - s.author = { 'Fabio Ritrovato' => 'fabio@orangeinaday.com' } - s.source = { :git => 'https://github.com/Sephiroth87/ODRefreshControl.git', :tag => '1.2' } + s.summary = "水滴型下拉刷新控件(A pull down to refresh control like water dropped)." + s.homepage = 'https://github.com/wolfcon/ODRefreshControl' + s.author = { 'Frank(fork from Fabio Ritrovato)' => '472730949@qq.com' } + s.source = { :git => 'https://github.com/wolfcon/ODRefreshControl.git', :tag => '0.1' } - s.description = 'ODRefreshControl is a "pull down to refresh" control for UIScrollView,' \ - 'like the one Apple introduced in iOS6, but available to anyone from iOS4 and up.' + s.description = '水滴型下拉刷新控件(A pull down to refresh control like water dropped).' s.platform = :ios s.source_files = 'ODRefreshControl/ODRefreshControl*.{h,m}' diff --git a/ODRefreshControl/ODRefreshControl.h b/ODRefreshControl/ODRefreshControl.h old mode 100644 new mode 100755 index 3ba5920..d34fcef --- a/ODRefreshControl/ODRefreshControl.h +++ b/ODRefreshControl/ODRefreshControl.h @@ -26,15 +26,18 @@ } @property (nonatomic, readonly, getter=isRefreshing) BOOL refreshing; +@property (nonatomic, assign) CGFloat finishedLabelShownInterval; // default 0.5s //默认0.5秒 #ifdef __IPHONE_5_0 @property (nonatomic, strong) UIColor *tintColor UI_APPEARANCE_SELECTOR; @property (nonatomic, assign) UIActivityIndicatorViewStyle activityIndicatorViewStyle UI_APPEARANCE_SELECTOR; @property (nonatomic, strong) UIColor *activityIndicatorViewColor UI_APPEARANCE_SELECTOR; // iOS5 or more +@property (nonatomic, strong) UILabel *finishedLabel UI_APPEARANCE_SELECTOR; #else @property (nonatomic, strong) UIColor *tintColor; @property (nonatomic, assign) UIActivityIndicatorViewStyle activityIndicatorViewStyle; @property (nonatomic, strong) UIColor *activityIndicatorViewColor; // iOS5 or more +@property (nonatomic, strong) UILabel *finishedLabel; #endif - (id)initInScrollView:(UIScrollView *)scrollView; diff --git a/ODRefreshControl/ODRefreshControl.m b/ODRefreshControl/ODRefreshControl.m old mode 100644 new mode 100755 index 362e61c..e2a319b --- a/ODRefreshControl/ODRefreshControl.m +++ b/ODRefreshControl/ODRefreshControl.m @@ -7,6 +7,10 @@ // // https://github.com/Sephiroth87/ODRefreshControl // +// +// Change by Frank on 10/7/15 +// Add finished Label. +// #import "ODRefreshControl.h" @@ -36,12 +40,6 @@ @interface ODRefreshControl () @implementation ODRefreshControl -@synthesize refreshing = _refreshing; -@synthesize tintColor = _tintColor; - -@synthesize scrollView = _scrollView; -@synthesize originalContentInset = _originalContentInset; - static inline CGFloat lerp(CGFloat a, CGFloat b, CGFloat p) { return a + (b - a) * p; @@ -65,7 +63,6 @@ - (id)initInScrollView:(UIScrollView *)scrollView activityIndicatorView:(UIView [scrollView addObserver:self forKeyPath:@"contentInset" options:NSKeyValueObservingOptionNew context:nil]; _activity = activity ? activity : [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray]; - _activity.center = CGPointMake(floor(self.frame.size.width / 2), floor(self.frame.size.height / 2)); _activity.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin; _activity.alpha = 0; if ([_activity respondsToSelector:@selector(startAnimating)]) { @@ -73,6 +70,16 @@ - (id)initInScrollView:(UIScrollView *)scrollView activityIndicatorView:(UIView } [self addSubview:_activity]; + //add the label "Finished" + _finishedLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 300, 44)]; + _finishedLabel.textAlignment = NSTextAlignmentCenter; + _finishedLabel.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin; + _finishedLabel.alpha = 0; + _finishedLabel.text = @"✔️ Finished!"; + _finishedLabel.font = [UIFont systemFontOfSize:[UIFont systemFontSize]]; + [self addSubview:_finishedLabel]; + _finishedLabelShownInterval = 0.5; + _refreshing = NO; _canRefresh = YES; _ignoreInset = NO; @@ -188,7 +195,9 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(N _shapeLayer.position = CGPointMake(0, kMaxDistance + offset + kOpenedViewHeight); [CATransaction commit]; - _activity.center = CGPointMake(floor(self.frame.size.width / 2), MIN(offset + self.frame.size.height + floor(kOpenedViewHeight / 2), self.frame.size.height - kOpenedViewHeight/ 2)); + CGPoint center = CGPointMake(floor(self.frame.size.width / 2), MIN(offset + self.frame.size.height + floor(kOpenedViewHeight / 2), self.frame.size.height - kOpenedViewHeight/ 2)); + _activity.center = center; + _finishedLabel.center = center; _ignoreInset = YES; _ignoreOffset = YES; @@ -409,6 +418,7 @@ - (void)beginRefreshing _activity.alpha = 1; _activity.layer.transform = CATransform3DMakeScale(1, 1, 1); + _finishedLabel.alpha = 1; CGPoint offset = self.scrollView.contentOffset; _ignoreInset = YES; @@ -429,28 +439,40 @@ - (void)endRefreshing // halfway through the end animation. // This allows for the refresh control to clean up the observer, // in the case the scrollView is released while the animation is running + + // show finished label + // 显示完成标签 + _finishedLabel.alpha = 1; + _activity.alpha = 0; + _activity.layer.transform = CATransform3DMakeScale(0.1, 0.1, 1); + __block UIScrollView *blockScrollView = self.scrollView; - [UIView animateWithDuration:0.4 animations:^{ - _ignoreInset = YES; - [blockScrollView setContentInset:self.originalContentInset]; - _ignoreInset = NO; - _activity.alpha = 0; - _activity.layer.transform = CATransform3DMakeScale(0.1, 0.1, 1); - } completion:^(BOOL finished) { - [_shapeLayer removeAllAnimations]; - _shapeLayer.path = nil; - _shapeLayer.shadowPath = nil; - _shapeLayer.position = CGPointZero; - [_arrowLayer removeAllAnimations]; - _arrowLayer.path = nil; - [_highlightLayer removeAllAnimations]; - _highlightLayer.path = nil; - // We need to use the scrollView somehow in the end block, - // or it'll get released in the animation block. - _ignoreInset = YES; - [blockScrollView setContentInset:self.originalContentInset]; - _ignoreInset = NO; - }]; + + // default delay 0.5s show finished label; + // 默认延迟0.5s用来显示完成标签 + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(_finishedLabelShownInterval * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + [UIView animateWithDuration:0.4 animations:^{ + _ignoreInset = YES; + [blockScrollView setContentInset:self.originalContentInset]; + _ignoreInset = NO; + + _finishedLabel.alpha = 0; + } completion:^(BOOL finished) { + [_shapeLayer removeAllAnimations]; + _shapeLayer.path = nil; + _shapeLayer.shadowPath = nil; + _shapeLayer.position = CGPointZero; + [_arrowLayer removeAllAnimations]; + _arrowLayer.path = nil; + [_highlightLayer removeAllAnimations]; + _highlightLayer.path = nil; + // We need to use the scrollView somehow in the end block, + // or it'll get released in the animation block. + _ignoreInset = YES; + [blockScrollView setContentInset:self.originalContentInset]; + _ignoreInset = NO; + }]; + }); } } diff --git a/README.md b/README.md new file mode 100644 index 0000000..89bfc6f --- /dev/null +++ b/README.md @@ -0,0 +1,74 @@ +### 原作者的话: + +*Notice:* There's a new 2.0 branch where I updated the control for iOS7 plus I plan to do some interesting new features. If people could try it out so I can be sure I didn't break anything it'd be great, and report any issue you find, I'd really appreciate that :) + + + +# ODRefreshControl + +![refresh gif](https://github.com/wolfcon/ODRefreshControl/blob/master/下拉刷新.gif) + +ODRefreshControl is a "pull down to refresh" control for UIScrollView, like the one Apple introduced in iOS6, but available to anyone from iOS4 and up. + +## 安装方法(Installation) + +- Drag the `ODRefreshControl/ODRefreshControl` folder into your project. +- Add the **QuartzCore** framework to your project. +- `#import “ODRefreshControl.h"` + +***Important note if your project doesn't use ARC***: *you must add the `-fobjc-arc` compiler flag to `ODRefreshControl.m` in Target Settings > Build Phases > Compile Sources.* + +## 使用方法(Usage) + +(see sample Xcode project in `/Demo`) + +### 添加一个下拉刷新控件(Adding a refresh control to your table view) + +``` objective-c +ODRefreshControl *refreshControl = [[ODRefreshControl alloc] initInScrollView:self.tableView]; +``` + +给控件添加一个`UIControlEventValueChanged` 事件 +(*To know when the refresh operation has started, add an action method to the `UIControlEventValueChanged` event of the control*) + +``` objective-c +[refreshControl addTarget:self action:@selector(dropViewDidBeginRefreshing:) forControlEvents:UIControlEventValueChanged]; +``` + +一般不显式的调用程序来开始刷新, 除非你有此需要 +(*If you’d like to programmatically start the refresh operation, use*) + +``` objective-c +[refreshControl beginRefreshing]; +``` + +Remember to tell the control when the refresh operation has ended + +``` objective-c +[refreshControl endRefreshing]; +``` + +#### 可自定义的属性(Customization) + +The `ODRefreshControl` can be customized using the following properties: + +``` objective-c +@property (nonatomic, strong) UIColor *tintColor; + +@property (nonatomic, assign) UIActivityIndicatorViewStyle activityIndicatorViewStyle; + +@property (nonatomic, strong) UIColor *activityIndicatorViewColor; // iOS5 or more + +@property (nonatomic, strong) UILabel *finishedLabel; + +@property (nonatomic, assign) CGFloat finishedLabelShownInterval; // default 0.5s //默认0.5秒 +``` + + + +## Credits + +ODRefreshControl is brought to you by [Fabio Ritrovato](http://orangeinaday.com) and [contributors to the project](https://github.com/Sephiroth87/ODRefreshControl/contributors). If you have feature suggestions or bug reports, feel free to help out by sending pull requests or by [creating new issues](https://github.com/Sephiroth87/ODRefreshControl/issues/new). If you're using ODRefreshControl in your project, attribution would be nice. + + + diff --git a/README.textile b/README.textile deleted file mode 100644 index f7483f3..0000000 --- a/README.textile +++ /dev/null @@ -1,57 +0,0 @@ -__*Notice:* There's a new 2.0 branch where I updated the control for iOS7 plus I plan to do some interesting new features. If people could try it out so I can be sure I didn't break anything it'd be great, and report any issue you find, I'd really appreciate that :) - -h1. ODRefreshControl - -!http://www.orangeinaday.com/img/ODRefreshControl.jpg! - -ODRefreshControl is a "pull down to refresh" control for UIScrollView, like the one Apple introduced in iOS6, but available to anyone from iOS4 and up. - -h2. Installation - -* Drag the @ODRefreshControl/ODRefreshControl@ folder into your project. -* Add the *QuartzCore* framework to your project. -* @#import "ODRefreshControl.h"@ - -__*Important note if your project doesn't use ARC*: you must add the @-fobjc-arc@ compiler flag to @ODRefreshControl.m@ in Target Settings > Build Phases > Compile Sources.__ - -h2. Usage - -(see sample Xcode project in @/Demo@) - -h3. Adding a refresh control to your table view - -
-ODRefreshControl *refreshControl = [[ODRefreshControl alloc] initInScrollView:self.scrollView];
-
- -To know when the refresh operation has started, add an action method to the UIControlEventValueChanged event of the control - -
-[refreshControl addTarget:self action:@selector(dropViewDidBeginRefreshing:) forControlEvents:UIControlEventValueChanged];
-
- -If you’d like to programmatically start the refresh operation, use - -
-[refreshControl beginRefreshing];
-
- -Remember to tell the control when the refresh operation has ended - -
-[refreshControl endRefreshing];
-
- -h4. Customization - -The @ODRefreshControl@ can be customized using the following properties: - -
-@property (nonatomic, strong) UIColor *tintColor;
-@property (nonatomic, assign) UIActivityIndicatorViewStyle activityIndicatorViewStyle;
-@property (nonatomic, strong) UIColor *activityIndicatorViewColor; // iOS5 or more
-
- -h2. Credits - -ODRefreshControl is brought to you by "Fabio Ritrovato":http://orangeinaday.com and "contributors to the project":https://github.com/Sephiroth87/ODRefreshControl/contributors. If you have feature suggestions or bug reports, feel free to help out by sending pull requests or by "creating new issues":https://github.com/Sephiroth87/ODRefreshControl/issues/new. If you're using ODRefreshControl in your project, attribution would be nice. \ No newline at end of file diff --git "a/\344\270\213\346\213\211\345\210\267\346\226\260.gif" "b/\344\270\213\346\213\211\345\210\267\346\226\260.gif" new file mode 100644 index 0000000..e899fe8 Binary files /dev/null and "b/\344\270\213\346\213\211\345\210\267\346\226\260.gif" differ