├── SetProgress.gif ├── OtherProperties.gif ├── WaveAnimDuration.gif ├── SetProgressAnimation.gif ├── WaveAnimation.xcodeproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── project.pbxproj ├── WaveAnimation ├── TestAViewController.h ├── TestViewContorller.h ├── ViewController.h ├── AppDelegate.h ├── main.m ├── LKAWaveCircleProgressBar │ ├── WaveLayer.h │ ├── LKAWaveCircleProgressBar.h │ ├── WaveLayer.m │ └── LKAWaveCircleProgressBar.m ├── TestAViewController.m ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Info.plist ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── AppDelegate.m ├── TestViewContorller.m └── ViewController.m ├── LICENSE ├── .gitignore ├── README.md ├── README_EN.md └── LKAWaveCircleProgressBar.podspec /SetProgress.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukapool/LKAWaveCircleProgressBar/HEAD/SetProgress.gif -------------------------------------------------------------------------------- /OtherProperties.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukapool/LKAWaveCircleProgressBar/HEAD/OtherProperties.gif -------------------------------------------------------------------------------- /WaveAnimDuration.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukapool/LKAWaveCircleProgressBar/HEAD/WaveAnimDuration.gif -------------------------------------------------------------------------------- /SetProgressAnimation.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukapool/LKAWaveCircleProgressBar/HEAD/SetProgressAnimation.gif -------------------------------------------------------------------------------- /WaveAnimation.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /WaveAnimation/TestAViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // TestAViewController.h 3 | // WaveAnimation 4 | // 5 | // Created by Luka on 2018/5/12. 6 | // Copyright © 2018 Luka. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface TestAViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /WaveAnimation/TestViewContorller.h: -------------------------------------------------------------------------------- 1 | // 2 | // TestViewContorller.h 3 | // WaveAnimation 4 | // 5 | // Created by Luka on 2017/8/23. 6 | // Copyright © 2017年 Luka. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface TestViewContorller : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /WaveAnimation/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // WaveAnimation 4 | // 5 | // Created by Luka on 2017/8/23. 6 | // Copyright © 2017年 Luka. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /WaveAnimation.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /WaveAnimation/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // WaveAnimation 4 | // 5 | // Created by Luka on 2017/8/23. 6 | // Copyright © 2017年 Luka. 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 | -------------------------------------------------------------------------------- /WaveAnimation/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // WaveAnimation 4 | // 5 | // Created by Luka on 2017/8/23. 6 | // Copyright © 2017年 Luka. 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 | -------------------------------------------------------------------------------- /WaveAnimation/LKAWaveCircleProgressBar/WaveLayer.h: -------------------------------------------------------------------------------- 1 | // 2 | // WaveLayer.h 3 | // WaveAnimation 4 | // 5 | // Created by Luka on 2017/8/23. 6 | // Copyright © 2017年 Luka. All rights reserved. 7 | // 8 | #import 9 | 10 | @interface WaveLayer : CALayer 11 | @property (nonatomic, assign) CGFloat U; 12 | @property (nonatomic, assign) CGFloat C; 13 | 14 | 15 | @property (nonatomic, assign) CGFloat A; 16 | @property (nonatomic, assign) CGFloat W; 17 | @property (nonatomic, assign) CGFloat offsetU; 18 | @property (nonatomic, strong) UIColor *color; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /WaveAnimation/LKAWaveCircleProgressBar/LKAWaveCircleProgressBar.h: -------------------------------------------------------------------------------- 1 | // 2 | // LKAWaveCircleProgressBar.h 3 | // WaveAnimation 4 | // 5 | // Created by Luka on 2017/8/23. 6 | // Copyright © 2017年 Luka. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef void (^Completion)(void); 12 | 13 | @interface LKAWaveCircleProgressBar : UIView 14 | 15 | @property (nonatomic, assign) NSTimeInterval waveRollingDuration; 16 | @property (nonatomic, assign) NSTimeInterval progressAnimationDuration; 17 | @property (nonatomic, assign) CGFloat progress; 18 | @property(nonatomic, strong) UIColor *progressTintColor; 19 | @property (nonatomic, strong) UIColor *borderColor; 20 | @property (nonatomic, assign) CGFloat borderWidth; 21 | @property (nonatomic, copy) Completion completion; 22 | 23 | - (void)setProgress:(float)progress animated:(BOOL)animated; 24 | - (void)stopWaveRollingAnimation; 25 | - (void)startWaveRollingAnimation; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Luka 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 | -------------------------------------------------------------------------------- /WaveAnimation/TestAViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // TestAViewController.m 3 | // WaveAnimation 4 | // 5 | // Created by Luka on 2018/5/12. 6 | // Copyright © 2018 Luka. All rights reserved. 7 | // 8 | 9 | #import "TestAViewController.h" 10 | #import "LKAWaveCircleProgressBar.h" 11 | 12 | @interface TestAViewController () 13 | 14 | @end 15 | 16 | @implementation TestAViewController 17 | 18 | - (void)viewDidLoad { 19 | [super viewDidLoad]; 20 | // Do any additional setup after loading the view. 21 | LKAWaveCircleProgressBar * wcView = [[LKAWaveCircleProgressBar alloc] initWithFrame:CGRectMake(62.5,125.5,248.5,248.5)]; 22 | [wcView setProgress:0.8 animated:YES]; 23 | wcView.progressAnimationDuration = 0.7; 24 | [self.view addSubview:wcView]; 25 | [wcView startWaveRollingAnimation]; 26 | } 27 | 28 | - (void)didReceiveMemoryWarning { 29 | [super didReceiveMemoryWarning]; 30 | // Dispose of any resources that can be recreated. 31 | } 32 | 33 | /* 34 | #pragma mark - Navigation 35 | 36 | // In a storyboard-based application, you will often want to do a little preparation before navigation 37 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 38 | // Get the new view controller using [segue destinationViewController]. 39 | // Pass the selected object to the new view controller. 40 | } 41 | */ 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /WaveAnimation/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 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /WaveAnimation/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 | 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 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xccheckout 23 | *.xcscmblueprint 24 | 25 | ## Obj-C/Swift specific 26 | *.hmap 27 | *.ipa 28 | *.dSYM.zip 29 | *.dSYM 30 | 31 | # CocoaPods 32 | # 33 | # We recommend against adding the Pods directory to your .gitignore. However 34 | # you should judge for yourself, the pros and cons are mentioned at: 35 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 36 | # 37 | # Pods/ 38 | 39 | # Carthage 40 | # 41 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 42 | # Carthage/Checkouts 43 | 44 | Carthage/Build 45 | 46 | # fastlane 47 | # 48 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 49 | # screenshots whenever they are needed. 50 | # For more information about the recommended setup visit: 51 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 52 | 53 | fastlane/report.xml 54 | fastlane/Preview.html 55 | fastlane/screenshots 56 | fastlane/test_output 57 | 58 | # Code Injection 59 | # 60 | # After new code Injection tools there's a generated folder /iOSInjectionProject 61 | # https://github.com/johnno1962/injectionforxcode 62 | 63 | iOSInjectionProject/ 64 | -------------------------------------------------------------------------------- /WaveAnimation/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 | -------------------------------------------------------------------------------- /WaveAnimation/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // WaveAnimation 4 | // 5 | // Created by Luka on 2017/8/23. 6 | // Copyright © 2017年 Luka. 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 | -------------------------------------------------------------------------------- /WaveAnimation/TestViewContorller.m: -------------------------------------------------------------------------------- 1 | // 2 | // TestViewContorller.m 3 | // WaveAnimation 4 | // 5 | // Created by Luka on 2017/8/23. 6 | // Copyright © 2017年 Luka. All rights reserved. 7 | // 8 | 9 | #import "TestViewContorller.h" 10 | #import "LKAWaveCircleProgressBar.h" 11 | 12 | @interface TestViewContorller () 13 | @property (weak, nonatomic) IBOutlet LKAWaveCircleProgressBar *wcView; 14 | @property (weak, nonatomic) IBOutlet UISegmentedControl *timeSegment; 15 | @property (weak, nonatomic) IBOutlet UISlider *progressView; 16 | @property (weak, nonatomic) IBOutlet UISegmentedControl *waveAnimationDurationSegment; 17 | 18 | @end 19 | 20 | @implementation TestViewContorller 21 | 22 | - (void)viewDidLoad { 23 | [super viewDidLoad]; 24 | // Do any additional setup after loading the view. 25 | self.wcView.progressAnimationDuration = 0.7; 26 | 27 | self.waveAnimationDurationSegment.selectedSegmentIndex = 1; 28 | self.timeSegment.selectedSegmentIndex = 2; 29 | 30 | self.wcView.completion = ^{ 31 | self.progressView.value = self.wcView.progress; 32 | }; 33 | 34 | [self.wcView startWaveRollingAnimation]; 35 | } 36 | 37 | - (IBAction)waveAnimDuration:(UISegmentedControl *)sender { 38 | self.wcView.waveRollingDuration = 0.5 * (sender.selectedSegmentIndex + 1); 39 | } 40 | 41 | - (IBAction)progressValueChanged:(UISlider *)sender { 42 | [self.wcView setProgress:sender.value]; 43 | } 44 | 45 | - (IBAction)timeSegmentChanged:(UISegmentedControl *)sender { 46 | // NSLog(@"%ld", (long)sender.selectedSegmentIndex); 47 | [self.wcView setProgress:0.25 * sender.selectedSegmentIndex animated:YES]; 48 | } 49 | 50 | - (IBAction)changeTinColor:(UIButton *)sender { 51 | self.wcView.progressTintColor = [UIColor colorWithRed:arc4random() % 255 / 255.0 green:arc4random() % 255 / 255.0 blue:arc4random() % 255 / 255.0 alpha:0.7]; 52 | // [self.wcView stopWaveRollingAnimation]; 53 | } 54 | 55 | - (IBAction)changeBorderColor:(UIButton *)sender { 56 | self.wcView.borderColor = [UIColor colorWithRed:arc4random() % 255 / 255.0 green:arc4random() % 255 / 255.0 blue:arc4random() % 255 / 255.0 alpha:0.7]; 57 | // [self.wcView startWaveRollingAnimation]; 58 | } 59 | 60 | - (IBAction)changeBorderWidth:(UIButton *)sender { 61 | self.wcView.borderWidth = arc4random() % 5; 62 | } 63 | 64 | 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![License MIT](https://img.shields.io/badge/License-MIT-green.svg?style=flat-square) 2 | ![CocoaPods](https://img.shields.io/badge/Pod-v0.2.2-blue.svg?style=flat-square) 3 | ![Language](https://img.shields.io/badge/Language-Objective--C-lightgrey.svg?style=flat-square) 4 | ![Platform](https://img.shields.io/badge/Platform-iOS-yellow.svg?style=flat-square) 5 | 6 | [ENGLISH](README_EN.md) 7 | #### `LKAWaveCircleProgressBar` 是一款带有双波浪动画的圆形进度指示器视图,可自定义圆形容器的`边框颜色`、`边框线宽`,双波浪的`颜色`,`动画时间`,进度改变`时间`。 8 | 9 | ## 截图 10 | |设置进度|动画设置进度|设置波浪动画时间| 11 | |:---:|:---:|:---:| 12 | |![image](SetProgress.gif)|![image](SetProgressAnimation.gif)|![image](WaveAnimDuration.gif)| 13 | |设置其他属性| 14 | |![image](OtherProperties.gif)| 15 | ## 安装 16 | #### CocoaPods 17 | 1、在 Podfile 文件中添加 18 | ``` 19 | pod 'LKAWaveCircleProgressBar' 20 | ``` 21 | 2、执行 22 | ``` 23 | pod install 24 | ``` 25 | 3、在你需要使用的地方导入头文件 26 | ``` 27 | #import "LKAWaveCircleProgressBar.h" 28 | ``` 29 | #### 手动安装 30 | 1、下载最新代码 31 | 32 | 2、将`WaveAnimation/LKAWaveCircleProgressBar`文件夹拖动到 Xcode 工程项目中。确保选中 `Copy items if needed`。 33 | 34 | 3、导入头文件使用 35 | ``` 36 | #import 37 | ``` 38 | ## 使用方法 39 | #### 初始化,可以使用 Autolayout 或者设置指定 frame 来定义视图的大小位置。⚠️`确保视图的高和宽一样` 40 | ``` 41 | LKAWaveCircleProgressBar *wcView = [[LKAWaveCircleProgressBar alloc] initWithFrame:CGRectMake(0, 0, 150, 150)]; 42 | ``` 43 | #### 设置指示器 progress, 取值范围为 [0, 1] 44 | ``` 45 | // 无动画效果设置方法 46 | self.wcView.progress = value; 47 | // 或者 48 | [self.wcView setProgress:value]; 49 | // 或者 50 | [self.wcView setProgress:value animated:NO]; 51 | 52 | // 有动画效果设置方法 53 | [self.wcView setProgress:value animated:YES]; 54 | ``` 55 | #### 视图属性定制化,详细使用方法可以查看 [WaveAnimation/TestViewContorller.m](WaveAnimation/TestViewContorller.m) 56 | ``` 57 | // 双波浪滚动动画时间,默认值:1秒 58 | @property (nonatomic, assign) NSTimeInterval waveRollingDuration; 59 | // 进度改变动画时间,默认值:1秒 60 | @property (nonatomic, assign) NSTimeInterval progressAnimationDuration; 61 | // 波浪颜色,默认值:[UIColor colorWithRed:1.0 green:0.0 blue:0.0 alpha:0.5] 62 | @property(nonatomic, strong) UIColor *progressTintColor; 63 | // 指示器圆形容器边框颜色,默认值:[UIColor colorWithRed:1.0 green:0.0 blue:0.0 alpha:0.9] 64 | @property (nonatomic, strong) UIColor *borderColor; 65 | // 指示器圆形容器边框线宽,默认值:2.0 66 | @property (nonatomic, assign) CGFloat borderWidth; 67 | // 进度改变动画完成后回调 Block,默认值为空,主线程执行 block。 68 | @property (nonatomic, copy) Completion completion; 69 | // 停止波浪滚动效果 70 | - (void)stopWaveRollingAnimation; 71 | // 开始波浪滚动效果 72 | - (void)startWaveRollingAnimation; 73 | ``` 74 | 75 | ## License 76 | LKAWaveCircleProgressBar is released under the [MIT license](LICENSE). See LICENSE for details. 77 | 78 | -------------------------------------------------------------------------------- /WaveAnimation/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // WaveAnimation 4 | // 5 | // Created by Luka on 2017/8/23. 6 | // Copyright © 2017年 Luka. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "WaveLayer.h" 11 | 12 | @interface ViewController () 13 | @property (nonatomic, strong) WaveLayer *sinWavelayer; 14 | @property (nonatomic, strong) WaveLayer *cosWavelayer; 15 | @end 16 | 17 | @implementation ViewController 18 | 19 | - (void)viewDidLoad { 20 | [super viewDidLoad]; 21 | // Do any additional setup after loading the view, typically from a nib. 22 | WaveLayer *sinLayer = [WaveLayer layer]; 23 | sinLayer.W = 2 * M_PI / 320 * 0.5; 24 | sinLayer.A = -25; 25 | sinLayer.C = 0.5; 26 | sinLayer.color = [UIColor colorWithRed:0 green:0 blue:1.0 alpha:0.4]; 27 | [self.view.layer addSublayer:sinLayer]; 28 | self.sinWavelayer = sinLayer; 29 | 30 | WaveLayer *cosLayer = [WaveLayer layer]; 31 | cosLayer.offsetU = M_PI_2 * 0.9; 32 | cosLayer.W = 2 * M_PI / 320 * 0.6; 33 | cosLayer.A = -25; 34 | cosLayer.C = 0.5; 35 | [self.view.layer addSublayer:cosLayer]; 36 | self.cosWavelayer = cosLayer; 37 | 38 | 39 | UIBezierPath *mask = [UIBezierPath bezierPathWithOvalInRect:self.view.bounds]; 40 | CAShapeLayer *maskLayer = [CAShapeLayer layer]; 41 | maskLayer.path = mask.CGPath; 42 | // self.view.layer.mask = maskLayer; 43 | } 44 | 45 | - (void)viewWillLayoutSubviews { 46 | [super viewWillLayoutSubviews]; 47 | 48 | self.sinWavelayer.frame = self.view.bounds; 49 | self.cosWavelayer.frame = self.view.bounds; 50 | 51 | } 52 | 53 | - (void)viewWillAppear:(BOOL)animated { 54 | [super viewWillAppear:animated]; 55 | 56 | CABasicAnimation *waveAnimation = [CABasicAnimation animationWithKeyPath:@"U"]; 57 | waveAnimation.fromValue = @0; 58 | waveAnimation.toValue = @(M_PI * 2); 59 | waveAnimation.duration = 1; 60 | waveAnimation.repeatCount = HUGE_VALF; 61 | [self.sinWavelayer addAnimation:waveAnimation forKey:nil]; 62 | waveAnimation.duration = 2; 63 | [self.cosWavelayer addAnimation:waveAnimation forKey:nil]; 64 | 65 | CABasicAnimation *percentAnimation = [CABasicAnimation animationWithKeyPath:@"C"]; 66 | percentAnimation.fromValue = @0; 67 | percentAnimation.toValue = @0.5; 68 | percentAnimation.duration = 10; 69 | percentAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; 70 | [self.sinWavelayer addAnimation:percentAnimation forKey:nil]; 71 | [self.cosWavelayer addAnimation:percentAnimation forKey:nil]; 72 | 73 | } 74 | 75 | - (void)didReceiveMemoryWarning { 76 | [super didReceiveMemoryWarning]; 77 | // Dispose of any resources that can be recreated. 78 | } 79 | 80 | 81 | @end 82 | -------------------------------------------------------------------------------- /WaveAnimation/LKAWaveCircleProgressBar/WaveLayer.m: -------------------------------------------------------------------------------- 1 | // 2 | // WaveLayer.m 3 | // WaveAnimation 4 | // 5 | // Created by Luka on 2017/8/23. 6 | // Copyright © 2017年 Luka. All rights reserved. 7 | // 8 | 9 | #import "WaveLayer.h" 10 | 11 | 12 | @interface WaveLayer () 13 | @end 14 | 15 | @implementation WaveLayer 16 | // 可以进行 Core Animation 的属性需要 dynamic,UIKit 自动生成 access method 17 | @dynamic U; 18 | @dynamic C; 19 | 20 | // 用来生成 presentation layer 21 | - (instancetype)initWithLayer:(id)layer { 22 | self = [super initWithLayer:layer]; 23 | if (self) { 24 | if ([layer isKindOfClass:[WaveLayer class]]) { 25 | WaveLayer *waveLayer = (WaveLayer *)layer; 26 | self.A = waveLayer.A; 27 | self.W = waveLayer.W; 28 | self.C = waveLayer.C; 29 | self.U = waveLayer.U; 30 | self.offsetU = waveLayer.offsetU; 31 | self.color = waveLayer.color; 32 | } 33 | } 34 | return self; 35 | } 36 | 37 | - (instancetype)init { 38 | self = [super init]; 39 | if (self) { 40 | self.contentsScale = [UIScreen mainScreen].scale; 41 | _A = 1.0; 42 | _W = 2 * M_PI / 320 * 0.8; 43 | self.C = 0; 44 | self.U = 0; 45 | _offsetU = 0; 46 | _color = [UIColor colorWithRed:1.0 green:0.0 blue:0.0 alpha:0.5]; 47 | } 48 | return self; 49 | } 50 | 51 | - (void)setFrame:(CGRect)frame { 52 | [super setFrame:frame]; 53 | [self setNeedsDisplay]; 54 | } 55 | // 定义哪个属性为可动画 56 | + (BOOL)needsDisplayForKey:(NSString *)key { 57 | if ([key isEqualToString:@"U"] || [key isEqualToString:@"C"]) { 58 | return YES; 59 | } 60 | return [super needsDisplayForKey:key]; 61 | } 62 | 63 | // 绘图 64 | - (void)drawInContext:(CGContextRef)ctx { 65 | CGMutablePathRef clipPath = CGPathCreateMutable(); 66 | CGPathAddEllipseInRect(clipPath, NULL, self.bounds); 67 | CGContextAddPath(ctx, clipPath); 68 | CGContextClip(ctx); 69 | CGPathRelease(clipPath); 70 | 71 | CGContextSetLineWidth(ctx, 2.0); 72 | CGContextSetFillColorWithColor(ctx, self.color.CGColor); 73 | 74 | CGMutablePathRef sinPath = CGPathCreateMutable(); 75 | CGFloat width = CGRectGetWidth(self.bounds); 76 | CGFloat height = CGRectGetHeight(self.bounds); 77 | 78 | CGFloat offsetY = (1 - self.C) * height; 79 | CGPathMoveToPoint(sinPath, NULL, 0.0f, height); 80 | CGPathAddLineToPoint(sinPath, NULL, 0.0f, offsetY); 81 | 82 | 83 | for (int x = 0; x <= width; x++) { 84 | CGFloat y = _A * sinf( _W * x + self.U + _offsetU) + offsetY; 85 | CGPathAddLineToPoint(sinPath, NULL, x, y); 86 | } 87 | 88 | CGPathAddLineToPoint(sinPath, NULL, width, height); 89 | CGPathCloseSubpath(sinPath); 90 | CGContextBeginPath(ctx); 91 | CGContextAddPath(ctx, sinPath); 92 | CGContextFillPath(ctx); 93 | 94 | CGPathRelease(sinPath); 95 | } 96 | 97 | @end 98 | -------------------------------------------------------------------------------- /README_EN.md: -------------------------------------------------------------------------------- 1 | ![License MIT](https://img.shields.io/badge/License-MIT-green.svg?style=flat-square) 2 | ![CocoaPods](https://img.shields.io/badge/Pod-v0.2.2-blue.svg?style=flat-square) 3 | ![Language](https://img.shields.io/badge/Language-Objective--C-lightgrey.svg?style=flat-square) 4 | ![Platform](https://img.shields.io/badge/Platform-iOS-yellow.svg?style=flat-square) 5 | 6 | #### `LKAWaveCircleProgressBar` is a circular progress indicator with wave rolling animation, you can customize the `border color`, `border line width`, wave `color`, wave rolling `animation duration`, progress change `animation duration`. 7 | 8 | ## Screenshots 9 | |Set the progress|Set the progress with animation|Set wave rolling animation’s duration| 10 | |:---:|:---:|:---:| 11 | |![image](SetProgress.gif)|![image](SetProgressAnimation.gif)|![image](WaveAnimDuration.gif)| 12 | |Set other Properties| 13 | |![image](OtherProperties.gif)| 14 | ## Installation 15 | #### CocoaPods 16 | 1、Add the following line to your Podfile: 17 | ``` 18 | pod 'LKAWaveCircleProgressBar' 19 | ``` 20 | 2、Then, run the following command: 21 | ``` 22 | pod install 23 | ``` 24 | 3、In the source files where you need to use the library, import the header file: 25 | ``` 26 | #import "LKAWaveCircleProgressBar.h" 27 | ``` 28 | #### Manual install 29 | 1、Download the least source files: 30 | 31 | 2、Drag `WaveAnimation/LKAWaveCircleProgressBar` folder to Xcode project.Make sure to select `Copy items if needed`. 32 | 33 | 3、In the source files where you need to use the library, import the header file: 34 | ``` 35 | #import 36 | ``` 37 | ## How To Use 38 | #### Initialization,you can use Autolayout to set the frame. ⚠️`MAKE SURE THE VIEW IS SQUARE` 39 | ``` 40 | LKAWaveCircleProgressBar *wcView = [[LKAWaveCircleProgressBar alloc] initWithFrame:CGRectMake(0, 0, 150, 150)]; 41 | ``` 42 | #### Set indicator's progress, the current progress is represented by a floating-point value between 0.0 and 1.0. 43 | ``` 44 | // Set the progress without animation 45 | self.wcView.progress = value; 46 | // or 47 | [self.wcView setProgress:value]; 48 | // or 49 | [self.wcView setProgress:value animated:NO]; 50 | 51 | // Set the progress with animation 52 | [self.wcView setProgress:value animated:YES]; 53 | ``` 54 | #### Appearance,Please see the file [WaveAnimation/TestViewContorller.m](WaveAnimation/TestViewContorller.m) and check out the sample app for more details. 55 | ``` 56 | // Wave Rolling Animation Duration,default:1s 57 | @property (nonatomic, assign) NSTimeInterval waveRollingDuration; 58 | // Progress Change Animation Duration,default:1s 59 | @property (nonatomic, assign) NSTimeInterval progressAnimationDuration; 60 | // Wave Color,default:[UIColor colorWithRed:1.0 green:0.0 blue:0.0 alpha:0.5] 61 | @property(nonatomic, strong) UIColor *progressTintColor; 62 | // Indicator Border Color,default:[UIColor colorWithRed:1.0 green:0.0 blue:0.0 alpha:0.9] 63 | @property (nonatomic, strong) UIColor *borderColor; 64 | // Indicator Border Line Width,default:2.0 65 | @property (nonatomic, assign) CGFloat borderWidth; 66 | // Progress Change Animation Comletion Block,default is nil,block executes in main thread. 67 | @property (nonatomic, copy) Completion completion; 68 | // Stop Wave Rolling Animation 69 | - (void)stopWaveRollingAnimation; 70 | // Start Wave Rolling Animation 71 | - (void)startWaveRollingAnimation; 72 | ``` 73 | 74 | ## License 75 | LKAWaveCircleProgressBar is released under the [MIT license](LICENSE). See LICENSE for details. 76 | -------------------------------------------------------------------------------- /LKAWaveCircleProgressBar.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # Be sure to run `pod spec lint LKAWaveCircleProgressBar.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 = "LKAWaveCircleProgressBar" 19 | s.version = "0.2.2" 20 | s.summary = "A progress bar with waves animation." 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 | LKAWaveCircleProgressBar is a circular progress indicator with wave rolling animation, you can customize the border color, border line width, wave color, wave rolling animation duration, progress change animation duration. 29 | DESC 30 | 31 | s.homepage = "https://github.com/lukapool/LKAWaveCircleProgressBar" 32 | s.screenshots = "https://github.com/lukapool/LKAWaveCircleProgressBar/blob/master/OtherProperties.gif?raw=true", "https://github.com/lukapool/LKAWaveCircleProgressBar/blob/master/SetProgress.gif?raw=true", "https://github.com/lukapool/LKAWaveCircleProgressBar/blob/master/SetProgressAnimation.gif?raw=true", "https://github.com/lukapool/LKAWaveCircleProgressBar/blob/master/WaveAnimDuration.gif?raw=true" 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 = "MIT" 43 | #s.license = { :type => "MIT", :file => "" } 44 | 45 | 46 | # ――― Author Metadata ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 47 | # 48 | # Specify the authors of the library, with email addresses. Email addresses 49 | # of the authors are extracted from the SCM log. E.g. $ git log. CocoaPods also 50 | # accepts just a name if you'd rather not provide an email address. 51 | # 52 | # Specify a social_media_url where others can refer to, for example a twitter 53 | # profile URL. 54 | # 55 | 56 | s.author = { "Luka" => "422366176@qq.com" } 57 | # Or just: s.author = "Luka" 58 | # s.authors = { "Luka" => "422366176@qq.com" } 59 | # s.social_media_url = "http://twitter.com/Luka" 60 | 61 | # ――― Platform Specifics ――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 62 | # 63 | # If this Pod runs only on iOS or OS X, then specify the platform and 64 | # the deployment target. You can optionally include the target after the platform. 65 | # 66 | 67 | s.platform = :ios, "7.0" 68 | # s.platform = :ios, "5.0" 69 | 70 | # When using multiple platforms 71 | # s.ios.deployment_target = "5.0" 72 | # s.osx.deployment_target = "10.7" 73 | # s.watchos.deployment_target = "2.0" 74 | # s.tvos.deployment_target = "9.0" 75 | 76 | 77 | # ――― Source Location ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 78 | # 79 | # Specify the location from where the source should be retrieved. 80 | # Supports git, hg, bzr, svn and HTTP. 81 | # 82 | 83 | s.source = { :git => "https://github.com/lukapool/LKAWaveCircleProgressBar.git", :tag => "#{s.version}" } 84 | 85 | 86 | # ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 87 | # 88 | # CocoaPods is smart about how it includes source code. For source files 89 | # giving a folder will include any swift, h, m, mm, c & cpp files. 90 | # For header files it will include any header in the folder. 91 | # Not including the public_header_files will make all headers public. 92 | # 93 | 94 | s.source_files = "WaveAnimation/LKAWaveCircleProgressBar/*.{h,m}" 95 | #s.exclude_files = "Classes/Exclude" 96 | 97 | # s.public_header_files = "Classes/**/*.h" 98 | 99 | 100 | # ――― Resources ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 101 | # 102 | # A list of resources included with the Pod. These are copied into the 103 | # target bundle with a build phase script. Anything else will be cleaned. 104 | # You can preserve files from being cleaned, please don't preserve 105 | # non-essential files like tests, examples and documentation. 106 | # 107 | 108 | # s.resource = "icon.png" 109 | # s.resources = "Resources/*.png" 110 | 111 | # s.preserve_paths = "FilesToSave", "MoreFilesToSave" 112 | 113 | 114 | # ――― Project Linking ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 115 | # 116 | # Link your library with frameworks, or libraries. Libraries do not include 117 | # the lib prefix of their name. 118 | # 119 | 120 | # s.framework = "SomeFramework" 121 | # s.frameworks = "SomeFramework", "AnotherFramework" 122 | 123 | # s.library = "iconv" 124 | # s.libraries = "iconv", "xml2" 125 | 126 | 127 | # ――― Project Settings ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 128 | # 129 | # If your library depends on compiler flags you can set them in the xcconfig hash 130 | # where they will only apply to your library. If you depend on other Podspecs 131 | # you can include multiple dependencies to ensure it works. 132 | 133 | s.requires_arc = true 134 | 135 | # s.xcconfig = { "HEADER_SEARCH_PATHS" => "$(SDKROOT)/usr/include/libxml2" } 136 | # s.dependency "JSONKit", "~> 1.4" 137 | 138 | end 139 | -------------------------------------------------------------------------------- /WaveAnimation/LKAWaveCircleProgressBar/LKAWaveCircleProgressBar.m: -------------------------------------------------------------------------------- 1 | // 2 | // LKAWaveCircleProgressBar.m 3 | // WaveAnimation 4 | // 5 | // Created by Luka on 2017/8/23. 6 | // Copyright © 2017年 Luka. All rights reserved. 7 | // 8 | #import "LKAWaveCircleProgressBar.h" 9 | #import "WaveLayer.h" 10 | 11 | @interface LKAWaveCircleProgressBar () 12 | 13 | @property (nonatomic, strong) NSMutableArray *waves; 14 | @property (nonatomic, strong) CALayer *containerLayer; 15 | @property (nonatomic, assign) BOOL isStop; 16 | @property (nonatomic, assign) BOOL isAnimating; 17 | 18 | @end 19 | 20 | @implementation LKAWaveCircleProgressBar 21 | 22 | #pragma mark - custom view initialization 23 | - (void)initialization { 24 | _waveRollingDuration = 1.0; 25 | _progressAnimationDuration = 1.0; 26 | _progress = 0.5; 27 | _progressTintColor = [UIColor colorWithRed:1.0 green:0.0 blue:0.0 alpha:0.5]; 28 | _borderColor = [UIColor colorWithRed:1.0 green:0.0 blue:0.0 alpha:0.9]; 29 | _borderWidth = 2.0; 30 | _isStop = YES; 31 | _isAnimating = NO; 32 | 33 | for (NSUInteger i = 0; i < 2; i++) { 34 | WaveLayer *waveLayer = [WaveLayer layer]; 35 | waveLayer.color = _progressTintColor; 36 | waveLayer.C = _progress; 37 | waveLayer.offsetU = i * M_PI * 0.8; 38 | [self.containerLayer addSublayer:waveLayer]; 39 | [self.waves addObject:waveLayer]; 40 | } 41 | 42 | [NSNotificationCenter.defaultCenter addObserver:self selector:@selector(startWaveRollingAnimation) name:UIApplicationDidBecomeActiveNotification object:nil]; 43 | [NSNotificationCenter.defaultCenter addObserver:self selector:@selector(stopWaveRollingAnimation) name:UIApplicationWillResignActiveNotification object:nil]; 44 | } 45 | 46 | - (instancetype)initWithFrame:(CGRect)frame { 47 | self = [super initWithFrame:frame]; 48 | if (self) { 49 | [self initialization]; 50 | } 51 | return self; 52 | } 53 | 54 | - (instancetype)initWithCoder:(NSCoder *)aDecoder { 55 | self = [super initWithCoder:aDecoder]; 56 | if (self) { 57 | [self initialization]; 58 | } 59 | return self; 60 | } 61 | 62 | - (void)dealloc { 63 | [NSNotificationCenter.defaultCenter removeObserver:self name:UIApplicationDidBecomeActiveNotification object:nil]; 64 | [NSNotificationCenter.defaultCenter removeObserver:self name:UIApplicationWillResignActiveNotification object:nil]; 65 | } 66 | 67 | #pragma mark - lazy loading property 68 | - (CALayer *)containerLayer { 69 | if (!_containerLayer) { 70 | _containerLayer = [CALayer layer]; 71 | _containerLayer.contentsScale = [UIScreen mainScreen].scale; 72 | _containerLayer.masksToBounds = YES; 73 | _containerLayer.borderColor = self.borderColor.CGColor; 74 | _containerLayer.borderWidth = self.borderWidth; 75 | [self.layer addSublayer:self.containerLayer]; 76 | } 77 | return _containerLayer; 78 | } 79 | 80 | - (NSMutableArray *)waves { 81 | if (!_waves) { 82 | _waves = [NSMutableArray arrayWithCapacity:2]; 83 | } 84 | return _waves; 85 | } 86 | 87 | #pragma mark - api property 88 | // progress 89 | - (void)setProgress:(CGFloat)progress { 90 | [self updateProgress:progress animated:NO]; 91 | } 92 | 93 | - (void)updateProgress:(float)progress animated:(BOOL)animated { 94 | CGFloat lastProgress = self.progress; 95 | _progress = MIN(1, MAX(0, progress)); 96 | for (int i = 0; i < self.waves.count; i++) { 97 | WaveLayer *waveLayer = self.waves[i]; 98 | waveLayer.C = self.progress; 99 | } 100 | if (animated) { 101 | [self addProgressAnimationFromValue: lastProgress to: self.progress]; 102 | } 103 | } 104 | 105 | - (void)setProgress:(float)progress animated:(BOOL)animated { 106 | [self updateProgress:progress animated:animated]; 107 | } 108 | 109 | - (void)addProgressAnimationFromValue: (NSTimeInterval)fromValue to: (NSTimeInterval)toValue { 110 | CABasicAnimation *progressAnimation = [CABasicAnimation animationWithKeyPath:@"C"]; 111 | progressAnimation.fromValue = @(fromValue); 112 | progressAnimation.toValue = @(toValue); 113 | progressAnimation.duration = self.progressAnimationDuration; 114 | progressAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; 115 | [progressAnimation setValue:@"ProgressAnimation" forKey:@"Name"]; 116 | for (int i = 0; i < self.waves.count; i++) { 117 | if (i == 0) { 118 | progressAnimation.delegate = self; 119 | } else { 120 | progressAnimation.delegate = nil; 121 | } 122 | WaveLayer *layer = self.waves[i]; 123 | [layer addAnimation:progressAnimation forKey:@"ProgressAnimation"]; 124 | } 125 | } 126 | 127 | // progress tint color 128 | - (void)setProgressTintColor:(UIColor *)progressTintColor { 129 | _progressTintColor = progressTintColor; 130 | for (WaveLayer *layer in self.waves) { 131 | layer.color = progressTintColor; 132 | } 133 | } 134 | 135 | // border Color 136 | - (void)setBorderColor:(UIColor *)borderColor { 137 | _borderColor = borderColor; 138 | self.containerLayer.borderColor = borderColor.CGColor; 139 | } 140 | 141 | // border Width 142 | - (void)setBorderWidth:(CGFloat)borderWidth { 143 | _borderWidth = borderWidth; 144 | self.containerLayer.borderWidth = borderWidth; 145 | // [self layoutIfNeeded]; 146 | [self setNeedsLayout]; 147 | } 148 | // wave Rolling Duration 149 | - (void)setWaveRollingDuration:(NSTimeInterval)waveRollingDuration { 150 | _waveRollingDuration = waveRollingDuration; 151 | if (!self.isStop) 152 | [self startWaveRollingAnimation]; 153 | } 154 | 155 | #pragma mark - prepare to layout 156 | - (void)layoutSubviews { 157 | [super layoutSubviews]; 158 | CGFloat width = CGRectGetWidth(self.bounds); 159 | NSAssert(width == CGRectGetHeight(self.bounds), @"LKAWaveCircleProgressBar MUST BE SQUARE!"); 160 | self.containerLayer.frame = self.bounds; 161 | self.containerLayer.cornerRadius = width / 2.0 + 0.5; 162 | 163 | CGRect waveFrame = CGRectInset(self.bounds, self.borderWidth, self.borderWidth); 164 | 165 | 166 | for (int i = 0; i < self.waves.count; i++) { 167 | WaveLayer *waveLayer = self.waves[i]; 168 | waveLayer.frame = waveFrame; 169 | waveLayer.A = waveFrame.size.width * ( -0.05 - 0.03 * i); 170 | waveLayer.W = 2 * M_PI / waveFrame.size.width * 0.8; 171 | } 172 | } 173 | 174 | - (void)didMoveToSuperview { 175 | [super didMoveToSuperview]; 176 | if (!self.isStop) 177 | [self startWaveRollingAnimation]; 178 | } 179 | 180 | - (void)addWaveRollingAnimation { 181 | CABasicAnimation *waveRollingAnim = [CABasicAnimation animationWithKeyPath:@"U"]; 182 | waveRollingAnim.fromValue = @0; 183 | waveRollingAnim.toValue = @(M_PI * 2); 184 | waveRollingAnim.repeatCount = HUGE_VALF; 185 | waveRollingAnim.removedOnCompletion = NO; 186 | waveRollingAnim.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]; 187 | for (int i = 0; i < self.waves.count; i++) { 188 | waveRollingAnim.duration = self.waveRollingDuration + (i * 0.3); 189 | [self.waves[i] addAnimation:waveRollingAnim forKey:@"WaveRollingAnimation"]; 190 | } 191 | } 192 | 193 | - (void)stopWaveRollingAnimation { 194 | self.isStop = YES; 195 | if (self.isAnimating) { 196 | self.isAnimating = NO; 197 | [self removeWaveRollingAnimation]; 198 | } 199 | } 200 | 201 | - (void)startWaveRollingAnimation { 202 | self.isStop = NO; 203 | if (!self.isAnimating) { 204 | self.isAnimating = YES; 205 | [self addWaveRollingAnimation]; 206 | } 207 | } 208 | 209 | - (void)removeWaveRollingAnimation { 210 | for (WaveLayer *layer in self.waves) { 211 | [layer removeAnimationForKey:@"WaveRollingAnimation"]; 212 | } 213 | } 214 | 215 | #pragma mark - CAAnimationDelegate 216 | - (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag { 217 | NSString *name = [anim valueForKey:@"Name"]; 218 | if ([name isEqualToString:@"ProgressAnimation"]) { 219 | if (self.completion) { 220 | self.completion(); 221 | } 222 | } 223 | } 224 | 225 | @end 226 | -------------------------------------------------------------------------------- /WaveAnimation.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | A1986D001F4D720D008BA99D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = A1986CFF1F4D720D008BA99D /* main.m */; }; 11 | A1986D031F4D720D008BA99D /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = A1986D021F4D720D008BA99D /* AppDelegate.m */; }; 12 | A1986D061F4D720D008BA99D /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A1986D051F4D720D008BA99D /* ViewController.m */; }; 13 | A1986D091F4D720D008BA99D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A1986D071F4D720D008BA99D /* Main.storyboard */; }; 14 | A1986D0B1F4D720D008BA99D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A1986D0A1F4D720D008BA99D /* Assets.xcassets */; }; 15 | A1986D0E1F4D720D008BA99D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A1986D0C1F4D720D008BA99D /* LaunchScreen.storyboard */; }; 16 | A1986D1D1F4DCDAA008BA99D /* TestViewContorller.m in Sources */ = {isa = PBXBuildFile; fileRef = A1986D1C1F4DCDAA008BA99D /* TestViewContorller.m */; }; 17 | A1986D241F4EBDB5008BA99D /* LKAWaveCircleProgressBar.m in Sources */ = {isa = PBXBuildFile; fileRef = A1986D211F4EBDB5008BA99D /* LKAWaveCircleProgressBar.m */; }; 18 | A1986D251F4EBDB5008BA99D /* WaveLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = A1986D231F4EBDB5008BA99D /* WaveLayer.m */; }; 19 | A1FE73B620A6D32700F9ED1B /* TestAViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A1FE73B520A6D32700F9ED1B /* TestAViewController.m */; }; 20 | /* End PBXBuildFile section */ 21 | 22 | /* Begin PBXFileReference section */ 23 | A1986CFB1F4D720D008BA99D /* WaveAnimation.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = WaveAnimation.app; sourceTree = BUILT_PRODUCTS_DIR; }; 24 | A1986CFF1F4D720D008BA99D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 25 | A1986D011F4D720D008BA99D /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 26 | A1986D021F4D720D008BA99D /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 27 | A1986D041F4D720D008BA99D /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 28 | A1986D051F4D720D008BA99D /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 29 | A1986D081F4D720D008BA99D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 30 | A1986D0A1F4D720D008BA99D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 31 | A1986D0D1F4D720D008BA99D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 32 | A1986D0F1F4D720D008BA99D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 33 | A1986D1B1F4DCDAA008BA99D /* TestViewContorller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestViewContorller.h; sourceTree = ""; }; 34 | A1986D1C1F4DCDAA008BA99D /* TestViewContorller.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TestViewContorller.m; sourceTree = ""; }; 35 | A1986D201F4EBDB5008BA99D /* LKAWaveCircleProgressBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LKAWaveCircleProgressBar.h; sourceTree = ""; }; 36 | A1986D211F4EBDB5008BA99D /* LKAWaveCircleProgressBar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LKAWaveCircleProgressBar.m; sourceTree = ""; }; 37 | A1986D221F4EBDB5008BA99D /* WaveLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WaveLayer.h; sourceTree = ""; }; 38 | A1986D231F4EBDB5008BA99D /* WaveLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WaveLayer.m; sourceTree = ""; }; 39 | A1FE73B420A6D32700F9ED1B /* TestAViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TestAViewController.h; sourceTree = ""; }; 40 | A1FE73B520A6D32700F9ED1B /* TestAViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TestAViewController.m; sourceTree = ""; }; 41 | /* End PBXFileReference section */ 42 | 43 | /* Begin PBXFrameworksBuildPhase section */ 44 | A1986CF81F4D720D008BA99D /* Frameworks */ = { 45 | isa = PBXFrameworksBuildPhase; 46 | buildActionMask = 2147483647; 47 | files = ( 48 | ); 49 | runOnlyForDeploymentPostprocessing = 0; 50 | }; 51 | /* End PBXFrameworksBuildPhase section */ 52 | 53 | /* Begin PBXGroup section */ 54 | A1986CF21F4D720D008BA99D = { 55 | isa = PBXGroup; 56 | children = ( 57 | A1986CFD1F4D720D008BA99D /* WaveAnimation */, 58 | A1986CFC1F4D720D008BA99D /* Products */, 59 | ); 60 | sourceTree = ""; 61 | }; 62 | A1986CFC1F4D720D008BA99D /* Products */ = { 63 | isa = PBXGroup; 64 | children = ( 65 | A1986CFB1F4D720D008BA99D /* WaveAnimation.app */, 66 | ); 67 | name = Products; 68 | sourceTree = ""; 69 | }; 70 | A1986CFD1F4D720D008BA99D /* WaveAnimation */ = { 71 | isa = PBXGroup; 72 | children = ( 73 | A1986D1F1F4EBDB5008BA99D /* LKAWaveCircleProgressBar */, 74 | A1986D011F4D720D008BA99D /* AppDelegate.h */, 75 | A1986D021F4D720D008BA99D /* AppDelegate.m */, 76 | A1986D041F4D720D008BA99D /* ViewController.h */, 77 | A1986D051F4D720D008BA99D /* ViewController.m */, 78 | A1986D071F4D720D008BA99D /* Main.storyboard */, 79 | A1986D0A1F4D720D008BA99D /* Assets.xcassets */, 80 | A1986D0C1F4D720D008BA99D /* LaunchScreen.storyboard */, 81 | A1986D0F1F4D720D008BA99D /* Info.plist */, 82 | A1986CFE1F4D720D008BA99D /* Supporting Files */, 83 | A1986D1B1F4DCDAA008BA99D /* TestViewContorller.h */, 84 | A1986D1C1F4DCDAA008BA99D /* TestViewContorller.m */, 85 | A1FE73B420A6D32700F9ED1B /* TestAViewController.h */, 86 | A1FE73B520A6D32700F9ED1B /* TestAViewController.m */, 87 | ); 88 | path = WaveAnimation; 89 | sourceTree = ""; 90 | }; 91 | A1986CFE1F4D720D008BA99D /* Supporting Files */ = { 92 | isa = PBXGroup; 93 | children = ( 94 | A1986CFF1F4D720D008BA99D /* main.m */, 95 | ); 96 | name = "Supporting Files"; 97 | sourceTree = ""; 98 | }; 99 | A1986D1F1F4EBDB5008BA99D /* LKAWaveCircleProgressBar */ = { 100 | isa = PBXGroup; 101 | children = ( 102 | A1986D201F4EBDB5008BA99D /* LKAWaveCircleProgressBar.h */, 103 | A1986D211F4EBDB5008BA99D /* LKAWaveCircleProgressBar.m */, 104 | A1986D221F4EBDB5008BA99D /* WaveLayer.h */, 105 | A1986D231F4EBDB5008BA99D /* WaveLayer.m */, 106 | ); 107 | path = LKAWaveCircleProgressBar; 108 | sourceTree = ""; 109 | }; 110 | /* End PBXGroup section */ 111 | 112 | /* Begin PBXNativeTarget section */ 113 | A1986CFA1F4D720D008BA99D /* WaveAnimation */ = { 114 | isa = PBXNativeTarget; 115 | buildConfigurationList = A1986D121F4D720D008BA99D /* Build configuration list for PBXNativeTarget "WaveAnimation" */; 116 | buildPhases = ( 117 | A1986CF71F4D720D008BA99D /* Sources */, 118 | A1986CF81F4D720D008BA99D /* Frameworks */, 119 | A1986CF91F4D720D008BA99D /* Resources */, 120 | ); 121 | buildRules = ( 122 | ); 123 | dependencies = ( 124 | ); 125 | name = WaveAnimation; 126 | productName = WaveAnimation; 127 | productReference = A1986CFB1F4D720D008BA99D /* WaveAnimation.app */; 128 | productType = "com.apple.product-type.application"; 129 | }; 130 | /* End PBXNativeTarget section */ 131 | 132 | /* Begin PBXProject section */ 133 | A1986CF31F4D720D008BA99D /* Project object */ = { 134 | isa = PBXProject; 135 | attributes = { 136 | LastUpgradeCheck = 0830; 137 | ORGANIZATIONNAME = Luka; 138 | TargetAttributes = { 139 | A1986CFA1F4D720D008BA99D = { 140 | CreatedOnToolsVersion = 8.3; 141 | DevelopmentTeam = F9QPXX27PM; 142 | ProvisioningStyle = Automatic; 143 | }; 144 | }; 145 | }; 146 | buildConfigurationList = A1986CF61F4D720D008BA99D /* Build configuration list for PBXProject "WaveAnimation" */; 147 | compatibilityVersion = "Xcode 3.2"; 148 | developmentRegion = English; 149 | hasScannedForEncodings = 0; 150 | knownRegions = ( 151 | en, 152 | Base, 153 | ); 154 | mainGroup = A1986CF21F4D720D008BA99D; 155 | productRefGroup = A1986CFC1F4D720D008BA99D /* Products */; 156 | projectDirPath = ""; 157 | projectRoot = ""; 158 | targets = ( 159 | A1986CFA1F4D720D008BA99D /* WaveAnimation */, 160 | ); 161 | }; 162 | /* End PBXProject section */ 163 | 164 | /* Begin PBXResourcesBuildPhase section */ 165 | A1986CF91F4D720D008BA99D /* Resources */ = { 166 | isa = PBXResourcesBuildPhase; 167 | buildActionMask = 2147483647; 168 | files = ( 169 | A1986D0E1F4D720D008BA99D /* LaunchScreen.storyboard in Resources */, 170 | A1986D0B1F4D720D008BA99D /* Assets.xcassets in Resources */, 171 | A1986D091F4D720D008BA99D /* Main.storyboard in Resources */, 172 | ); 173 | runOnlyForDeploymentPostprocessing = 0; 174 | }; 175 | /* End PBXResourcesBuildPhase section */ 176 | 177 | /* Begin PBXSourcesBuildPhase section */ 178 | A1986CF71F4D720D008BA99D /* Sources */ = { 179 | isa = PBXSourcesBuildPhase; 180 | buildActionMask = 2147483647; 181 | files = ( 182 | A1986D1D1F4DCDAA008BA99D /* TestViewContorller.m in Sources */, 183 | A1986D061F4D720D008BA99D /* ViewController.m in Sources */, 184 | A1986D251F4EBDB5008BA99D /* WaveLayer.m in Sources */, 185 | A1986D031F4D720D008BA99D /* AppDelegate.m in Sources */, 186 | A1986D241F4EBDB5008BA99D /* LKAWaveCircleProgressBar.m in Sources */, 187 | A1FE73B620A6D32700F9ED1B /* TestAViewController.m in Sources */, 188 | A1986D001F4D720D008BA99D /* main.m in Sources */, 189 | ); 190 | runOnlyForDeploymentPostprocessing = 0; 191 | }; 192 | /* End PBXSourcesBuildPhase section */ 193 | 194 | /* Begin PBXVariantGroup section */ 195 | A1986D071F4D720D008BA99D /* Main.storyboard */ = { 196 | isa = PBXVariantGroup; 197 | children = ( 198 | A1986D081F4D720D008BA99D /* Base */, 199 | ); 200 | name = Main.storyboard; 201 | sourceTree = ""; 202 | }; 203 | A1986D0C1F4D720D008BA99D /* LaunchScreen.storyboard */ = { 204 | isa = PBXVariantGroup; 205 | children = ( 206 | A1986D0D1F4D720D008BA99D /* Base */, 207 | ); 208 | name = LaunchScreen.storyboard; 209 | sourceTree = ""; 210 | }; 211 | /* End PBXVariantGroup section */ 212 | 213 | /* Begin XCBuildConfiguration section */ 214 | A1986D101F4D720D008BA99D /* Debug */ = { 215 | isa = XCBuildConfiguration; 216 | buildSettings = { 217 | ALWAYS_SEARCH_USER_PATHS = NO; 218 | CLANG_ANALYZER_NONNULL = YES; 219 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 220 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 221 | CLANG_CXX_LIBRARY = "libc++"; 222 | CLANG_ENABLE_MODULES = YES; 223 | CLANG_ENABLE_OBJC_ARC = YES; 224 | CLANG_WARN_BOOL_CONVERSION = YES; 225 | CLANG_WARN_CONSTANT_CONVERSION = YES; 226 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 227 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 228 | CLANG_WARN_EMPTY_BODY = YES; 229 | CLANG_WARN_ENUM_CONVERSION = YES; 230 | CLANG_WARN_INFINITE_RECURSION = YES; 231 | CLANG_WARN_INT_CONVERSION = YES; 232 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 233 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 234 | CLANG_WARN_UNREACHABLE_CODE = YES; 235 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 236 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 237 | COPY_PHASE_STRIP = NO; 238 | DEBUG_INFORMATION_FORMAT = dwarf; 239 | ENABLE_STRICT_OBJC_MSGSEND = YES; 240 | ENABLE_TESTABILITY = YES; 241 | GCC_C_LANGUAGE_STANDARD = gnu99; 242 | GCC_DYNAMIC_NO_PIC = NO; 243 | GCC_NO_COMMON_BLOCKS = YES; 244 | GCC_OPTIMIZATION_LEVEL = 0; 245 | GCC_PREPROCESSOR_DEFINITIONS = ( 246 | "DEBUG=1", 247 | "$(inherited)", 248 | ); 249 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 250 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 251 | GCC_WARN_UNDECLARED_SELECTOR = YES; 252 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 253 | GCC_WARN_UNUSED_FUNCTION = YES; 254 | GCC_WARN_UNUSED_VARIABLE = YES; 255 | IPHONEOS_DEPLOYMENT_TARGET = 10.3; 256 | MTL_ENABLE_DEBUG_INFO = YES; 257 | ONLY_ACTIVE_ARCH = YES; 258 | SDKROOT = iphoneos; 259 | TARGETED_DEVICE_FAMILY = "1,2"; 260 | }; 261 | name = Debug; 262 | }; 263 | A1986D111F4D720D008BA99D /* Release */ = { 264 | isa = XCBuildConfiguration; 265 | buildSettings = { 266 | ALWAYS_SEARCH_USER_PATHS = NO; 267 | CLANG_ANALYZER_NONNULL = YES; 268 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 269 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 270 | CLANG_CXX_LIBRARY = "libc++"; 271 | CLANG_ENABLE_MODULES = YES; 272 | CLANG_ENABLE_OBJC_ARC = YES; 273 | CLANG_WARN_BOOL_CONVERSION = YES; 274 | CLANG_WARN_CONSTANT_CONVERSION = YES; 275 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 276 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 277 | CLANG_WARN_EMPTY_BODY = YES; 278 | CLANG_WARN_ENUM_CONVERSION = YES; 279 | CLANG_WARN_INFINITE_RECURSION = YES; 280 | CLANG_WARN_INT_CONVERSION = YES; 281 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 282 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 283 | CLANG_WARN_UNREACHABLE_CODE = YES; 284 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 285 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 286 | COPY_PHASE_STRIP = NO; 287 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 288 | ENABLE_NS_ASSERTIONS = NO; 289 | ENABLE_STRICT_OBJC_MSGSEND = YES; 290 | GCC_C_LANGUAGE_STANDARD = gnu99; 291 | GCC_NO_COMMON_BLOCKS = YES; 292 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 293 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 294 | GCC_WARN_UNDECLARED_SELECTOR = YES; 295 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 296 | GCC_WARN_UNUSED_FUNCTION = YES; 297 | GCC_WARN_UNUSED_VARIABLE = YES; 298 | IPHONEOS_DEPLOYMENT_TARGET = 10.3; 299 | MTL_ENABLE_DEBUG_INFO = NO; 300 | SDKROOT = iphoneos; 301 | TARGETED_DEVICE_FAMILY = "1,2"; 302 | VALIDATE_PRODUCT = YES; 303 | }; 304 | name = Release; 305 | }; 306 | A1986D131F4D720D008BA99D /* Debug */ = { 307 | isa = XCBuildConfiguration; 308 | buildSettings = { 309 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 310 | DEVELOPMENT_TEAM = F9QPXX27PM; 311 | INFOPLIST_FILE = WaveAnimation/Info.plist; 312 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 313 | PRODUCT_BUNDLE_IDENTIFIER = "com.find-lab.WaveAnimation"; 314 | PRODUCT_NAME = "$(TARGET_NAME)"; 315 | }; 316 | name = Debug; 317 | }; 318 | A1986D141F4D720D008BA99D /* Release */ = { 319 | isa = XCBuildConfiguration; 320 | buildSettings = { 321 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 322 | DEVELOPMENT_TEAM = F9QPXX27PM; 323 | INFOPLIST_FILE = WaveAnimation/Info.plist; 324 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 325 | PRODUCT_BUNDLE_IDENTIFIER = "com.find-lab.WaveAnimation"; 326 | PRODUCT_NAME = "$(TARGET_NAME)"; 327 | }; 328 | name = Release; 329 | }; 330 | /* End XCBuildConfiguration section */ 331 | 332 | /* Begin XCConfigurationList section */ 333 | A1986CF61F4D720D008BA99D /* Build configuration list for PBXProject "WaveAnimation" */ = { 334 | isa = XCConfigurationList; 335 | buildConfigurations = ( 336 | A1986D101F4D720D008BA99D /* Debug */, 337 | A1986D111F4D720D008BA99D /* Release */, 338 | ); 339 | defaultConfigurationIsVisible = 0; 340 | defaultConfigurationName = Release; 341 | }; 342 | A1986D121F4D720D008BA99D /* Build configuration list for PBXNativeTarget "WaveAnimation" */ = { 343 | isa = XCConfigurationList; 344 | buildConfigurations = ( 345 | A1986D131F4D720D008BA99D /* Debug */, 346 | A1986D141F4D720D008BA99D /* Release */, 347 | ); 348 | defaultConfigurationIsVisible = 0; 349 | defaultConfigurationName = Release; 350 | }; 351 | /* End XCConfigurationList section */ 352 | }; 353 | rootObject = A1986CF31F4D720D008BA99D /* Project object */; 354 | } 355 | -------------------------------------------------------------------------------- /WaveAnimation/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 | 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 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 113 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 147 | 158 | 169 | 170 | 171 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | --------------------------------------------------------------------------------