├── Demo ├── SJLoadingViewProject │ ├── ex.gif │ ├── ex1.gif │ ├── ex2.gif │ ├── ViewController.h │ ├── AppDelegate.h │ ├── main.m │ ├── ViewController.m │ ├── Info.plist │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ └── AppDelegate.m ├── SJLoadingViewProject.xcodeproj │ ├── xcuserdata │ │ ├── changsanjiang.xcuserdatad │ │ │ ├── xcdebugger │ │ │ │ └── Breakpoints_v2.xcbkptlist │ │ │ └── xcschemes │ │ │ │ └── xcschememanagement.plist │ │ └── bluedancer.xcuserdatad │ │ │ └── xcschemes │ │ │ └── xcschememanagement.plist │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcuserdata │ │ │ └── bluedancer.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── project.pbxproj ├── SJLoadingViewProjectTests │ ├── Info.plist │ └── SJLoadingViewProjectTests.m └── SJLoadingViewProjectUITests │ ├── Info.plist │ └── SJLoadingViewProjectUITests.m ├── README.md ├── SJLoadingView ├── SJLoadingView.h └── SJLoadingView.m ├── LICENSE.md └── SJLoadingView.podspec /Demo/SJLoadingViewProject/ex.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/changsanjiang/SJLoadingView/HEAD/Demo/SJLoadingViewProject/ex.gif -------------------------------------------------------------------------------- /Demo/SJLoadingViewProject/ex1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/changsanjiang/SJLoadingView/HEAD/Demo/SJLoadingViewProject/ex1.gif -------------------------------------------------------------------------------- /Demo/SJLoadingViewProject/ex2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/changsanjiang/SJLoadingView/HEAD/Demo/SJLoadingViewProject/ex2.gif -------------------------------------------------------------------------------- /Demo/SJLoadingViewProject.xcodeproj/xcuserdata/changsanjiang.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /Demo/SJLoadingViewProject.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Demo/SJLoadingViewProject.xcodeproj/project.xcworkspace/xcuserdata/bluedancer.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/changsanjiang/SJLoadingView/HEAD/Demo/SJLoadingViewProject.xcodeproj/project.xcworkspace/xcuserdata/bluedancer.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Demo/SJLoadingViewProject/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // SJLoadingViewProject 4 | // 5 | // Created by 畅三江 on 2017/12/24. 6 | // Copyright © 2017年 畅三江. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /Demo/SJLoadingViewProject/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // SJLoadingViewProject 4 | // 5 | // Created by 畅三江 on 2017/12/24. 6 | // Copyright © 2017年 畅三江. 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 | -------------------------------------------------------------------------------- /Demo/SJLoadingViewProject/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // SJLoadingViewProject 4 | // 5 | // Created by 畅三江 on 2017/12/24. 6 | // Copyright © 2017年 畅三江. 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 | -------------------------------------------------------------------------------- /Demo/SJLoadingViewProject.xcodeproj/xcuserdata/bluedancer.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | SJLoadingViewProject.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Demo/SJLoadingViewProject.xcodeproj/xcuserdata/changsanjiang.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | SJLoadingViewProject.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SJLoadingView 2 | 3 | ### Use 4 | 5 | ```ruby 6 | pod 'SJLoadingView' 7 | ``` 8 | 9 | ### Sample 10 | ```Objective-C 11 | _loadingView = [SJLoadingView new]; 12 | _loadingView.lineColor = [UIColor whiteColor]; 13 | _loadingView.bounds = CGRectMake(0, 0, 50, 50); 14 | _loadingView.center = self.view.center; 15 | _loadingView.speed = 1; 16 | [self.view addSubview:_loadingView]; 17 | ``` 18 | 19 | ### AnimType 20 | Keep: 21 | 22 | 23 | FadeOut: 24 | 25 | 26 | -------------------------------------------------------------------------------- /Demo/SJLoadingViewProjectTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 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 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Demo/SJLoadingViewProjectUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 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 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /SJLoadingView/SJLoadingView.h: -------------------------------------------------------------------------------- 1 | // 2 | // SJLoadingView.h 3 | // SJLoadingViewProject 4 | // 5 | // Created by 畅三江 on 2017/12/24. 6 | // Copyright © 2017年 畅三江. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | typedef NS_ENUM(NSUInteger, SJLoadingType) { 14 | SJLoadingType_Keep, 15 | SJLoadingType_FadeOut, 16 | }; 17 | 18 | @interface SJLoadingView : UIView 19 | 20 | /// default is SJLoadingType_Keep. 21 | @property (nonatomic, assign) SJLoadingType animType; 22 | 23 | /// default is whiteColor. 24 | @property (nonatomic, strong, null_resettable) UIColor *lineColor; 25 | 26 | /// default is 1. 27 | @property (nonatomic, assign) double speed; 28 | 29 | /// anima state 30 | @property (nonatomic, assign, readonly, getter=isAnimating) BOOL animating; 31 | 32 | /// begin anim 33 | - (void)start; 34 | 35 | /// stop anim 36 | - (void)stop; 37 | 38 | @end 39 | 40 | NS_ASSUME_NONNULL_END 41 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 changsanjiang 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 | -------------------------------------------------------------------------------- /Demo/SJLoadingViewProjectTests/SJLoadingViewProjectTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // SJLoadingViewProjectTests.m 3 | // SJLoadingViewProjectTests 4 | // 5 | // Created by 畅三江 on 2017/12/24. 6 | // Copyright © 2017年 畅三江. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SJLoadingViewProjectTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation SJLoadingViewProjectTests 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 | -------------------------------------------------------------------------------- /Demo/SJLoadingViewProjectUITests/SJLoadingViewProjectUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // SJLoadingViewProjectUITests.m 3 | // SJLoadingViewProjectUITests 4 | // 5 | // Created by 畅三江 on 2017/12/24. 6 | // Copyright © 2017年 畅三江. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SJLoadingViewProjectUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation SJLoadingViewProjectUITests 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 | -------------------------------------------------------------------------------- /Demo/SJLoadingViewProject/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // SJLoadingViewProject 4 | // 5 | // Created by 畅三江 on 2017/12/24. 6 | // Copyright © 2017年 畅三江. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "SJLoadingView.h" 11 | 12 | @interface ViewController () 13 | 14 | @property (nonatomic, strong) SJLoadingView *loadingView; 15 | 16 | @end 17 | 18 | @implementation ViewController 19 | 20 | - (void)viewDidLoad { 21 | [super viewDidLoad]; 22 | 23 | self.view.backgroundColor = [UIColor blackColor]; 24 | 25 | _loadingView = [SJLoadingView new]; 26 | _loadingView.lineColor = [UIColor whiteColor]; 27 | _loadingView.bounds = CGRectMake(0, 0, 50, 50); 28 | _loadingView.center = self.view.center; 29 | _loadingView.speed = 1; 30 | [self.view addSubview:_loadingView]; 31 | 32 | // Do any additional setup after loading the view, typically from a nib. 33 | } 34 | 35 | - (IBAction)start:(id)sender { 36 | [_loadingView start]; 37 | } 38 | 39 | - (IBAction)stop:(id)sender { 40 | [_loadingView stop]; 41 | } 42 | - (IBAction)keep:(id)sender { 43 | [_loadingView stop]; 44 | _loadingView.animType = SJLoadingType_Keep; 45 | [_loadingView start]; 46 | } 47 | - (IBAction)fadeOut:(id)sender { 48 | [_loadingView stop]; 49 | _loadingView.animType = SJLoadingType_FadeOut; 50 | [_loadingView start]; 51 | } 52 | 53 | - (void)didReceiveMemoryWarning { 54 | [super didReceiveMemoryWarning]; 55 | // Dispose of any resources that can be recreated. 56 | } 57 | 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /Demo/SJLoadingViewProject/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 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 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /Demo/SJLoadingViewProject/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 | -------------------------------------------------------------------------------- /Demo/SJLoadingViewProject/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | } 88 | ], 89 | "info" : { 90 | "version" : 1, 91 | "author" : "xcode" 92 | } 93 | } -------------------------------------------------------------------------------- /Demo/SJLoadingViewProject/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // SJLoadingViewProject 4 | // 5 | // Created by 畅三江 on 2017/12/24. 6 | // Copyright © 2017年 畅三江. 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 | 24 | - (void)applicationWillResignActive:(UIApplication *)application { 25 | // 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. 26 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 27 | } 28 | 29 | 30 | - (void)applicationDidEnterBackground:(UIApplication *)application { 31 | // 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. 32 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 33 | } 34 | 35 | 36 | - (void)applicationWillEnterForeground:(UIApplication *)application { 37 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 38 | } 39 | 40 | 41 | - (void)applicationDidBecomeActive:(UIApplication *)application { 42 | // 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. 43 | } 44 | 45 | 46 | - (void)applicationWillTerminate:(UIApplication *)application { 47 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 48 | } 49 | 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /SJLoadingView/SJLoadingView.m: -------------------------------------------------------------------------------- 1 | // 2 | // SJLoadingView.m 3 | // SJLoadingViewProject 4 | // 5 | // Created by 畅三江 on 2017/12/24. 6 | // Copyright © 2017年 畅三江. All rights reserved. 7 | // 8 | 9 | #import "SJLoadingView.h" 10 | 11 | @interface SJLoadingView () 12 | 13 | @property (nonatomic, strong, readonly) CAGradientLayer *gradientLayer; 14 | @property (nonatomic, strong, readonly) CAShapeLayer *shapeLayer; 15 | @property (nonatomic, assign) CGFloat lineWidth; 16 | @property (nonatomic, assign, getter=isAnimating) BOOL animating; 17 | @property (nonatomic, assign) BOOL strokeShow; 18 | 19 | @end 20 | 21 | @implementation SJLoadingView 22 | 23 | @synthesize lineColor = _lineColor; 24 | @synthesize gradientLayer = _gradientLayer; 25 | @synthesize shapeLayer = _shapeLayer; 26 | 27 | - (instancetype)initWithFrame:(CGRect)frame { 28 | self = [super initWithFrame:frame]; 29 | if ( !self ) return nil; 30 | [self.layer addSublayer:self.gradientLayer]; 31 | self.gradientLayer.mask = self.shapeLayer; 32 | self.alpha = 0.001; 33 | self.speed = 1; 34 | self.lineWidth = 2; 35 | self.lineColor = [UIColor whiteColor]; 36 | return self; 37 | } 38 | 39 | - (CGSize)intrinsicContentSize { 40 | return CGSizeMake(38, 38); 41 | } 42 | 43 | - (void)setLineWidth:(CGFloat)lineWidth { 44 | _lineWidth = lineWidth; 45 | _shapeLayer.lineWidth = _lineWidth; 46 | } 47 | 48 | - (void)setLineColor:(UIColor *)lineColor { 49 | if ( !lineColor ) return; 50 | _lineColor = lineColor; 51 | _gradientLayer.colors = @[ 52 | (id)[UIColor colorWithWhite:0.001 alpha:0.001].CGColor, 53 | (id)[lineColor colorWithAlphaComponent:0.25].CGColor, 54 | (id)lineColor.CGColor]; 55 | } 56 | 57 | - (UIColor *)lineColor { 58 | if ( _lineColor ) return _lineColor; 59 | return [UIColor whiteColor]; 60 | } 61 | 62 | - (void)start { 63 | if ( _animating ) return; 64 | _animating = YES; 65 | if ( _animType == SJLoadingType_FadeOut ) [self _strokeAnim_Show]; 66 | self.alpha = 1; 67 | CABasicAnimation *rotationAnim = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"]; 68 | rotationAnim.toValue = [NSNumber numberWithFloat:2 * M_PI]; 69 | rotationAnim.duration = _speed; 70 | rotationAnim.repeatCount = CGFLOAT_MAX; 71 | [_gradientLayer addAnimation:rotationAnim forKey:@"rotation"]; 72 | } 73 | 74 | - (void)_strokeAnim_Show { 75 | _strokeShow = YES; 76 | CAKeyframeAnimation *strokeAnim = [CAKeyframeAnimation animationWithKeyPath:@"strokeEnd"]; 77 | strokeAnim.values = @[@(_shapeLayer.strokeStart), @(_shapeLayer.strokeEnd)]; 78 | strokeAnim.duration = _speed * 1.5; 79 | strokeAnim.delegate = self; 80 | strokeAnim.removedOnCompletion = NO; 81 | strokeAnim.fillMode = kCAFillModeForwards; 82 | [_shapeLayer addAnimation:strokeAnim forKey:@"strokeAnim"]; 83 | } 84 | 85 | - (void)_strokeAnim_Dismiss { 86 | _strokeShow = NO; 87 | CAKeyframeAnimation *strokeAnim = [CAKeyframeAnimation animationWithKeyPath:@"strokeEnd"]; 88 | strokeAnim.values = @[@(_shapeLayer.strokeEnd), @(_shapeLayer.strokeStart)]; 89 | strokeAnim.duration = _speed * 1.5; 90 | strokeAnim.delegate = self; 91 | strokeAnim.removedOnCompletion = NO; 92 | strokeAnim.fillMode = kCAFillModeForwards; 93 | [_shapeLayer addAnimation:strokeAnim forKey:@"strokeAnim"]; 94 | } 95 | 96 | - (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag { 97 | if ( !_animating ) return; 98 | if ( _strokeShow ) [self _strokeAnim_Dismiss]; 99 | else [self _strokeAnim_Show]; 100 | } 101 | 102 | - (void)stop { 103 | if ( !_animating ) return; 104 | _animating = NO; 105 | self.alpha = 0.001; 106 | [_shapeLayer removeAllAnimations]; 107 | [_gradientLayer removeAllAnimations]; 108 | } 109 | 110 | - (void)layoutSubviews { 111 | [super layoutSubviews]; 112 | CGFloat width = MIN(self.bounds.size.width, self.bounds.size.height); 113 | CGFloat height = width; 114 | self.gradientLayer.bounds = CGRectMake(0, 0, width, height); 115 | self.gradientLayer.position = CGPointMake(self.bounds.size.width * 0.5, self.bounds.size.height * 0.5); 116 | self.shapeLayer.position = CGPointMake(_lineWidth, _lineWidth); 117 | self.shapeLayer.path = [UIBezierPath bezierPathWithArcCenter:CGPointMake(width * 0.5 - _lineWidth, height * 0.5 - _lineWidth) radius:(width - _lineWidth) * 0.5 startAngle:0 endAngle:M_PI * 2 clockwise:YES].CGPath; 118 | } 119 | 120 | - (CAGradientLayer *)gradientLayer { 121 | if ( _gradientLayer ) return _gradientLayer; 122 | _gradientLayer = [CAGradientLayer layer]; 123 | _gradientLayer.startPoint = CGPointMake(1, 1); 124 | _gradientLayer.endPoint = CGPointMake(0, 0); 125 | _gradientLayer.locations = @[@(0), @(0.3), @(0.5), @(1)]; 126 | return _gradientLayer; 127 | } 128 | 129 | - (CAShapeLayer *)shapeLayer { 130 | if ( _shapeLayer ) return _shapeLayer; 131 | _shapeLayer = [CAShapeLayer layer]; 132 | _shapeLayer.strokeColor = [UIColor blueColor].CGColor; 133 | _shapeLayer.fillColor = [UIColor clearColor].CGColor; 134 | _shapeLayer.strokeStart = 0.15; 135 | _shapeLayer.strokeEnd = 0.8; 136 | _shapeLayer.lineCap = @"round"; 137 | return _shapeLayer; 138 | } 139 | 140 | @end 141 | -------------------------------------------------------------------------------- /SJLoadingView.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # Be sure to run `pod spec lint SJLoadingView.podspec' to ensure this is a 3 | # valid spec and to remove all comments including this before submitting the spec. 4 | # 5 | # To learn more about Podspec attributes see http://docs.cocoapods.org/specification.html 6 | # To see working Podspecs in the CocoaPods repo see https://github.com/CocoaPods/Specs/ 7 | # 8 | 9 | Pod::Spec.new do |s| 10 | 11 | # ――― Spec Metadata ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 12 | # 13 | # These will help people to find your library, and whilst it 14 | # can feel like a chore to fill in it's definitely to your advantage. The 15 | # summary should be tweet-length, and the description more in depth. 16 | # 17 | 18 | s.name = "SJLoadingView" 19 | s.version = "1.0.1" 20 | s.summary = "Loading View." 21 | 22 | # This description is used to generate tags and improve search results. 23 | # * Think: What does it do? Why did you write it? What is the focus? 24 | # * Try to keep it short, snappy and to the point. 25 | # * Write the description between the DESC delimiters below. 26 | # * Finally, don't worry about the indent, CocoaPods strips it! 27 | s.description = <<-DESC 28 | Load animation view. 29 | DESC 30 | 31 | s.homepage = "https://github.com/changsanjiang/SJLoadingView" 32 | # s.screenshots = "www.example.com/screenshots_1.gif", "www.example.com/screenshots_2.gif" 33 | 34 | 35 | # ――― Spec License ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 36 | # 37 | # Licensing your code is important. See http://choosealicense.com for more info. 38 | # CocoaPods will detect a license file if there is a named LICENSE* 39 | # Popular ones are 'MIT', 'BSD' and 'Apache License, Version 2.0'. 40 | # 41 | 42 | s.license = { :type => "MIT", :file => "LICENSE.md" } 43 | 44 | 45 | # ――― Author Metadata ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 46 | # 47 | # Specify the authors of the library, with email addresses. Email addresses 48 | # of the authors are extracted from the SCM log. E.g. $ git log. CocoaPods also 49 | # accepts just a name if you'd rather not provide an email address. 50 | # 51 | # Specify a social_media_url where others can refer to, for example a twitter 52 | # profile URL. 53 | # 54 | 55 | s.author = { "changsanjiang" => "changsanjiang@gmail.com" } 56 | # Or just: s.author = "changsanjiang" 57 | # s.authors = { "changsanjiang" => "changsanjiang@gmail.com" } 58 | # s.social_media_url = "http://twitter.com/changsanjiang" 59 | 60 | # ――― Platform Specifics ――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 61 | # 62 | # If this Pod runs only on iOS or OS X, then specify the platform and 63 | # the deployment target. You can optionally include the target after the platform. 64 | # 65 | 66 | # s.platform = :ios 67 | s.platform = :ios, "8.0" 68 | 69 | # When using multiple platforms 70 | # s.ios.deployment_target = "5.0" 71 | # s.osx.deployment_target = "10.7" 72 | # s.watchos.deployment_target = "2.0" 73 | # s.tvos.deployment_target = "9.0" 74 | 75 | 76 | # ――― Source Location ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 77 | # 78 | # Specify the location from where the source should be retrieved. 79 | # Supports git, hg, bzr, svn and HTTP. 80 | # 81 | 82 | s.source = { :git => "https://github.com/changsanjiang/SJLoadingView.git", :tag => "v#{s.version}" } 83 | 84 | 85 | # ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 86 | # 87 | # CocoaPods is smart about how it includes source code. For source files 88 | # giving a folder will include any swift, h, m, mm, c & cpp files. 89 | # For header files it will include any header in the folder. 90 | # Not including the public_header_files will make all headers public. 91 | # 92 | 93 | s.source_files = "SJLoadingView/*.{h,m}" 94 | #s.exclude_files = "Classes/Exclude" 95 | 96 | # s.public_header_files = "Classes/**/*.h" 97 | 98 | 99 | # ――― Resources ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 100 | # 101 | # A list of resources included with the Pod. These are copied into the 102 | # target bundle with a build phase script. Anything else will be cleaned. 103 | # You can preserve files from being cleaned, please don't preserve 104 | # non-essential files like tests, examples and documentation. 105 | # 106 | 107 | # s.resource = "icon.png" 108 | # s.resources = "Resources/*.png" 109 | 110 | # s.preserve_paths = "FilesToSave", "MoreFilesToSave" 111 | 112 | 113 | # ――― Project Linking ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 114 | # 115 | # Link your library with frameworks, or libraries. Libraries do not include 116 | # the lib prefix of their name. 117 | # 118 | 119 | s.framework = "UIKit" 120 | # s.frameworks = "SomeFramework", "AnotherFramework" 121 | 122 | # s.library = "iconv" 123 | # s.libraries = "iconv", "xml2" 124 | 125 | 126 | # ――― Project Settings ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 127 | # 128 | # If your library depends on compiler flags you can set them in the xcconfig hash 129 | # where they will only apply to your library. If you depend on other Podspecs 130 | # you can include multiple dependencies to ensure it works. 131 | 132 | s.requires_arc = true 133 | 134 | # s.xcconfig = { "HEADER_SEARCH_PATHS" => "$(SDKROOT)/usr/include/libxml2" } 135 | # s.dependency "JSONKit", "~> 1.4" 136 | 137 | end 138 | -------------------------------------------------------------------------------- /Demo/SJLoadingViewProject/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 | 29 | 36 | 43 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /Demo/SJLoadingViewProject.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 48; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 7754FF391FF4F87D00D5B167 /* ex2.gif in Resources */ = {isa = PBXBuildFile; fileRef = 7754FF381FF4F87D00D5B167 /* ex2.gif */; }; 11 | 775936641FF4992F009C47A4 /* ex.gif in Resources */ = {isa = PBXBuildFile; fileRef = 775936631FF4992F009C47A4 /* ex.gif */; }; 12 | A650A9CF1FEFBB8B00BE2D8C /* SJLoadingView.m in Sources */ = {isa = PBXBuildFile; fileRef = A650A9CE1FEFBB8B00BE2D8C /* SJLoadingView.m */; }; 13 | A650A9D21FEFBCB900BE2D8C /* SJLoadingView.podspec in Resources */ = {isa = PBXBuildFile; fileRef = A650A9D01FEFBCB900BE2D8C /* SJLoadingView.podspec */; }; 14 | A650A9D31FEFBCB900BE2D8C /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = A650A9D11FEFBCB900BE2D8C /* README.md */; }; 15 | A6F478821FEF78AB00C0293E /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = A6F478811FEF78AB00C0293E /* AppDelegate.m */; }; 16 | A6F478851FEF78AB00C0293E /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A6F478841FEF78AB00C0293E /* ViewController.m */; }; 17 | A6F478881FEF78AB00C0293E /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A6F478861FEF78AB00C0293E /* Main.storyboard */; }; 18 | A6F4788A1FEF78AB00C0293E /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A6F478891FEF78AB00C0293E /* Assets.xcassets */; }; 19 | A6F4788D1FEF78AB00C0293E /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A6F4788B1FEF78AB00C0293E /* LaunchScreen.storyboard */; }; 20 | A6F478901FEF78AB00C0293E /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = A6F4788F1FEF78AB00C0293E /* main.m */; }; 21 | A6F4789A1FEF78AB00C0293E /* SJLoadingViewProjectTests.m in Sources */ = {isa = PBXBuildFile; fileRef = A6F478991FEF78AB00C0293E /* SJLoadingViewProjectTests.m */; }; 22 | A6F478A51FEF78AB00C0293E /* SJLoadingViewProjectUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = A6F478A41FEF78AB00C0293E /* SJLoadingViewProjectUITests.m */; }; 23 | /* End PBXBuildFile section */ 24 | 25 | /* Begin PBXContainerItemProxy section */ 26 | A6F478961FEF78AB00C0293E /* PBXContainerItemProxy */ = { 27 | isa = PBXContainerItemProxy; 28 | containerPortal = A6F478751FEF78AB00C0293E /* Project object */; 29 | proxyType = 1; 30 | remoteGlobalIDString = A6F4787C1FEF78AB00C0293E; 31 | remoteInfo = SJLoadingViewProject; 32 | }; 33 | A6F478A11FEF78AB00C0293E /* PBXContainerItemProxy */ = { 34 | isa = PBXContainerItemProxy; 35 | containerPortal = A6F478751FEF78AB00C0293E /* Project object */; 36 | proxyType = 1; 37 | remoteGlobalIDString = A6F4787C1FEF78AB00C0293E; 38 | remoteInfo = SJLoadingViewProject; 39 | }; 40 | /* End PBXContainerItemProxy section */ 41 | 42 | /* Begin PBXFileReference section */ 43 | 7754FF381FF4F87D00D5B167 /* ex2.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = ex2.gif; sourceTree = ""; }; 44 | 775936631FF4992F009C47A4 /* ex.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = ex.gif; sourceTree = ""; }; 45 | A650A9CD1FEFBB8B00BE2D8C /* SJLoadingView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SJLoadingView.h; sourceTree = ""; }; 46 | A650A9CE1FEFBB8B00BE2D8C /* SJLoadingView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SJLoadingView.m; sourceTree = ""; }; 47 | A650A9D01FEFBCB900BE2D8C /* SJLoadingView.podspec */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = SJLoadingView.podspec; path = ../SJLoadingView.podspec; sourceTree = ""; }; 48 | A650A9D11FEFBCB900BE2D8C /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; 49 | A6F4787D1FEF78AB00C0293E /* SJLoadingViewProject.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SJLoadingViewProject.app; sourceTree = BUILT_PRODUCTS_DIR; }; 50 | A6F478801FEF78AB00C0293E /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 51 | A6F478811FEF78AB00C0293E /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 52 | A6F478831FEF78AB00C0293E /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 53 | A6F478841FEF78AB00C0293E /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 54 | A6F478871FEF78AB00C0293E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 55 | A6F478891FEF78AB00C0293E /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 56 | A6F4788C1FEF78AB00C0293E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 57 | A6F4788E1FEF78AB00C0293E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 58 | A6F4788F1FEF78AB00C0293E /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 59 | A6F478951FEF78AB00C0293E /* SJLoadingViewProjectTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SJLoadingViewProjectTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 60 | A6F478991FEF78AB00C0293E /* SJLoadingViewProjectTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SJLoadingViewProjectTests.m; sourceTree = ""; }; 61 | A6F4789B1FEF78AB00C0293E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 62 | A6F478A01FEF78AB00C0293E /* SJLoadingViewProjectUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SJLoadingViewProjectUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 63 | A6F478A41FEF78AB00C0293E /* SJLoadingViewProjectUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SJLoadingViewProjectUITests.m; sourceTree = ""; }; 64 | A6F478A61FEF78AB00C0293E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 65 | /* End PBXFileReference section */ 66 | 67 | /* Begin PBXFrameworksBuildPhase section */ 68 | A6F4787A1FEF78AB00C0293E /* Frameworks */ = { 69 | isa = PBXFrameworksBuildPhase; 70 | buildActionMask = 2147483647; 71 | files = ( 72 | ); 73 | runOnlyForDeploymentPostprocessing = 0; 74 | }; 75 | A6F478921FEF78AB00C0293E /* Frameworks */ = { 76 | isa = PBXFrameworksBuildPhase; 77 | buildActionMask = 2147483647; 78 | files = ( 79 | ); 80 | runOnlyForDeploymentPostprocessing = 0; 81 | }; 82 | A6F4789D1FEF78AB00C0293E /* Frameworks */ = { 83 | isa = PBXFrameworksBuildPhase; 84 | buildActionMask = 2147483647; 85 | files = ( 86 | ); 87 | runOnlyForDeploymentPostprocessing = 0; 88 | }; 89 | /* End PBXFrameworksBuildPhase section */ 90 | 91 | /* Begin PBXGroup section */ 92 | A650A9CC1FEFBB8B00BE2D8C /* SJLoadingView */ = { 93 | isa = PBXGroup; 94 | children = ( 95 | A650A9CD1FEFBB8B00BE2D8C /* SJLoadingView.h */, 96 | A650A9CE1FEFBB8B00BE2D8C /* SJLoadingView.m */, 97 | ); 98 | name = SJLoadingView; 99 | path = ../../SJLoadingView; 100 | sourceTree = ""; 101 | }; 102 | A650A9D71FEFBDB400BE2D8C /* Asset */ = { 103 | isa = PBXGroup; 104 | children = ( 105 | A6F478861FEF78AB00C0293E /* Main.storyboard */, 106 | 775936631FF4992F009C47A4 /* ex.gif */, 107 | 7754FF381FF4F87D00D5B167 /* ex2.gif */, 108 | A6F478891FEF78AB00C0293E /* Assets.xcassets */, 109 | A6F4788B1FEF78AB00C0293E /* LaunchScreen.storyboard */, 110 | A6F4788E1FEF78AB00C0293E /* Info.plist */, 111 | A6F4788F1FEF78AB00C0293E /* main.m */, 112 | ); 113 | name = Asset; 114 | sourceTree = ""; 115 | }; 116 | A6F478741FEF78AB00C0293E = { 117 | isa = PBXGroup; 118 | children = ( 119 | A650A9D11FEFBCB900BE2D8C /* README.md */, 120 | A650A9D01FEFBCB900BE2D8C /* SJLoadingView.podspec */, 121 | A6F4787F1FEF78AB00C0293E /* SJLoadingViewProject */, 122 | A6F478981FEF78AB00C0293E /* SJLoadingViewProjectTests */, 123 | A6F478A31FEF78AB00C0293E /* SJLoadingViewProjectUITests */, 124 | A6F4787E1FEF78AB00C0293E /* Products */, 125 | ); 126 | sourceTree = ""; 127 | }; 128 | A6F4787E1FEF78AB00C0293E /* Products */ = { 129 | isa = PBXGroup; 130 | children = ( 131 | A6F4787D1FEF78AB00C0293E /* SJLoadingViewProject.app */, 132 | A6F478951FEF78AB00C0293E /* SJLoadingViewProjectTests.xctest */, 133 | A6F478A01FEF78AB00C0293E /* SJLoadingViewProjectUITests.xctest */, 134 | ); 135 | name = Products; 136 | sourceTree = ""; 137 | }; 138 | A6F4787F1FEF78AB00C0293E /* SJLoadingViewProject */ = { 139 | isa = PBXGroup; 140 | children = ( 141 | A6F478801FEF78AB00C0293E /* AppDelegate.h */, 142 | A6F478811FEF78AB00C0293E /* AppDelegate.m */, 143 | A6F478831FEF78AB00C0293E /* ViewController.h */, 144 | A6F478841FEF78AB00C0293E /* ViewController.m */, 145 | A650A9CC1FEFBB8B00BE2D8C /* SJLoadingView */, 146 | A650A9D71FEFBDB400BE2D8C /* Asset */, 147 | ); 148 | path = SJLoadingViewProject; 149 | sourceTree = ""; 150 | }; 151 | A6F478981FEF78AB00C0293E /* SJLoadingViewProjectTests */ = { 152 | isa = PBXGroup; 153 | children = ( 154 | A6F478991FEF78AB00C0293E /* SJLoadingViewProjectTests.m */, 155 | A6F4789B1FEF78AB00C0293E /* Info.plist */, 156 | ); 157 | path = SJLoadingViewProjectTests; 158 | sourceTree = ""; 159 | }; 160 | A6F478A31FEF78AB00C0293E /* SJLoadingViewProjectUITests */ = { 161 | isa = PBXGroup; 162 | children = ( 163 | A6F478A41FEF78AB00C0293E /* SJLoadingViewProjectUITests.m */, 164 | A6F478A61FEF78AB00C0293E /* Info.plist */, 165 | ); 166 | path = SJLoadingViewProjectUITests; 167 | sourceTree = ""; 168 | }; 169 | /* End PBXGroup section */ 170 | 171 | /* Begin PBXNativeTarget section */ 172 | A6F4787C1FEF78AB00C0293E /* SJLoadingViewProject */ = { 173 | isa = PBXNativeTarget; 174 | buildConfigurationList = A6F478A91FEF78AB00C0293E /* Build configuration list for PBXNativeTarget "SJLoadingViewProject" */; 175 | buildPhases = ( 176 | A6F478791FEF78AB00C0293E /* Sources */, 177 | A6F4787A1FEF78AB00C0293E /* Frameworks */, 178 | A6F4787B1FEF78AB00C0293E /* Resources */, 179 | ); 180 | buildRules = ( 181 | ); 182 | dependencies = ( 183 | ); 184 | name = SJLoadingViewProject; 185 | productName = SJLoadingViewProject; 186 | productReference = A6F4787D1FEF78AB00C0293E /* SJLoadingViewProject.app */; 187 | productType = "com.apple.product-type.application"; 188 | }; 189 | A6F478941FEF78AB00C0293E /* SJLoadingViewProjectTests */ = { 190 | isa = PBXNativeTarget; 191 | buildConfigurationList = A6F478AC1FEF78AB00C0293E /* Build configuration list for PBXNativeTarget "SJLoadingViewProjectTests" */; 192 | buildPhases = ( 193 | A6F478911FEF78AB00C0293E /* Sources */, 194 | A6F478921FEF78AB00C0293E /* Frameworks */, 195 | A6F478931FEF78AB00C0293E /* Resources */, 196 | ); 197 | buildRules = ( 198 | ); 199 | dependencies = ( 200 | A6F478971FEF78AB00C0293E /* PBXTargetDependency */, 201 | ); 202 | name = SJLoadingViewProjectTests; 203 | productName = SJLoadingViewProjectTests; 204 | productReference = A6F478951FEF78AB00C0293E /* SJLoadingViewProjectTests.xctest */; 205 | productType = "com.apple.product-type.bundle.unit-test"; 206 | }; 207 | A6F4789F1FEF78AB00C0293E /* SJLoadingViewProjectUITests */ = { 208 | isa = PBXNativeTarget; 209 | buildConfigurationList = A6F478AF1FEF78AB00C0293E /* Build configuration list for PBXNativeTarget "SJLoadingViewProjectUITests" */; 210 | buildPhases = ( 211 | A6F4789C1FEF78AB00C0293E /* Sources */, 212 | A6F4789D1FEF78AB00C0293E /* Frameworks */, 213 | A6F4789E1FEF78AB00C0293E /* Resources */, 214 | ); 215 | buildRules = ( 216 | ); 217 | dependencies = ( 218 | A6F478A21FEF78AB00C0293E /* PBXTargetDependency */, 219 | ); 220 | name = SJLoadingViewProjectUITests; 221 | productName = SJLoadingViewProjectUITests; 222 | productReference = A6F478A01FEF78AB00C0293E /* SJLoadingViewProjectUITests.xctest */; 223 | productType = "com.apple.product-type.bundle.ui-testing"; 224 | }; 225 | /* End PBXNativeTarget section */ 226 | 227 | /* Begin PBXProject section */ 228 | A6F478751FEF78AB00C0293E /* Project object */ = { 229 | isa = PBXProject; 230 | attributes = { 231 | LastUpgradeCheck = 0920; 232 | ORGANIZATIONNAME = "畅三江"; 233 | TargetAttributes = { 234 | A6F4787C1FEF78AB00C0293E = { 235 | CreatedOnToolsVersion = 9.2; 236 | ProvisioningStyle = Manual; 237 | }; 238 | A6F478941FEF78AB00C0293E = { 239 | CreatedOnToolsVersion = 9.2; 240 | ProvisioningStyle = Automatic; 241 | TestTargetID = A6F4787C1FEF78AB00C0293E; 242 | }; 243 | A6F4789F1FEF78AB00C0293E = { 244 | CreatedOnToolsVersion = 9.2; 245 | ProvisioningStyle = Automatic; 246 | TestTargetID = A6F4787C1FEF78AB00C0293E; 247 | }; 248 | }; 249 | }; 250 | buildConfigurationList = A6F478781FEF78AB00C0293E /* Build configuration list for PBXProject "SJLoadingViewProject" */; 251 | compatibilityVersion = "Xcode 8.0"; 252 | developmentRegion = en; 253 | hasScannedForEncodings = 0; 254 | knownRegions = ( 255 | en, 256 | Base, 257 | ); 258 | mainGroup = A6F478741FEF78AB00C0293E; 259 | productRefGroup = A6F4787E1FEF78AB00C0293E /* Products */; 260 | projectDirPath = ""; 261 | projectRoot = ""; 262 | targets = ( 263 | A6F4787C1FEF78AB00C0293E /* SJLoadingViewProject */, 264 | A6F478941FEF78AB00C0293E /* SJLoadingViewProjectTests */, 265 | A6F4789F1FEF78AB00C0293E /* SJLoadingViewProjectUITests */, 266 | ); 267 | }; 268 | /* End PBXProject section */ 269 | 270 | /* Begin PBXResourcesBuildPhase section */ 271 | A6F4787B1FEF78AB00C0293E /* Resources */ = { 272 | isa = PBXResourcesBuildPhase; 273 | buildActionMask = 2147483647; 274 | files = ( 275 | 7754FF391FF4F87D00D5B167 /* ex2.gif in Resources */, 276 | A6F4788D1FEF78AB00C0293E /* LaunchScreen.storyboard in Resources */, 277 | A6F4788A1FEF78AB00C0293E /* Assets.xcassets in Resources */, 278 | A650A9D31FEFBCB900BE2D8C /* README.md in Resources */, 279 | A6F478881FEF78AB00C0293E /* Main.storyboard in Resources */, 280 | A650A9D21FEFBCB900BE2D8C /* SJLoadingView.podspec in Resources */, 281 | 775936641FF4992F009C47A4 /* ex.gif in Resources */, 282 | ); 283 | runOnlyForDeploymentPostprocessing = 0; 284 | }; 285 | A6F478931FEF78AB00C0293E /* Resources */ = { 286 | isa = PBXResourcesBuildPhase; 287 | buildActionMask = 2147483647; 288 | files = ( 289 | ); 290 | runOnlyForDeploymentPostprocessing = 0; 291 | }; 292 | A6F4789E1FEF78AB00C0293E /* Resources */ = { 293 | isa = PBXResourcesBuildPhase; 294 | buildActionMask = 2147483647; 295 | files = ( 296 | ); 297 | runOnlyForDeploymentPostprocessing = 0; 298 | }; 299 | /* End PBXResourcesBuildPhase section */ 300 | 301 | /* Begin PBXSourcesBuildPhase section */ 302 | A6F478791FEF78AB00C0293E /* Sources */ = { 303 | isa = PBXSourcesBuildPhase; 304 | buildActionMask = 2147483647; 305 | files = ( 306 | A650A9CF1FEFBB8B00BE2D8C /* SJLoadingView.m in Sources */, 307 | A6F478851FEF78AB00C0293E /* ViewController.m in Sources */, 308 | A6F478901FEF78AB00C0293E /* main.m in Sources */, 309 | A6F478821FEF78AB00C0293E /* AppDelegate.m in Sources */, 310 | ); 311 | runOnlyForDeploymentPostprocessing = 0; 312 | }; 313 | A6F478911FEF78AB00C0293E /* Sources */ = { 314 | isa = PBXSourcesBuildPhase; 315 | buildActionMask = 2147483647; 316 | files = ( 317 | A6F4789A1FEF78AB00C0293E /* SJLoadingViewProjectTests.m in Sources */, 318 | ); 319 | runOnlyForDeploymentPostprocessing = 0; 320 | }; 321 | A6F4789C1FEF78AB00C0293E /* Sources */ = { 322 | isa = PBXSourcesBuildPhase; 323 | buildActionMask = 2147483647; 324 | files = ( 325 | A6F478A51FEF78AB00C0293E /* SJLoadingViewProjectUITests.m in Sources */, 326 | ); 327 | runOnlyForDeploymentPostprocessing = 0; 328 | }; 329 | /* End PBXSourcesBuildPhase section */ 330 | 331 | /* Begin PBXTargetDependency section */ 332 | A6F478971FEF78AB00C0293E /* PBXTargetDependency */ = { 333 | isa = PBXTargetDependency; 334 | target = A6F4787C1FEF78AB00C0293E /* SJLoadingViewProject */; 335 | targetProxy = A6F478961FEF78AB00C0293E /* PBXContainerItemProxy */; 336 | }; 337 | A6F478A21FEF78AB00C0293E /* PBXTargetDependency */ = { 338 | isa = PBXTargetDependency; 339 | target = A6F4787C1FEF78AB00C0293E /* SJLoadingViewProject */; 340 | targetProxy = A6F478A11FEF78AB00C0293E /* PBXContainerItemProxy */; 341 | }; 342 | /* End PBXTargetDependency section */ 343 | 344 | /* Begin PBXVariantGroup section */ 345 | A6F478861FEF78AB00C0293E /* Main.storyboard */ = { 346 | isa = PBXVariantGroup; 347 | children = ( 348 | A6F478871FEF78AB00C0293E /* Base */, 349 | ); 350 | name = Main.storyboard; 351 | sourceTree = ""; 352 | }; 353 | A6F4788B1FEF78AB00C0293E /* LaunchScreen.storyboard */ = { 354 | isa = PBXVariantGroup; 355 | children = ( 356 | A6F4788C1FEF78AB00C0293E /* Base */, 357 | ); 358 | name = LaunchScreen.storyboard; 359 | sourceTree = ""; 360 | }; 361 | /* End PBXVariantGroup section */ 362 | 363 | /* Begin XCBuildConfiguration section */ 364 | A6F478A71FEF78AB00C0293E /* Debug */ = { 365 | isa = XCBuildConfiguration; 366 | buildSettings = { 367 | ALWAYS_SEARCH_USER_PATHS = NO; 368 | CLANG_ANALYZER_NONNULL = YES; 369 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 370 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 371 | CLANG_CXX_LIBRARY = "libc++"; 372 | CLANG_ENABLE_MODULES = YES; 373 | CLANG_ENABLE_OBJC_ARC = YES; 374 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 375 | CLANG_WARN_BOOL_CONVERSION = YES; 376 | CLANG_WARN_COMMA = YES; 377 | CLANG_WARN_CONSTANT_CONVERSION = YES; 378 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 379 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 380 | CLANG_WARN_EMPTY_BODY = YES; 381 | CLANG_WARN_ENUM_CONVERSION = YES; 382 | CLANG_WARN_INFINITE_RECURSION = YES; 383 | CLANG_WARN_INT_CONVERSION = YES; 384 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 385 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 386 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 387 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 388 | CLANG_WARN_STRICT_PROTOTYPES = YES; 389 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 390 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 391 | CLANG_WARN_UNREACHABLE_CODE = YES; 392 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 393 | CODE_SIGN_IDENTITY = "iPhone Developer"; 394 | COPY_PHASE_STRIP = NO; 395 | DEBUG_INFORMATION_FORMAT = dwarf; 396 | ENABLE_STRICT_OBJC_MSGSEND = YES; 397 | ENABLE_TESTABILITY = YES; 398 | GCC_C_LANGUAGE_STANDARD = gnu11; 399 | GCC_DYNAMIC_NO_PIC = NO; 400 | GCC_NO_COMMON_BLOCKS = YES; 401 | GCC_OPTIMIZATION_LEVEL = 0; 402 | GCC_PREPROCESSOR_DEFINITIONS = ( 403 | "DEBUG=1", 404 | "$(inherited)", 405 | ); 406 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 407 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 408 | GCC_WARN_UNDECLARED_SELECTOR = YES; 409 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 410 | GCC_WARN_UNUSED_FUNCTION = YES; 411 | GCC_WARN_UNUSED_VARIABLE = YES; 412 | IPHONEOS_DEPLOYMENT_TARGET = 11.2; 413 | MTL_ENABLE_DEBUG_INFO = YES; 414 | ONLY_ACTIVE_ARCH = YES; 415 | SDKROOT = iphoneos; 416 | }; 417 | name = Debug; 418 | }; 419 | A6F478A81FEF78AB00C0293E /* Release */ = { 420 | isa = XCBuildConfiguration; 421 | buildSettings = { 422 | ALWAYS_SEARCH_USER_PATHS = NO; 423 | CLANG_ANALYZER_NONNULL = YES; 424 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 425 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 426 | CLANG_CXX_LIBRARY = "libc++"; 427 | CLANG_ENABLE_MODULES = YES; 428 | CLANG_ENABLE_OBJC_ARC = YES; 429 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 430 | CLANG_WARN_BOOL_CONVERSION = YES; 431 | CLANG_WARN_COMMA = YES; 432 | CLANG_WARN_CONSTANT_CONVERSION = YES; 433 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 434 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 435 | CLANG_WARN_EMPTY_BODY = YES; 436 | CLANG_WARN_ENUM_CONVERSION = YES; 437 | CLANG_WARN_INFINITE_RECURSION = YES; 438 | CLANG_WARN_INT_CONVERSION = YES; 439 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 440 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 441 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 442 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 443 | CLANG_WARN_STRICT_PROTOTYPES = YES; 444 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 445 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 446 | CLANG_WARN_UNREACHABLE_CODE = YES; 447 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 448 | CODE_SIGN_IDENTITY = "iPhone Developer"; 449 | COPY_PHASE_STRIP = NO; 450 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 451 | ENABLE_NS_ASSERTIONS = NO; 452 | ENABLE_STRICT_OBJC_MSGSEND = YES; 453 | GCC_C_LANGUAGE_STANDARD = gnu11; 454 | GCC_NO_COMMON_BLOCKS = YES; 455 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 456 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 457 | GCC_WARN_UNDECLARED_SELECTOR = YES; 458 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 459 | GCC_WARN_UNUSED_FUNCTION = YES; 460 | GCC_WARN_UNUSED_VARIABLE = YES; 461 | IPHONEOS_DEPLOYMENT_TARGET = 11.2; 462 | MTL_ENABLE_DEBUG_INFO = NO; 463 | SDKROOT = iphoneos; 464 | VALIDATE_PRODUCT = YES; 465 | }; 466 | name = Release; 467 | }; 468 | A6F478AA1FEF78AB00C0293E /* Debug */ = { 469 | isa = XCBuildConfiguration; 470 | buildSettings = { 471 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 472 | CODE_SIGN_STYLE = Manual; 473 | DEVELOPMENT_TEAM = DB5B5F2RH5; 474 | INFOPLIST_FILE = SJLoadingViewProject/Info.plist; 475 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 476 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 477 | PRODUCT_BUNDLE_IDENTIFIER = com.SanJiang.SJLoadingViewProject; 478 | PRODUCT_NAME = "$(TARGET_NAME)"; 479 | PROVISIONING_PROFILE = "acd2453e-e396-4ccf-bf56-508276824c6c"; 480 | PROVISIONING_PROFILE_SPECIFIER = SanJiangDevelopment; 481 | TARGETED_DEVICE_FAMILY = "1,2"; 482 | }; 483 | name = Debug; 484 | }; 485 | A6F478AB1FEF78AB00C0293E /* Release */ = { 486 | isa = XCBuildConfiguration; 487 | buildSettings = { 488 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 489 | CODE_SIGN_STYLE = Manual; 490 | DEVELOPMENT_TEAM = ""; 491 | INFOPLIST_FILE = SJLoadingViewProject/Info.plist; 492 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 493 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 494 | PRODUCT_BUNDLE_IDENTIFIER = com.SanJiang.SJLoadingViewProject; 495 | PRODUCT_NAME = "$(TARGET_NAME)"; 496 | PROVISIONING_PROFILE_SPECIFIER = ""; 497 | TARGETED_DEVICE_FAMILY = "1,2"; 498 | }; 499 | name = Release; 500 | }; 501 | A6F478AD1FEF78AB00C0293E /* Debug */ = { 502 | isa = XCBuildConfiguration; 503 | buildSettings = { 504 | BUNDLE_LOADER = "$(TEST_HOST)"; 505 | CODE_SIGN_STYLE = Automatic; 506 | INFOPLIST_FILE = SJLoadingViewProjectTests/Info.plist; 507 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 508 | PRODUCT_BUNDLE_IDENTIFIER = com.SanJiang.SJLoadingViewProjectTests; 509 | PRODUCT_NAME = "$(TARGET_NAME)"; 510 | TARGETED_DEVICE_FAMILY = "1,2"; 511 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SJLoadingViewProject.app/SJLoadingViewProject"; 512 | }; 513 | name = Debug; 514 | }; 515 | A6F478AE1FEF78AB00C0293E /* Release */ = { 516 | isa = XCBuildConfiguration; 517 | buildSettings = { 518 | BUNDLE_LOADER = "$(TEST_HOST)"; 519 | CODE_SIGN_STYLE = Automatic; 520 | INFOPLIST_FILE = SJLoadingViewProjectTests/Info.plist; 521 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 522 | PRODUCT_BUNDLE_IDENTIFIER = com.SanJiang.SJLoadingViewProjectTests; 523 | PRODUCT_NAME = "$(TARGET_NAME)"; 524 | TARGETED_DEVICE_FAMILY = "1,2"; 525 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SJLoadingViewProject.app/SJLoadingViewProject"; 526 | }; 527 | name = Release; 528 | }; 529 | A6F478B01FEF78AB00C0293E /* Debug */ = { 530 | isa = XCBuildConfiguration; 531 | buildSettings = { 532 | CODE_SIGN_STYLE = Automatic; 533 | INFOPLIST_FILE = SJLoadingViewProjectUITests/Info.plist; 534 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 535 | PRODUCT_BUNDLE_IDENTIFIER = com.SanJiang.SJLoadingViewProjectUITests; 536 | PRODUCT_NAME = "$(TARGET_NAME)"; 537 | TARGETED_DEVICE_FAMILY = "1,2"; 538 | TEST_TARGET_NAME = SJLoadingViewProject; 539 | }; 540 | name = Debug; 541 | }; 542 | A6F478B11FEF78AB00C0293E /* Release */ = { 543 | isa = XCBuildConfiguration; 544 | buildSettings = { 545 | CODE_SIGN_STYLE = Automatic; 546 | INFOPLIST_FILE = SJLoadingViewProjectUITests/Info.plist; 547 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 548 | PRODUCT_BUNDLE_IDENTIFIER = com.SanJiang.SJLoadingViewProjectUITests; 549 | PRODUCT_NAME = "$(TARGET_NAME)"; 550 | TARGETED_DEVICE_FAMILY = "1,2"; 551 | TEST_TARGET_NAME = SJLoadingViewProject; 552 | }; 553 | name = Release; 554 | }; 555 | /* End XCBuildConfiguration section */ 556 | 557 | /* Begin XCConfigurationList section */ 558 | A6F478781FEF78AB00C0293E /* Build configuration list for PBXProject "SJLoadingViewProject" */ = { 559 | isa = XCConfigurationList; 560 | buildConfigurations = ( 561 | A6F478A71FEF78AB00C0293E /* Debug */, 562 | A6F478A81FEF78AB00C0293E /* Release */, 563 | ); 564 | defaultConfigurationIsVisible = 0; 565 | defaultConfigurationName = Release; 566 | }; 567 | A6F478A91FEF78AB00C0293E /* Build configuration list for PBXNativeTarget "SJLoadingViewProject" */ = { 568 | isa = XCConfigurationList; 569 | buildConfigurations = ( 570 | A6F478AA1FEF78AB00C0293E /* Debug */, 571 | A6F478AB1FEF78AB00C0293E /* Release */, 572 | ); 573 | defaultConfigurationIsVisible = 0; 574 | defaultConfigurationName = Release; 575 | }; 576 | A6F478AC1FEF78AB00C0293E /* Build configuration list for PBXNativeTarget "SJLoadingViewProjectTests" */ = { 577 | isa = XCConfigurationList; 578 | buildConfigurations = ( 579 | A6F478AD1FEF78AB00C0293E /* Debug */, 580 | A6F478AE1FEF78AB00C0293E /* Release */, 581 | ); 582 | defaultConfigurationIsVisible = 0; 583 | defaultConfigurationName = Release; 584 | }; 585 | A6F478AF1FEF78AB00C0293E /* Build configuration list for PBXNativeTarget "SJLoadingViewProjectUITests" */ = { 586 | isa = XCConfigurationList; 587 | buildConfigurations = ( 588 | A6F478B01FEF78AB00C0293E /* Debug */, 589 | A6F478B11FEF78AB00C0293E /* Release */, 590 | ); 591 | defaultConfigurationIsVisible = 0; 592 | defaultConfigurationName = Release; 593 | }; 594 | /* End XCConfigurationList section */ 595 | }; 596 | rootObject = A6F478751FEF78AB00C0293E /* Project object */; 597 | } 598 | --------------------------------------------------------------------------------