├── demo.gif ├── XSPullRefreshDemo ├── XSPullRefreshDemo │ ├── .DS_Store │ ├── XSTableViewController.h │ ├── AppDelegate.h │ ├── XSPullRefreshControl │ │ ├── XSActivityView.h │ │ ├── XSPullRefreshControl.h │ │ ├── XSPullRefreshControl.m │ │ └── XSActivityView.m │ ├── main.m │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── XSTableViewController.m │ ├── Info.plist │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ └── AppDelegate.m ├── XSPullRefreshDemo.xcodeproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── project.pbxproj ├── XSPullRefreshDemoTests │ ├── Info.plist │ └── XSPullRefreshDemoTests.m └── XSPullRefreshDemoUITests │ ├── Info.plist │ └── XSPullRefreshDemoUITests.m ├── README.md ├── .gitignore └── LICENSE /demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animations/XSPullRefreshDemo/master/demo.gif -------------------------------------------------------------------------------- /XSPullRefreshDemo/XSPullRefreshDemo/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animations/XSPullRefreshDemo/master/XSPullRefreshDemo/XSPullRefreshDemo/.DS_Store -------------------------------------------------------------------------------- /XSPullRefreshDemo/XSPullRefreshDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /XSPullRefreshDemo/XSPullRefreshDemo/XSTableViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // XSTableViewController.h 3 | // XSPullRefreshDemo 4 | // 5 | // Created by 薛纪杰 on 15/12/5. 6 | // Copyright © 2015年 XueSeason. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface XSTableViewController : UITableViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /XSPullRefreshDemo/XSPullRefreshDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // XSPullRefreshDemo 4 | // 5 | // Created by 薛纪杰 on 15/12/5. 6 | // Copyright © 2015年 XueSeason. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /XSPullRefreshDemo/XSPullRefreshDemo/XSPullRefreshControl/XSActivityView.h: -------------------------------------------------------------------------------- 1 | // 2 | // XSActivityView.h 3 | // XSActivityViewDemo 4 | // 5 | // Created by 薛纪杰 on 15/12/6. 6 | // Copyright © 2015年 XueSeason. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | IB_DESIGNABLE 12 | @interface XSActivityView : UIView 13 | - (void)startEclipse; 14 | - (void)stopEclipse; 15 | @end 16 | -------------------------------------------------------------------------------- /XSPullRefreshDemo/XSPullRefreshDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // XSPullRefreshDemo 4 | // 5 | // Created by 薛纪杰 on 15/12/5. 6 | // Copyright © 2015年 XueSeason. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /XSPullRefreshDemo/XSPullRefreshDemo/XSPullRefreshControl/XSPullRefreshControl.h: -------------------------------------------------------------------------------- 1 | // 2 | // XSPullRefreshControl.h 3 | // XSPullRefreshDemo 4 | // 5 | // Created by 薛纪杰 on 15/12/5. 6 | // Copyright © 2015年 XueSeason. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface XSPullRefreshControl : UIControl 12 | 13 | - (void)attachToScrollView:(UIScrollView *)scrollView; 14 | 15 | - (void)beginRefreshing; 16 | 17 | - (void)endRefreshing; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # XSPullRefreshDemo 2 | An eclipse refresh view. 3 | 4 | ## Showcase 5 | ![image](https://github.com/XueSeason/XSPullRefreshDemo/blob/master/demo.gif) 6 | 7 | ## Communication 8 | 9 | - If you found a bug, and can provide steps to reliably reproduce it, open an issue. 10 | - If you have a feature request, open an issue. 11 | - If you want to contribute, submit a pull request. 12 | 13 | ## Author 14 | 15 | [XueSeason](https://github.com/xueseason) 16 | Weibo: [XueSeason](http://weibo.com/smartseason) 17 | 18 | ## License 19 | 20 | XSPullRefreshDemo is released under the MIT license. See LICENSE for details. 21 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | # Xcode 3 | # 4 | build/ 5 | *.pbxuser 6 | !default.pbxuser 7 | *.mode1v3 8 | !default.mode1v3 9 | *.mode2v3 10 | !default.mode2v3 11 | *.perspectivev3 12 | !default.perspectivev3 13 | xcuserdata 14 | *.xccheckout 15 | *.moved-aside 16 | DerivedData 17 | *.hmap 18 | *.ipa 19 | *.xcuserstate 20 | 21 | # CocoaPods 22 | # 23 | # We recommend against adding the Pods directory to your .gitignore. However 24 | # you should judge for yourself, the pros and cons are mentioned at: 25 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 26 | # 27 | #Pods/ 28 | -------------------------------------------------------------------------------- /XSPullRefreshDemo/XSPullRefreshDemo/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /XSPullRefreshDemo/XSPullRefreshDemo/XSTableViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // XSTableViewController.m 3 | // XSPullRefreshDemo 4 | // 5 | // Created by 薛纪杰 on 15/12/5. 6 | // Copyright © 2015年 XueSeason. All rights reserved. 7 | // 8 | 9 | #import "XSTableViewController.h" 10 | 11 | #import "XSPullRefreshControl.h" 12 | 13 | @interface XSTableViewController () 14 | @property (strong, nonatomic) XSPullRefreshControl *pullRefreshControl; 15 | @end 16 | 17 | @implementation XSTableViewController 18 | 19 | - (void)viewDidLoad { 20 | [super viewDidLoad]; 21 | self.pullRefreshControl = [[XSPullRefreshControl alloc] init]; 22 | [self.pullRefreshControl attachToScrollView:self.tableView]; 23 | } 24 | 25 | - (void)controlDidStartAnimation { 26 | 27 | } 28 | 29 | - (IBAction)endAnimationHandle { 30 | [self.pullRefreshControl endRefreshing]; 31 | } 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /XSPullRefreshDemo/XSPullRefreshDemoTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /XSPullRefreshDemo/XSPullRefreshDemoUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /XSPullRefreshDemo/XSPullRefreshDemoTests/XSPullRefreshDemoTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // XSPullRefreshDemoTests.m 3 | // XSPullRefreshDemoTests 4 | // 5 | // Created by 薛纪杰 on 15/12/5. 6 | // Copyright © 2015年 XueSeason. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface XSPullRefreshDemoTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation XSPullRefreshDemoTests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | // Put setup code here. This method is called before the invocation of each test method in the class. 20 | } 21 | 22 | - (void)tearDown { 23 | // Put teardown code here. This method is called after the invocation of each test method in the class. 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample { 28 | // This is an example of a functional test case. 29 | // Use XCTAssert and related functions to verify your tests produce the correct results. 30 | } 31 | 32 | - (void)testPerformanceExample { 33 | // This is an example of a performance test case. 34 | [self measureBlock:^{ 35 | // Put the code you want to measure the time of here. 36 | }]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 XueSeason 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /XSPullRefreshDemo/XSPullRefreshDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /XSPullRefreshDemo/XSPullRefreshDemoUITests/XSPullRefreshDemoUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // XSPullRefreshDemoUITests.m 3 | // XSPullRefreshDemoUITests 4 | // 5 | // Created by 薛纪杰 on 15/12/5. 6 | // Copyright © 2015年 XueSeason. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface XSPullRefreshDemoUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation XSPullRefreshDemoUITests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | 22 | // In UI tests it is usually best to stop immediately when a failure occurs. 23 | self.continueAfterFailure = NO; 24 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 25 | [[[XCUIApplication alloc] init] launch]; 26 | 27 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 28 | } 29 | 30 | - (void)tearDown { 31 | // Put teardown code here. This method is called after the invocation of each test method in the class. 32 | [super tearDown]; 33 | } 34 | 35 | - (void)testExample { 36 | // Use recording to get started writing UI tests. 37 | // Use XCTAssert and related functions to verify your tests produce the correct results. 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /XSPullRefreshDemo/XSPullRefreshDemo/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /XSPullRefreshDemo/XSPullRefreshDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // XSPullRefreshDemo 4 | // 5 | // Created by 薛纪杰 on 15/12/5. 6 | // Copyright © 2015年 XueSeason. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | - (void)applicationWillResignActive:(UIApplication *)application { 24 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 25 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 26 | } 27 | 28 | - (void)applicationDidEnterBackground:(UIApplication *)application { 29 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 31 | } 32 | 33 | - (void)applicationWillEnterForeground:(UIApplication *)application { 34 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 35 | } 36 | 37 | - (void)applicationDidBecomeActive:(UIApplication *)application { 38 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application { 42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /XSPullRefreshDemo/XSPullRefreshDemo/XSPullRefreshControl/XSPullRefreshControl.m: -------------------------------------------------------------------------------- 1 | // 2 | // XSPullRefreshControl.m 3 | // XSPullRefreshDemo 4 | // 5 | // Created by 薛纪杰 on 15/12/5. 6 | // Copyright © 2015年 XueSeason. All rights reserved. 7 | // 8 | 9 | #import "XSPullRefreshControl.h" 10 | #import "XSActivityView.h" 11 | 12 | static const CGFloat defaultHeight = 100.0f; 13 | static const CGFloat springTreshold = 120.0f; 14 | 15 | static const CGFloat animationDuration = 1.0f; 16 | static const CGFloat animationDamping = 0.4f; 17 | static const CGFloat animationVelosity = 0.8f; 18 | 19 | @interface XSPullRefreshControl () 20 | @property (weak, nonatomic) UIScrollView *scrollView; 21 | @property (strong, nonatomic) XSActivityView *activityView; 22 | @end 23 | 24 | @implementation XSPullRefreshControl 25 | 26 | #pragma mark - init 27 | - (instancetype)initWithFrame:(CGRect)frame { 28 | self = [super initWithFrame:frame]; 29 | if (self) { 30 | [self setup]; 31 | } 32 | return self; 33 | } 34 | 35 | - (void)setup { 36 | self.activityView = [XSActivityView new]; 37 | [self addSubview:self.activityView]; 38 | } 39 | 40 | #pragma mark - public methods 41 | - (void)attachToScrollView:(UIScrollView *)scrollView { 42 | self.scrollView = scrollView; 43 | 44 | [self.scrollView addObserver:self forKeyPath:@"contentOffset" options:NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld context:nil]; 45 | self.frame = CGRectMake(0, 0, CGRectGetWidth(self.scrollView.frame), 0); 46 | [self.scrollView addSubview:self]; 47 | } 48 | 49 | - (void)beginRefreshing { 50 | self.scrollView.contentInset = UIEdgeInsetsMake(defaultHeight, 0, 0, 0); 51 | [self.scrollView setContentOffset:CGPointMake(0, -defaultHeight) animated:YES]; 52 | [self.activityView startEclipse]; 53 | } 54 | 55 | - (void)endRefreshing { 56 | [self returnDefaultState]; 57 | [self.activityView stopEclipse]; 58 | } 59 | 60 | #pragma mark - private methods 61 | - (void)calculate { 62 | self.frame = CGRectMake(0, 0, CGRectGetWidth(self.scrollView.frame), self.scrollView.contentOffset.y); 63 | self.activityView.frame = self.bounds; 64 | // 开始拖动超过默认高度 65 | if (self.scrollView.contentOffset.y <= -defaultHeight) { 66 | 67 | // 超过弹簧阀值 68 | if (self.scrollView.contentOffset.y < -springTreshold) { 69 | // 使偏移量在阀值位置固定 70 | self.scrollView.contentOffset = CGPointMake(0, -springTreshold); 71 | } 72 | 73 | // 执行具体下拉动画操作 74 | } 75 | 76 | if (!self.scrollView.dragging && self.scrollView.decelerating) { 77 | [self beginRefreshing]; 78 | } 79 | } 80 | 81 | - (void)returnDefaultState { 82 | [UIView animateWithDuration:animationDuration 83 | delay:0.0f 84 | usingSpringWithDamping:animationDamping 85 | initialSpringVelocity:animationVelosity 86 | options:UIViewAnimationOptionCurveLinear 87 | animations:^{ 88 | self.scrollView.contentInset = UIEdgeInsetsZero; 89 | } completion:nil]; 90 | } 91 | 92 | #pragma mark - KVO 93 | - (void)observeValueForKeyPath:(NSString *)keyPath 94 | ofObject:(id)object 95 | change:(NSDictionary *)change 96 | context:(void *)context { 97 | [self calculate]; 98 | } 99 | 100 | - (void)dealloc { 101 | [self.scrollView removeObserver:self forKeyPath:@"contentOffset"]; 102 | } 103 | 104 | @end 105 | -------------------------------------------------------------------------------- /XSPullRefreshDemo/XSPullRefreshDemo/XSPullRefreshControl/XSActivityView.m: -------------------------------------------------------------------------------- 1 | // 2 | // XSActivityView.m 3 | // XSActivityViewDemo 4 | // 5 | // Created by 薛纪杰 on 15/12/6. 6 | // Copyright © 2015年 XueSeason. All rights reserved. 7 | // 8 | 9 | #import "XSActivityView.h" 10 | 11 | #define SUN_COLOR [UIColor colorWithRed:1.0 green:159 / 255.0 blue:0.0 alpha:1.0] 12 | 13 | static const CGFloat animationDuration = 3.0f; 14 | static const CGFloat margin = 20.0; 15 | 16 | @interface XSActivityView () 17 | @property (strong, nonatomic) CALayer *sunLayer; 18 | @property (strong, nonatomic) CALayer *moonLayer; 19 | @end 20 | 21 | @implementation XSActivityView 22 | 23 | - (instancetype)initWithCoder:(NSCoder *)coder 24 | { 25 | self = [super initWithCoder:coder]; 26 | if (self) { 27 | [self setup]; 28 | } 29 | return self; 30 | } 31 | 32 | - (instancetype)initWithFrame:(CGRect)frame 33 | { 34 | self = [super initWithFrame:frame]; 35 | if (self) { 36 | [self setup]; 37 | } 38 | return self; 39 | } 40 | 41 | - (void)setup { 42 | [self.layer addSublayer:self.sunLayer]; 43 | [self.layer addSublayer:self.moonLayer]; 44 | 45 | self.backgroundColor = [UIColor whiteColor]; 46 | self.moonLayer.backgroundColor = [UIColor whiteColor].CGColor; 47 | self.clipsToBounds = YES; 48 | } 49 | 50 | - (void)layoutSubviews { 51 | [super layoutSubviews]; 52 | CGFloat width = CGRectGetWidth(self.bounds); 53 | CGFloat height = CGRectGetHeight(self.bounds); 54 | CGFloat vMargin, hMargin; 55 | if (width > height) { 56 | vMargin = margin; 57 | hMargin = (width - (height - 2 * margin)) / 2.0; 58 | } else { 59 | hMargin = margin; 60 | vMargin = (height - (width - 2 * margin)) / 2.0; 61 | } 62 | 63 | self.sunLayer.frame = UIEdgeInsetsInsetRect(self.bounds, UIEdgeInsetsMake(vMargin, hMargin, vMargin, hMargin)); 64 | self.sunLayer.cornerRadius = CGRectGetWidth(self.sunLayer.frame) / 2.0; 65 | 66 | self.moonLayer.cornerRadius = self.sunLayer.cornerRadius; 67 | // [-90, 90] 68 | self.moonLayer.frame = CGRectOffset(self.sunLayer.frame, CGRectGetWidth(self.sunLayer.frame), 0); 69 | } 70 | 71 | - (void)startEclipse { 72 | CABasicAnimation *eclipseAnimation = [CABasicAnimation animationWithKeyPath:@"position.x"]; 73 | eclipseAnimation.fromValue = @(CGRectGetMidX(self.moonLayer.frame)); 74 | eclipseAnimation.byValue = @(- CGRectGetWidth(self.moonLayer.frame) * 2); 75 | eclipseAnimation.duration = animationDuration; 76 | eclipseAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; 77 | 78 | CAKeyframeAnimation *skyColorAniamtion = [CAKeyframeAnimation animationWithKeyPath:@"backgroundColor"]; 79 | skyColorAniamtion.values = @[(id)[UIColor whiteColor].CGColor, (id)[UIColor blackColor].CGColor, (id)[UIColor whiteColor].CGColor]; 80 | skyColorAniamtion.keyTimes = @[@0, @0.5, @1]; 81 | skyColorAniamtion.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; 82 | skyColorAniamtion.duration = animationDuration; 83 | 84 | CAAnimationGroup *group = [[CAAnimationGroup alloc] init]; 85 | group.animations = @[eclipseAnimation, skyColorAniamtion]; 86 | group.duration = animationDuration; 87 | group.repeatCount = HUGE_VAL; 88 | 89 | [self.moonLayer addAnimation:group forKey:@"eclipse"]; 90 | skyColorAniamtion.repeatCount = HUGE_VAL; 91 | [self.layer addAnimation:skyColorAniamtion forKey:@"sky"]; 92 | } 93 | 94 | - (void)stopEclipse { 95 | [self.moonLayer removeAllAnimations]; 96 | [self.layer removeAllAnimations]; 97 | } 98 | 99 | #pragma mark - getters and setters 100 | - (CALayer *)sunLayer { 101 | if (!_sunLayer) { 102 | _sunLayer = [CALayer layer]; 103 | _sunLayer.backgroundColor = SUN_COLOR.CGColor; 104 | } 105 | return _sunLayer; 106 | } 107 | 108 | - (CALayer *)moonLayer { 109 | if (!_moonLayer) { 110 | _moonLayer = [CALayer layer]; 111 | } 112 | return _moonLayer; 113 | } 114 | 115 | @end 116 | -------------------------------------------------------------------------------- /XSPullRefreshDemo/XSPullRefreshDemo/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | -------------------------------------------------------------------------------- /XSPullRefreshDemo/XSPullRefreshDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | B13E5EA71C1321F000FCB95D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = B13E5EA61C1321F000FCB95D /* main.m */; }; 11 | B13E5EAA1C1321F000FCB95D /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = B13E5EA91C1321F000FCB95D /* AppDelegate.m */; }; 12 | B13E5EB01C1321F000FCB95D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B13E5EAE1C1321F000FCB95D /* Main.storyboard */; }; 13 | B13E5EB21C1321F000FCB95D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B13E5EB11C1321F000FCB95D /* Assets.xcassets */; }; 14 | B13E5EB51C1321F000FCB95D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B13E5EB31C1321F000FCB95D /* LaunchScreen.storyboard */; }; 15 | B13E5EC01C1321F000FCB95D /* XSPullRefreshDemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B13E5EBF1C1321F000FCB95D /* XSPullRefreshDemoTests.m */; }; 16 | B13E5ECB1C1321F000FCB95D /* XSPullRefreshDemoUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = B13E5ECA1C1321F000FCB95D /* XSPullRefreshDemoUITests.m */; }; 17 | B13E5EDB1C13226500FCB95D /* XSTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B13E5EDA1C13226500FCB95D /* XSTableViewController.m */; }; 18 | B13E5EDE1C13253C00FCB95D /* XSPullRefreshControl.m in Sources */ = {isa = PBXBuildFile; fileRef = B13E5EDD1C13253C00FCB95D /* XSPullRefreshControl.m */; }; 19 | B13E5EE11C13C97C00FCB95D /* XSActivityView.m in Sources */ = {isa = PBXBuildFile; fileRef = B13E5EE01C13C97C00FCB95D /* XSActivityView.m */; }; 20 | /* End PBXBuildFile section */ 21 | 22 | /* Begin PBXContainerItemProxy section */ 23 | B13E5EBC1C1321F000FCB95D /* PBXContainerItemProxy */ = { 24 | isa = PBXContainerItemProxy; 25 | containerPortal = B13E5E9A1C1321F000FCB95D /* Project object */; 26 | proxyType = 1; 27 | remoteGlobalIDString = B13E5EA11C1321F000FCB95D; 28 | remoteInfo = XSPullRefreshDemo; 29 | }; 30 | B13E5EC71C1321F000FCB95D /* PBXContainerItemProxy */ = { 31 | isa = PBXContainerItemProxy; 32 | containerPortal = B13E5E9A1C1321F000FCB95D /* Project object */; 33 | proxyType = 1; 34 | remoteGlobalIDString = B13E5EA11C1321F000FCB95D; 35 | remoteInfo = XSPullRefreshDemo; 36 | }; 37 | /* End PBXContainerItemProxy section */ 38 | 39 | /* Begin PBXFileReference section */ 40 | B13E5EA21C1321F000FCB95D /* XSPullRefreshDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = XSPullRefreshDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 41 | B13E5EA61C1321F000FCB95D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 42 | B13E5EA81C1321F000FCB95D /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 43 | B13E5EA91C1321F000FCB95D /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 44 | B13E5EAF1C1321F000FCB95D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 45 | B13E5EB11C1321F000FCB95D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 46 | B13E5EB41C1321F000FCB95D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 47 | B13E5EB61C1321F000FCB95D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 48 | B13E5EBB1C1321F000FCB95D /* XSPullRefreshDemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = XSPullRefreshDemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 49 | B13E5EBF1C1321F000FCB95D /* XSPullRefreshDemoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XSPullRefreshDemoTests.m; sourceTree = ""; }; 50 | B13E5EC11C1321F000FCB95D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 51 | B13E5EC61C1321F000FCB95D /* XSPullRefreshDemoUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = XSPullRefreshDemoUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 52 | B13E5ECA1C1321F000FCB95D /* XSPullRefreshDemoUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XSPullRefreshDemoUITests.m; sourceTree = ""; }; 53 | B13E5ECC1C1321F000FCB95D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 54 | B13E5ED91C13226500FCB95D /* XSTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XSTableViewController.h; sourceTree = ""; }; 55 | B13E5EDA1C13226500FCB95D /* XSTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XSTableViewController.m; sourceTree = ""; }; 56 | B13E5EDC1C13253C00FCB95D /* XSPullRefreshControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XSPullRefreshControl.h; sourceTree = ""; }; 57 | B13E5EDD1C13253C00FCB95D /* XSPullRefreshControl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XSPullRefreshControl.m; sourceTree = ""; }; 58 | B13E5EDF1C13C97C00FCB95D /* XSActivityView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XSActivityView.h; sourceTree = ""; }; 59 | B13E5EE01C13C97C00FCB95D /* XSActivityView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XSActivityView.m; sourceTree = ""; }; 60 | /* End PBXFileReference section */ 61 | 62 | /* Begin PBXFrameworksBuildPhase section */ 63 | B13E5E9F1C1321F000FCB95D /* Frameworks */ = { 64 | isa = PBXFrameworksBuildPhase; 65 | buildActionMask = 2147483647; 66 | files = ( 67 | ); 68 | runOnlyForDeploymentPostprocessing = 0; 69 | }; 70 | B13E5EB81C1321F000FCB95D /* Frameworks */ = { 71 | isa = PBXFrameworksBuildPhase; 72 | buildActionMask = 2147483647; 73 | files = ( 74 | ); 75 | runOnlyForDeploymentPostprocessing = 0; 76 | }; 77 | B13E5EC31C1321F000FCB95D /* Frameworks */ = { 78 | isa = PBXFrameworksBuildPhase; 79 | buildActionMask = 2147483647; 80 | files = ( 81 | ); 82 | runOnlyForDeploymentPostprocessing = 0; 83 | }; 84 | /* End PBXFrameworksBuildPhase section */ 85 | 86 | /* Begin PBXGroup section */ 87 | B13E5E991C1321F000FCB95D = { 88 | isa = PBXGroup; 89 | children = ( 90 | B13E5EA41C1321F000FCB95D /* XSPullRefreshDemo */, 91 | B13E5EBE1C1321F000FCB95D /* XSPullRefreshDemoTests */, 92 | B13E5EC91C1321F000FCB95D /* XSPullRefreshDemoUITests */, 93 | B13E5EA31C1321F000FCB95D /* Products */, 94 | ); 95 | sourceTree = ""; 96 | }; 97 | B13E5EA31C1321F000FCB95D /* Products */ = { 98 | isa = PBXGroup; 99 | children = ( 100 | B13E5EA21C1321F000FCB95D /* XSPullRefreshDemo.app */, 101 | B13E5EBB1C1321F000FCB95D /* XSPullRefreshDemoTests.xctest */, 102 | B13E5EC61C1321F000FCB95D /* XSPullRefreshDemoUITests.xctest */, 103 | ); 104 | name = Products; 105 | sourceTree = ""; 106 | }; 107 | B13E5EA41C1321F000FCB95D /* XSPullRefreshDemo */ = { 108 | isa = PBXGroup; 109 | children = ( 110 | B13E5ED81C13224300FCB95D /* XSPullRefreshControl */, 111 | B13E5EAE1C1321F000FCB95D /* Main.storyboard */, 112 | B13E5ED91C13226500FCB95D /* XSTableViewController.h */, 113 | B13E5EDA1C13226500FCB95D /* XSTableViewController.m */, 114 | B13E5EB11C1321F000FCB95D /* Assets.xcassets */, 115 | B13E5EA51C1321F000FCB95D /* Supporting Files */, 116 | ); 117 | path = XSPullRefreshDemo; 118 | sourceTree = ""; 119 | }; 120 | B13E5EA51C1321F000FCB95D /* Supporting Files */ = { 121 | isa = PBXGroup; 122 | children = ( 123 | B13E5EA81C1321F000FCB95D /* AppDelegate.h */, 124 | B13E5EA91C1321F000FCB95D /* AppDelegate.m */, 125 | B13E5EB31C1321F000FCB95D /* LaunchScreen.storyboard */, 126 | B13E5EB61C1321F000FCB95D /* Info.plist */, 127 | B13E5EA61C1321F000FCB95D /* main.m */, 128 | ); 129 | name = "Supporting Files"; 130 | sourceTree = ""; 131 | }; 132 | B13E5EBE1C1321F000FCB95D /* XSPullRefreshDemoTests */ = { 133 | isa = PBXGroup; 134 | children = ( 135 | B13E5EBF1C1321F000FCB95D /* XSPullRefreshDemoTests.m */, 136 | B13E5EC11C1321F000FCB95D /* Info.plist */, 137 | ); 138 | path = XSPullRefreshDemoTests; 139 | sourceTree = ""; 140 | }; 141 | B13E5EC91C1321F000FCB95D /* XSPullRefreshDemoUITests */ = { 142 | isa = PBXGroup; 143 | children = ( 144 | B13E5ECA1C1321F000FCB95D /* XSPullRefreshDemoUITests.m */, 145 | B13E5ECC1C1321F000FCB95D /* Info.plist */, 146 | ); 147 | path = XSPullRefreshDemoUITests; 148 | sourceTree = ""; 149 | }; 150 | B13E5ED81C13224300FCB95D /* XSPullRefreshControl */ = { 151 | isa = PBXGroup; 152 | children = ( 153 | B13E5EDC1C13253C00FCB95D /* XSPullRefreshControl.h */, 154 | B13E5EDD1C13253C00FCB95D /* XSPullRefreshControl.m */, 155 | B13E5EDF1C13C97C00FCB95D /* XSActivityView.h */, 156 | B13E5EE01C13C97C00FCB95D /* XSActivityView.m */, 157 | ); 158 | path = XSPullRefreshControl; 159 | sourceTree = ""; 160 | }; 161 | /* End PBXGroup section */ 162 | 163 | /* Begin PBXNativeTarget section */ 164 | B13E5EA11C1321F000FCB95D /* XSPullRefreshDemo */ = { 165 | isa = PBXNativeTarget; 166 | buildConfigurationList = B13E5ECF1C1321F000FCB95D /* Build configuration list for PBXNativeTarget "XSPullRefreshDemo" */; 167 | buildPhases = ( 168 | B13E5E9E1C1321F000FCB95D /* Sources */, 169 | B13E5E9F1C1321F000FCB95D /* Frameworks */, 170 | B13E5EA01C1321F000FCB95D /* Resources */, 171 | ); 172 | buildRules = ( 173 | ); 174 | dependencies = ( 175 | ); 176 | name = XSPullRefreshDemo; 177 | productName = XSPullRefreshDemo; 178 | productReference = B13E5EA21C1321F000FCB95D /* XSPullRefreshDemo.app */; 179 | productType = "com.apple.product-type.application"; 180 | }; 181 | B13E5EBA1C1321F000FCB95D /* XSPullRefreshDemoTests */ = { 182 | isa = PBXNativeTarget; 183 | buildConfigurationList = B13E5ED21C1321F000FCB95D /* Build configuration list for PBXNativeTarget "XSPullRefreshDemoTests" */; 184 | buildPhases = ( 185 | B13E5EB71C1321F000FCB95D /* Sources */, 186 | B13E5EB81C1321F000FCB95D /* Frameworks */, 187 | B13E5EB91C1321F000FCB95D /* Resources */, 188 | ); 189 | buildRules = ( 190 | ); 191 | dependencies = ( 192 | B13E5EBD1C1321F000FCB95D /* PBXTargetDependency */, 193 | ); 194 | name = XSPullRefreshDemoTests; 195 | productName = XSPullRefreshDemoTests; 196 | productReference = B13E5EBB1C1321F000FCB95D /* XSPullRefreshDemoTests.xctest */; 197 | productType = "com.apple.product-type.bundle.unit-test"; 198 | }; 199 | B13E5EC51C1321F000FCB95D /* XSPullRefreshDemoUITests */ = { 200 | isa = PBXNativeTarget; 201 | buildConfigurationList = B13E5ED51C1321F000FCB95D /* Build configuration list for PBXNativeTarget "XSPullRefreshDemoUITests" */; 202 | buildPhases = ( 203 | B13E5EC21C1321F000FCB95D /* Sources */, 204 | B13E5EC31C1321F000FCB95D /* Frameworks */, 205 | B13E5EC41C1321F000FCB95D /* Resources */, 206 | ); 207 | buildRules = ( 208 | ); 209 | dependencies = ( 210 | B13E5EC81C1321F000FCB95D /* PBXTargetDependency */, 211 | ); 212 | name = XSPullRefreshDemoUITests; 213 | productName = XSPullRefreshDemoUITests; 214 | productReference = B13E5EC61C1321F000FCB95D /* XSPullRefreshDemoUITests.xctest */; 215 | productType = "com.apple.product-type.bundle.ui-testing"; 216 | }; 217 | /* End PBXNativeTarget section */ 218 | 219 | /* Begin PBXProject section */ 220 | B13E5E9A1C1321F000FCB95D /* Project object */ = { 221 | isa = PBXProject; 222 | attributes = { 223 | LastUpgradeCheck = 0710; 224 | ORGANIZATIONNAME = XueSeason; 225 | TargetAttributes = { 226 | B13E5EA11C1321F000FCB95D = { 227 | CreatedOnToolsVersion = 7.1.1; 228 | }; 229 | B13E5EBA1C1321F000FCB95D = { 230 | CreatedOnToolsVersion = 7.1.1; 231 | TestTargetID = B13E5EA11C1321F000FCB95D; 232 | }; 233 | B13E5EC51C1321F000FCB95D = { 234 | CreatedOnToolsVersion = 7.1.1; 235 | TestTargetID = B13E5EA11C1321F000FCB95D; 236 | }; 237 | }; 238 | }; 239 | buildConfigurationList = B13E5E9D1C1321F000FCB95D /* Build configuration list for PBXProject "XSPullRefreshDemo" */; 240 | compatibilityVersion = "Xcode 3.2"; 241 | developmentRegion = English; 242 | hasScannedForEncodings = 0; 243 | knownRegions = ( 244 | en, 245 | Base, 246 | ); 247 | mainGroup = B13E5E991C1321F000FCB95D; 248 | productRefGroup = B13E5EA31C1321F000FCB95D /* Products */; 249 | projectDirPath = ""; 250 | projectRoot = ""; 251 | targets = ( 252 | B13E5EA11C1321F000FCB95D /* XSPullRefreshDemo */, 253 | B13E5EBA1C1321F000FCB95D /* XSPullRefreshDemoTests */, 254 | B13E5EC51C1321F000FCB95D /* XSPullRefreshDemoUITests */, 255 | ); 256 | }; 257 | /* End PBXProject section */ 258 | 259 | /* Begin PBXResourcesBuildPhase section */ 260 | B13E5EA01C1321F000FCB95D /* Resources */ = { 261 | isa = PBXResourcesBuildPhase; 262 | buildActionMask = 2147483647; 263 | files = ( 264 | B13E5EB51C1321F000FCB95D /* LaunchScreen.storyboard in Resources */, 265 | B13E5EB21C1321F000FCB95D /* Assets.xcassets in Resources */, 266 | B13E5EB01C1321F000FCB95D /* Main.storyboard in Resources */, 267 | ); 268 | runOnlyForDeploymentPostprocessing = 0; 269 | }; 270 | B13E5EB91C1321F000FCB95D /* Resources */ = { 271 | isa = PBXResourcesBuildPhase; 272 | buildActionMask = 2147483647; 273 | files = ( 274 | ); 275 | runOnlyForDeploymentPostprocessing = 0; 276 | }; 277 | B13E5EC41C1321F000FCB95D /* Resources */ = { 278 | isa = PBXResourcesBuildPhase; 279 | buildActionMask = 2147483647; 280 | files = ( 281 | ); 282 | runOnlyForDeploymentPostprocessing = 0; 283 | }; 284 | /* End PBXResourcesBuildPhase section */ 285 | 286 | /* Begin PBXSourcesBuildPhase section */ 287 | B13E5E9E1C1321F000FCB95D /* Sources */ = { 288 | isa = PBXSourcesBuildPhase; 289 | buildActionMask = 2147483647; 290 | files = ( 291 | B13E5EE11C13C97C00FCB95D /* XSActivityView.m in Sources */, 292 | B13E5EAA1C1321F000FCB95D /* AppDelegate.m in Sources */, 293 | B13E5EDE1C13253C00FCB95D /* XSPullRefreshControl.m in Sources */, 294 | B13E5EDB1C13226500FCB95D /* XSTableViewController.m in Sources */, 295 | B13E5EA71C1321F000FCB95D /* main.m in Sources */, 296 | ); 297 | runOnlyForDeploymentPostprocessing = 0; 298 | }; 299 | B13E5EB71C1321F000FCB95D /* Sources */ = { 300 | isa = PBXSourcesBuildPhase; 301 | buildActionMask = 2147483647; 302 | files = ( 303 | B13E5EC01C1321F000FCB95D /* XSPullRefreshDemoTests.m in Sources */, 304 | ); 305 | runOnlyForDeploymentPostprocessing = 0; 306 | }; 307 | B13E5EC21C1321F000FCB95D /* Sources */ = { 308 | isa = PBXSourcesBuildPhase; 309 | buildActionMask = 2147483647; 310 | files = ( 311 | B13E5ECB1C1321F000FCB95D /* XSPullRefreshDemoUITests.m in Sources */, 312 | ); 313 | runOnlyForDeploymentPostprocessing = 0; 314 | }; 315 | /* End PBXSourcesBuildPhase section */ 316 | 317 | /* Begin PBXTargetDependency section */ 318 | B13E5EBD1C1321F000FCB95D /* PBXTargetDependency */ = { 319 | isa = PBXTargetDependency; 320 | target = B13E5EA11C1321F000FCB95D /* XSPullRefreshDemo */; 321 | targetProxy = B13E5EBC1C1321F000FCB95D /* PBXContainerItemProxy */; 322 | }; 323 | B13E5EC81C1321F000FCB95D /* PBXTargetDependency */ = { 324 | isa = PBXTargetDependency; 325 | target = B13E5EA11C1321F000FCB95D /* XSPullRefreshDemo */; 326 | targetProxy = B13E5EC71C1321F000FCB95D /* PBXContainerItemProxy */; 327 | }; 328 | /* End PBXTargetDependency section */ 329 | 330 | /* Begin PBXVariantGroup section */ 331 | B13E5EAE1C1321F000FCB95D /* Main.storyboard */ = { 332 | isa = PBXVariantGroup; 333 | children = ( 334 | B13E5EAF1C1321F000FCB95D /* Base */, 335 | ); 336 | name = Main.storyboard; 337 | sourceTree = ""; 338 | }; 339 | B13E5EB31C1321F000FCB95D /* LaunchScreen.storyboard */ = { 340 | isa = PBXVariantGroup; 341 | children = ( 342 | B13E5EB41C1321F000FCB95D /* Base */, 343 | ); 344 | name = LaunchScreen.storyboard; 345 | sourceTree = ""; 346 | }; 347 | /* End PBXVariantGroup section */ 348 | 349 | /* Begin XCBuildConfiguration section */ 350 | B13E5ECD1C1321F000FCB95D /* Debug */ = { 351 | isa = XCBuildConfiguration; 352 | buildSettings = { 353 | ALWAYS_SEARCH_USER_PATHS = NO; 354 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 355 | CLANG_CXX_LIBRARY = "libc++"; 356 | CLANG_ENABLE_MODULES = YES; 357 | CLANG_ENABLE_OBJC_ARC = YES; 358 | CLANG_WARN_BOOL_CONVERSION = YES; 359 | CLANG_WARN_CONSTANT_CONVERSION = YES; 360 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 361 | CLANG_WARN_EMPTY_BODY = YES; 362 | CLANG_WARN_ENUM_CONVERSION = YES; 363 | CLANG_WARN_INT_CONVERSION = YES; 364 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 365 | CLANG_WARN_UNREACHABLE_CODE = YES; 366 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 367 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 368 | COPY_PHASE_STRIP = NO; 369 | DEBUG_INFORMATION_FORMAT = dwarf; 370 | ENABLE_STRICT_OBJC_MSGSEND = YES; 371 | ENABLE_TESTABILITY = YES; 372 | GCC_C_LANGUAGE_STANDARD = gnu99; 373 | GCC_DYNAMIC_NO_PIC = NO; 374 | GCC_NO_COMMON_BLOCKS = YES; 375 | GCC_OPTIMIZATION_LEVEL = 0; 376 | GCC_PREPROCESSOR_DEFINITIONS = ( 377 | "DEBUG=1", 378 | "$(inherited)", 379 | ); 380 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 381 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 382 | GCC_WARN_UNDECLARED_SELECTOR = YES; 383 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 384 | GCC_WARN_UNUSED_FUNCTION = YES; 385 | GCC_WARN_UNUSED_VARIABLE = YES; 386 | IPHONEOS_DEPLOYMENT_TARGET = 9.1; 387 | MTL_ENABLE_DEBUG_INFO = YES; 388 | ONLY_ACTIVE_ARCH = YES; 389 | SDKROOT = iphoneos; 390 | }; 391 | name = Debug; 392 | }; 393 | B13E5ECE1C1321F000FCB95D /* Release */ = { 394 | isa = XCBuildConfiguration; 395 | buildSettings = { 396 | ALWAYS_SEARCH_USER_PATHS = NO; 397 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 398 | CLANG_CXX_LIBRARY = "libc++"; 399 | CLANG_ENABLE_MODULES = YES; 400 | CLANG_ENABLE_OBJC_ARC = YES; 401 | CLANG_WARN_BOOL_CONVERSION = YES; 402 | CLANG_WARN_CONSTANT_CONVERSION = YES; 403 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 404 | CLANG_WARN_EMPTY_BODY = YES; 405 | CLANG_WARN_ENUM_CONVERSION = YES; 406 | CLANG_WARN_INT_CONVERSION = YES; 407 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 408 | CLANG_WARN_UNREACHABLE_CODE = YES; 409 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 410 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 411 | COPY_PHASE_STRIP = NO; 412 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 413 | ENABLE_NS_ASSERTIONS = NO; 414 | ENABLE_STRICT_OBJC_MSGSEND = YES; 415 | GCC_C_LANGUAGE_STANDARD = gnu99; 416 | GCC_NO_COMMON_BLOCKS = YES; 417 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 418 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 419 | GCC_WARN_UNDECLARED_SELECTOR = YES; 420 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 421 | GCC_WARN_UNUSED_FUNCTION = YES; 422 | GCC_WARN_UNUSED_VARIABLE = YES; 423 | IPHONEOS_DEPLOYMENT_TARGET = 9.1; 424 | MTL_ENABLE_DEBUG_INFO = NO; 425 | SDKROOT = iphoneos; 426 | VALIDATE_PRODUCT = YES; 427 | }; 428 | name = Release; 429 | }; 430 | B13E5ED01C1321F000FCB95D /* Debug */ = { 431 | isa = XCBuildConfiguration; 432 | buildSettings = { 433 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 434 | INFOPLIST_FILE = XSPullRefreshDemo/Info.plist; 435 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 436 | PRODUCT_BUNDLE_IDENTIFIER = com.Season.XSPullRefreshDemo; 437 | PRODUCT_NAME = "$(TARGET_NAME)"; 438 | }; 439 | name = Debug; 440 | }; 441 | B13E5ED11C1321F000FCB95D /* Release */ = { 442 | isa = XCBuildConfiguration; 443 | buildSettings = { 444 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 445 | INFOPLIST_FILE = XSPullRefreshDemo/Info.plist; 446 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 447 | PRODUCT_BUNDLE_IDENTIFIER = com.Season.XSPullRefreshDemo; 448 | PRODUCT_NAME = "$(TARGET_NAME)"; 449 | }; 450 | name = Release; 451 | }; 452 | B13E5ED31C1321F000FCB95D /* Debug */ = { 453 | isa = XCBuildConfiguration; 454 | buildSettings = { 455 | BUNDLE_LOADER = "$(TEST_HOST)"; 456 | INFOPLIST_FILE = XSPullRefreshDemoTests/Info.plist; 457 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 458 | PRODUCT_BUNDLE_IDENTIFIER = com.Season.XSPullRefreshDemoTests; 459 | PRODUCT_NAME = "$(TARGET_NAME)"; 460 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/XSPullRefreshDemo.app/XSPullRefreshDemo"; 461 | }; 462 | name = Debug; 463 | }; 464 | B13E5ED41C1321F000FCB95D /* Release */ = { 465 | isa = XCBuildConfiguration; 466 | buildSettings = { 467 | BUNDLE_LOADER = "$(TEST_HOST)"; 468 | INFOPLIST_FILE = XSPullRefreshDemoTests/Info.plist; 469 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 470 | PRODUCT_BUNDLE_IDENTIFIER = com.Season.XSPullRefreshDemoTests; 471 | PRODUCT_NAME = "$(TARGET_NAME)"; 472 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/XSPullRefreshDemo.app/XSPullRefreshDemo"; 473 | }; 474 | name = Release; 475 | }; 476 | B13E5ED61C1321F000FCB95D /* Debug */ = { 477 | isa = XCBuildConfiguration; 478 | buildSettings = { 479 | INFOPLIST_FILE = XSPullRefreshDemoUITests/Info.plist; 480 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 481 | PRODUCT_BUNDLE_IDENTIFIER = com.Season.XSPullRefreshDemoUITests; 482 | PRODUCT_NAME = "$(TARGET_NAME)"; 483 | TEST_TARGET_NAME = XSPullRefreshDemo; 484 | USES_XCTRUNNER = YES; 485 | }; 486 | name = Debug; 487 | }; 488 | B13E5ED71C1321F000FCB95D /* Release */ = { 489 | isa = XCBuildConfiguration; 490 | buildSettings = { 491 | INFOPLIST_FILE = XSPullRefreshDemoUITests/Info.plist; 492 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 493 | PRODUCT_BUNDLE_IDENTIFIER = com.Season.XSPullRefreshDemoUITests; 494 | PRODUCT_NAME = "$(TARGET_NAME)"; 495 | TEST_TARGET_NAME = XSPullRefreshDemo; 496 | USES_XCTRUNNER = YES; 497 | }; 498 | name = Release; 499 | }; 500 | /* End XCBuildConfiguration section */ 501 | 502 | /* Begin XCConfigurationList section */ 503 | B13E5E9D1C1321F000FCB95D /* Build configuration list for PBXProject "XSPullRefreshDemo" */ = { 504 | isa = XCConfigurationList; 505 | buildConfigurations = ( 506 | B13E5ECD1C1321F000FCB95D /* Debug */, 507 | B13E5ECE1C1321F000FCB95D /* Release */, 508 | ); 509 | defaultConfigurationIsVisible = 0; 510 | defaultConfigurationName = Release; 511 | }; 512 | B13E5ECF1C1321F000FCB95D /* Build configuration list for PBXNativeTarget "XSPullRefreshDemo" */ = { 513 | isa = XCConfigurationList; 514 | buildConfigurations = ( 515 | B13E5ED01C1321F000FCB95D /* Debug */, 516 | B13E5ED11C1321F000FCB95D /* Release */, 517 | ); 518 | defaultConfigurationIsVisible = 0; 519 | }; 520 | B13E5ED21C1321F000FCB95D /* Build configuration list for PBXNativeTarget "XSPullRefreshDemoTests" */ = { 521 | isa = XCConfigurationList; 522 | buildConfigurations = ( 523 | B13E5ED31C1321F000FCB95D /* Debug */, 524 | B13E5ED41C1321F000FCB95D /* Release */, 525 | ); 526 | defaultConfigurationIsVisible = 0; 527 | }; 528 | B13E5ED51C1321F000FCB95D /* Build configuration list for PBXNativeTarget "XSPullRefreshDemoUITests" */ = { 529 | isa = XCConfigurationList; 530 | buildConfigurations = ( 531 | B13E5ED61C1321F000FCB95D /* Debug */, 532 | B13E5ED71C1321F000FCB95D /* Release */, 533 | ); 534 | defaultConfigurationIsVisible = 0; 535 | }; 536 | /* End XCConfigurationList section */ 537 | }; 538 | rootObject = B13E5E9A1C1321F000FCB95D /* Project object */; 539 | } 540 | --------------------------------------------------------------------------------