├── 波浪
├── 波浪
│ ├── Assets.xcassets
│ │ ├── Contents.json
│ │ ├── 123.imageset
│ │ │ ├── 123.png
│ │ │ └── Contents.json
│ │ └── AppIcon.appiconset
│ │ │ └── Contents.json
│ ├── ViewController.h
│ ├── AppDelegate.h
│ ├── main.m
│ ├── UIView+Extension.h
│ ├── NBWaveView.h
│ ├── NBWaveConfig.m
│ ├── NBWaveConfig.h
│ ├── ViewController.m
│ ├── Info.plist
│ ├── Base.lproj
│ │ ├── LaunchScreen.storyboard
│ │ └── Main.storyboard
│ ├── UIView+Extension.m
│ ├── AppDelegate.m
│ └── NBWaveView.m
├── 波浪.xcodeproj
│ ├── xcuserdata
│ │ ├── mac.xcuserdatad
│ │ │ ├── xcdebugger
│ │ │ │ └── Breakpoints_v2.xcbkptlist
│ │ │ └── xcschemes
│ │ │ │ └── xcschememanagement.plist
│ │ └── liqiang.xcuserdatad
│ │ │ ├── xcdebugger
│ │ │ └── Breakpoints_v2.xcbkptlist
│ │ │ └── xcschemes
│ │ │ └── xcschememanagement.plist
│ ├── project.xcworkspace
│ │ ├── xcuserdata
│ │ │ ├── mac.xcuserdatad
│ │ │ │ └── UserInterfaceState.xcuserstate
│ │ │ └── liqiang.xcuserdatad
│ │ │ │ └── UserInterfaceState.xcuserstate
│ │ └── contents.xcworkspacedata
│ └── project.pbxproj
├── 波浪Tests
│ ├── Info.plist
│ └── __Tests.m
└── 波浪UITests
│ ├── Info.plist
│ └── __UITests.m
├── README.md
└── .gitignore
/波浪/波浪/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/波浪/波浪/Assets.xcassets/123.imageset/123.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoderLi-Q/WaveViewAndShip/HEAD/波浪/波浪/Assets.xcassets/123.imageset/123.png
--------------------------------------------------------------------------------
/波浪/波浪.xcodeproj/xcuserdata/mac.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
--------------------------------------------------------------------------------
/波浪/波浪.xcodeproj/xcuserdata/liqiang.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
--------------------------------------------------------------------------------
/波浪/波浪.xcodeproj/project.xcworkspace/xcuserdata/mac.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoderLi-Q/WaveViewAndShip/HEAD/波浪/波浪.xcodeproj/project.xcworkspace/xcuserdata/mac.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/波浪/波浪.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/波浪/波浪.xcodeproj/project.xcworkspace/xcuserdata/liqiang.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoderLi-Q/WaveViewAndShip/HEAD/波浪/波浪.xcodeproj/project.xcworkspace/xcuserdata/liqiang.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/波浪/波浪/ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.h
3 | // 波浪
4 | //
5 | // Created by mac on 2017/10/18.
6 | // Copyright © 2017年 mac. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ViewController : UIViewController
12 |
13 |
14 | @end
15 |
16 |
--------------------------------------------------------------------------------
/波浪/波浪/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // 波浪
4 | //
5 | // Created by mac on 2017/10/18.
6 | // Copyright © 2017年 mac. 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 |
--------------------------------------------------------------------------------
/波浪/波浪/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // 波浪
4 | //
5 | // Created by mac on 2017/10/18.
6 | // Copyright © 2017年 mac. 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 |
--------------------------------------------------------------------------------
/波浪/波浪/Assets.xcassets/123.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "123.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/波浪/波浪.xcodeproj/xcuserdata/mac.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | 波浪.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/波浪/波浪.xcodeproj/xcuserdata/liqiang.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | 波浪.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/波浪/波浪/UIView+Extension.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIView+Extension.h
3 | //
4 |
5 | #import
6 |
7 | @interface UIView (Extension)
8 | @property (nonatomic, assign) CGFloat x;
9 | @property (nonatomic, assign) CGFloat y;
10 | @property (nonatomic, assign) CGFloat centerX;
11 | @property (nonatomic, assign) CGFloat centerY;
12 | @property (nonatomic, assign) CGFloat width;
13 | @property (nonatomic, assign) CGFloat height;
14 | @property (nonatomic, assign) CGSize size;
15 | @end
16 |
--------------------------------------------------------------------------------
/波浪/波浪/NBWaveView.h:
--------------------------------------------------------------------------------
1 | //
2 | // NBWaveView.h
3 | // 波浪
4 | //
5 | // Created by mac on 2017/10/18.
6 | // Copyright © 2017年 mac. All rights reserved.
7 | //
8 | /*
9 | y = Asin(ωx+φ)+ C
10 | A 表示振幅,也就是使用这个变量来调整波浪的高度
11 | ω 表示周期,也就是使用这个变量来调整在屏幕内显示的波浪的数量
12 | φ 表示波浪横向的偏移,也就是使用这个变量来调整波浪的流动
13 | C 表示波浪纵向的位置,也就是使用这个变量来调整波浪在屏幕中竖直的位置。
14 | */
15 |
16 | #import
17 | #import "NBWaveConfig.h"
18 |
19 | @interface NBWaveView : UIView
20 |
21 | /**
22 | 快速创建方法
23 |
24 | @param config 配置的block(可以直接进行初始化是否需要动画效果展示)
25 | @return 返回
26 | */
27 | + (instancetype)waveViewWithConfig:(void(^)(NBWaveConfig *config))config;
28 | #pragma mark - 方法
29 | /**
30 | 当需要手动开启的时候调用这个方法
31 | */
32 | - (void)startWave;
33 | /**
34 | 需要手动关闭的时候调用这个方法
35 | */
36 | - (void)stopWave;
37 |
38 | @end
39 |
--------------------------------------------------------------------------------
/波浪/波浪Tests/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 |
--------------------------------------------------------------------------------
/波浪/波浪UITests/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 |
--------------------------------------------------------------------------------
/波浪/波浪/NBWaveConfig.m:
--------------------------------------------------------------------------------
1 | //
2 | // NBWaveConfig.m
3 | // 波浪
4 | //
5 | // Created by mac on 2017/10/19.
6 | // Copyright © 2017年 mac. All rights reserved.
7 | //
8 |
9 | #import "NBWaveConfig.h"
10 |
11 | @implementation NBWaveConfig
12 | + (instancetype)defaultConfig
13 | {
14 | NBWaveConfig *config = [[NBWaveConfig alloc] init];
15 | config.bgColor = [UIColor redColor];
16 | config.waveColor = [UIColor greenColor];
17 | config.waveSpeed = 0.1; // 速度
18 | config.waveA = 20; // 振幅
19 | config.wavePeriod = 1/30.0; // 周期
20 | config.waveOffset = 0.0; // 设置横向偏移
21 | config.waveC = config.waveA*2; // 纵向位置
22 | config.position = NBWavePositionBottom;
23 | config.isAnimation = YES;
24 | config.isShowImage = NO;
25 | config.imgSize = CGSizeMake(20, 20);
26 | return config;
27 | }
28 | @end
29 |
--------------------------------------------------------------------------------
/波浪/波浪Tests/__Tests.m:
--------------------------------------------------------------------------------
1 | //
2 | // __Tests.m
3 | // 波浪Tests
4 | //
5 | // Created by mac on 2017/10/18.
6 | // Copyright © 2017年 mac. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface __Tests : XCTestCase
12 |
13 | @end
14 |
15 | @implementation __Tests
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 |
--------------------------------------------------------------------------------
/波浪/波浪UITests/__UITests.m:
--------------------------------------------------------------------------------
1 | //
2 | // __UITests.m
3 | // 波浪UITests
4 | //
5 | // Created by mac on 2017/10/18.
6 | // Copyright © 2017年 mac. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface __UITests : XCTestCase
12 |
13 | @end
14 |
15 | @implementation __UITests
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 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # WaveViewAndShip
2 |
3 | 最近有朋友让我帮他看一个demo的实现,这个demo需求描述很简单:
4 |
5 | 实现小船随波浪起伏的动画
6 |
7 | 先上效果图,有兴趣的童鞋,可以先自己想想实现方式再看我的思路:
8 | 
9 |
10 | 1 分析问题:此需求页面有两个元素:一个小船,一个曲面
11 | 1.1 小船很简单,UIImageView+一张小船图片就可以
12 | 1.2 曲面是一个正弦曲线或者余弦曲线,向上偏移一定量, 此曲线与一条线之间的空间填充上颜色,也能实现;
13 | 2 重难点问题分析:
14 | 2.1 正弦或余弦曲线怎么画: 网上有很多实现方式,这里不再赘述,本文是参考一个类叫NBWaveView,实现正弦曲线的
15 | 2.2 小船怎么与曲线同步起伏: 由观察得知小船在起伏的时候,大小没有变化,变化的是位置(center)和transform,接下来就是找出小船对应每一点的center和transform;
16 |
17 | 3 重点解决小船对应没一点的center和transform
18 | 为了方便叙述,先画两张张图:
19 |
20 | 
21 |
22 |
23 | 
24 | 有兴趣的同学可以研究一下,没兴趣请当做没有看到这两张图,直接看结论:
25 |
26 | //角度为
27 | CGFloat angle = self.config.waveA * self.config.wavePeriod *
28 | cos(self.config.wavePeriod*(self.width/2)+self.config.waveOffset);
29 | //中心点坐标为
30 | self.imgView.centerY = self.imgView.size.height/2*cos(angle)+y-self.imgView.size.height;
31 | self.imgView.centerX = self.imgView.size.height/2*sin(angle)+self.width/2;
32 |
33 | 详细实现请下载demo
34 |
--------------------------------------------------------------------------------
/波浪/波浪/NBWaveConfig.h:
--------------------------------------------------------------------------------
1 | //
2 | // NBWaveConfig.h
3 | // 波浪
4 | //
5 | // Created by mac on 2017/10/19.
6 | // Copyright © 2017年 mac. All rights reserved.
7 | //
8 |
9 | #import
10 | /**
11 | 定义波浪位置的枚举
12 | */
13 | typedef NS_ENUM(NSUInteger, NBWavePosition) {
14 | NBWavePositionTop,
15 | NBWavePositionBottom,
16 | };
17 |
18 | @interface NBWaveConfig : NSObject
19 |
20 | + (instancetype)defaultConfig;
21 |
22 | #pragma mark - 这里设置波浪的属性
23 | /**
24 | A 表示振幅,也就是使用这个变量来调整波浪的高度
25 | */
26 | @property(nonatomic, assign) CGFloat waveA;
27 | /**
28 | ω 表示周期,也就是使用这个变量来调整在屏幕内显示的波浪的数量
29 | */
30 | @property(nonatomic, assign) CGFloat wavePeriod;
31 | /**
32 | φ 表示波浪横向的偏移,也就是使用这个变量来调整波浪的流动
33 | */
34 | @property(nonatomic, assign) CGFloat waveOffset;
35 | /**
36 | C 表示波浪纵向的位置,也就是使用这个变量来调整波浪在屏幕中竖直的位置。
37 | */
38 | @property(nonatomic, assign) CGFloat waveC;
39 | /**
40 | 设置波浪的速度
41 | */
42 | @property(nonatomic, assign) CGFloat waveSpeed;
43 |
44 | #pragma mark - 设置波浪的外观等
45 | /**
46 | 波浪显示的位置
47 | */
48 | @property(nonatomic, strong) UIColor *bgColor;
49 | /**
50 | 波浪的颜色
51 | */
52 | @property(nonatomic, strong) UIColor *waveColor;
53 |
54 | /**
55 | 波浪的覆盖位置
56 | */
57 | @property(nonatomic, assign) NBWavePosition position;
58 |
59 | /**
60 | 波浪的覆盖位置
61 | */
62 | @property(nonatomic, assign) BOOL isAnimation;
63 | /**
64 | 是否显示image
65 | */
66 | @property(nonatomic, assign) BOOL isShowImage;
67 |
68 | @property(nonatomic, assign) CGSize imgSize;
69 |
70 | @end
71 |
--------------------------------------------------------------------------------
/波浪/波浪/ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.m
3 | // 波浪
4 | //
5 | // Created by mac on 2017/10/18.
6 | // Copyright © 2017年 mac. All rights reserved.
7 | //
8 |
9 | #import "ViewController.h"
10 | #import "NBWaveView.h"
11 |
12 | @interface ViewController ()
13 |
14 | @property (weak, nonatomic) IBOutlet UISwitch *waveSwitch;
15 | @property(nonatomic, weak) NBWaveView *wave;
16 | @end
17 |
18 | @implementation ViewController
19 |
20 | - (IBAction)switchChange:(UISwitch *)sender {
21 |
22 | if (sender.isOn) {
23 | [self.wave startWave];
24 | } else {
25 | [self.wave stopWave];
26 | }
27 |
28 | }
29 |
30 | - (void)viewDidLoad {
31 | [super viewDidLoad];
32 |
33 | NBWaveView *wave = [NBWaveView waveViewWithConfig:^(NBWaveConfig *config) {
34 | config.position = NBWavePositionBottom;
35 | config.bgColor = [UIColor clearColor];
36 | config.isAnimation = YES;
37 | config.isShowImage = YES;
38 | config.waveSpeed = 0.05;
39 | config.waveA = 10;
40 | config.waveColor = [UIColor colorWithWhite:212/255.0 alpha:0.7];
41 | }];
42 | self.wave = wave;
43 | wave.frame = CGRectMake(0, 100, [UIScreen mainScreen].bounds.size.width, 200);
44 | [self.view addSubview:wave];
45 |
46 |
47 | }
48 |
49 | - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
50 | {
51 | [self.wave startWave];
52 | }
53 |
54 |
55 | - (void)didReceiveMemoryWarning {
56 | [super didReceiveMemoryWarning];
57 | // Dispose of any resources that can be recreated.
58 | }
59 |
60 |
61 | @end
62 |
--------------------------------------------------------------------------------
/波浪/波浪/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 |
--------------------------------------------------------------------------------
/.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 |
--------------------------------------------------------------------------------
/波浪/波浪/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 |
--------------------------------------------------------------------------------
/波浪/波浪/UIView+Extension.m:
--------------------------------------------------------------------------------
1 | //
2 | // UIView+Extension.m
3 | //
4 |
5 | #import "UIView+Extension.h"
6 |
7 | @implementation UIView (Extension)
8 |
9 | - (void)setX:(CGFloat)x
10 | {
11 | CGRect frame = self.frame;
12 | frame.origin.x = x;
13 | self.frame = frame;
14 | }
15 |
16 | - (CGFloat)x
17 | {
18 | return self.frame.origin.x;
19 | }
20 |
21 | - (void)setY:(CGFloat)y
22 | {
23 | CGRect frame = self.frame;
24 | frame.origin.y = y;
25 | self.frame = frame;
26 | }
27 |
28 | - (CGFloat)y
29 | {
30 | return self.frame.origin.y;
31 | }
32 |
33 | - (void)setCenterX:(CGFloat)centerX
34 | {
35 | CGPoint center = self.center;
36 | center.x = centerX;
37 | self.center = center;
38 | }
39 |
40 | - (CGFloat)centerX
41 | {
42 | return self.center.x;
43 | }
44 |
45 | - (void)setCenterY:(CGFloat)centerY
46 | {
47 | CGPoint center = self.center;
48 | center.y = centerY;
49 | self.center = center;
50 | }
51 |
52 | - (CGFloat)centerY
53 | {
54 | return self.center.y;
55 | }
56 |
57 | - (void)setWidth:(CGFloat)width
58 | {
59 | CGRect frame = self.frame;
60 | frame.size.width = width;
61 | self.frame = frame;
62 | }
63 |
64 | - (CGFloat)width
65 | {
66 | return self.frame.size.width;
67 | }
68 |
69 | - (void)setHeight:(CGFloat)height
70 | {
71 | CGRect frame = self.frame;
72 | frame.size.height = height;
73 | self.frame = frame;
74 | }
75 |
76 | - (CGFloat)height
77 | {
78 | return self.frame.size.height;
79 | }
80 |
81 | - (void)setSize:(CGSize)size
82 | {
83 | // self.width = size.width;
84 | // self.height = size.height;
85 | CGRect frame = self.frame;
86 | frame.size = size;
87 | self.frame = frame;
88 | }
89 |
90 | - (CGSize)size
91 | {
92 | return self.frame.size;
93 | }
94 |
95 | @end
96 |
--------------------------------------------------------------------------------
/波浪/波浪/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 | "idiom" : "ios-marketing",
90 | "size" : "1024x1024",
91 | "scale" : "1x"
92 | }
93 | ],
94 | "info" : {
95 | "version" : 1,
96 | "author" : "xcode"
97 | }
98 | }
--------------------------------------------------------------------------------
/波浪/波浪/AppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.m
3 | // 波浪
4 | //
5 | // Created by mac on 2017/10/18.
6 | // Copyright © 2017年 mac. 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 |
--------------------------------------------------------------------------------
/波浪/波浪/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/波浪/波浪/NBWaveView.m:
--------------------------------------------------------------------------------
1 | //
2 | // NBWaveView.m
3 | // 波浪
4 | //
5 | // Created by mac on 2017/10/18.
6 | // Copyright © 2017年 mac. All rights reserved.
7 | //
8 |
9 | #import "NBWaveView.h"
10 | #import "NBWaveConfig.h"
11 | #import "UIView+Extension.h"
12 |
13 | @interface NBWaveView()
14 | /**
15 | 水波纹动图的定时器
16 | */
17 | @property (nonatomic, strong) CADisplayLink *waveDisplaylink;
18 | /**
19 | 波纹View
20 | */
21 | @property (nonatomic,strong) CAShapeLayer * waveLayer;
22 | /**
23 | 基础设置
24 | */
25 | @property(nonatomic, strong) NBWaveConfig *config;
26 |
27 | @property(nonatomic, strong) UIImageView *imgView;
28 |
29 | @end
30 |
31 | @implementation NBWaveView
32 | #pragma mark - 快速创建方法
33 | + (instancetype)waveViewWithConfig:(void (^)(NBWaveConfig *))config
34 | {
35 | NBWaveView *waveView = [[NBWaveView alloc] initWithConfig:config];
36 | return waveView;
37 | }
38 | - (instancetype)initWithConfig:(void (^)(NBWaveConfig *))config
39 | {
40 | NBWaveView *waveView = [[NBWaveView alloc] init];
41 | if (config) {
42 | config(waveView.config);
43 | }
44 | waveView.backgroundColor = waveView.config.bgColor;
45 | [waveView.layer addSublayer:waveView.waveLayer];
46 | if (waveView.config.isAnimation) {
47 | [waveView startWave];
48 | }
49 | return waveView;
50 | }
51 |
52 | - (void)drawRect:(CGRect)rect
53 | {
54 | [super drawRect:rect];
55 | [self wave];
56 | }
57 |
58 | /**
59 | 这里进行绘制
60 | */
61 | - (void)wave
62 | {
63 | CGMutablePathRef path = CGPathCreateMutable();
64 | // 设置波浪起点
65 | CGFloat y = self.config.waveC;
66 | CGPathMoveToPoint(path, nil, 0, y);
67 | // 绘制波浪至终点
68 | for (NSInteger x = 0.f; x <= self.width; x++) {
69 | y = self.config.waveA * sin(self.config.wavePeriod*x+self.config.waveOffset) + self.config.waveC;
70 | CGPathAddLineToPoint(path, nil, x, y);
71 | }
72 | switch (self.config.position) {
73 | case NBWavePositionTop: // 顶部绘制
74 | CGPathAddLineToPoint(path, nil, self.width, 0);
75 | CGPathAddLineToPoint(path, nil, 0, 0);
76 | break;
77 | case NBWavePositionBottom: // 底部绘制
78 | CGPathAddLineToPoint(path, nil, self.width, self.height);
79 | CGPathAddLineToPoint(path, nil, 0, self.height);
80 | break;
81 | default:
82 | break;
83 | }
84 | if (self.config.isShowImage) {
85 | y = self.config.waveA * sin(self.config.wavePeriod*(self.width/2)+self.config.waveOffset) + self.config.waveC;
86 | CGFloat angle = self.config.waveA * self.config.wavePeriod * cos(self.config.wavePeriod*(self.width/2)+self.config.waveOffset);
87 |
88 | self.imgView.centerY = self.config.imgSize.height/2*cos(angle)+y-self.config.imgSize.height;
89 | self.imgView.centerX = self.config.imgSize.height/2*sin(angle)+self.width/2;
90 |
91 | NSLog(@"%.2f",angle);
92 | self.imgView.transform = CGAffineTransformMakeRotation(angle);
93 | }
94 |
95 | self.waveLayer.fillColor = self.config.waveColor.CGColor;
96 | CGPathCloseSubpath(path);
97 | self.waveLayer.path = path;
98 | CGPathRelease(path);
99 | }
100 |
101 | /**
102 | 开启定时器
103 | */
104 | - (void)startWave
105 | {
106 | if (_waveDisplaylink != nil) { return; }
107 | // 开启定时器
108 | [self waveDisplaylink];
109 |
110 | }
111 |
112 | - (void)drawWave
113 | {
114 | self.config.waveOffset += self.config.waveSpeed;
115 | [self setNeedsDisplay];
116 |
117 | }
118 |
119 | /**
120 | 停止波纹展示
121 | */
122 | - (void)stopWave
123 | {
124 | [self.waveDisplaylink invalidate];
125 | self.waveDisplaylink = nil;
126 | }
127 | #pragma mark - 懒加载
128 | /**
129 | 绘制的图层layer
130 | */
131 | - (CAShapeLayer *)waveLayer
132 | {
133 | if (_waveLayer == nil) {
134 | _waveLayer = [CAShapeLayer layer];
135 | }
136 | return _waveLayer;
137 | }
138 | /**
139 | 定时器
140 | */
141 | - (CADisplayLink *)waveDisplaylink
142 | {
143 | if (_waveDisplaylink == nil) {
144 | //启动定时器
145 | _waveDisplaylink = [CADisplayLink displayLinkWithTarget:self selector:@selector(drawWave)];
146 | [_waveDisplaylink addToRunLoop:[NSRunLoop mainRunLoop] forMode:NSRunLoopCommonModes];
147 | }
148 | return _waveDisplaylink;
149 | }
150 | /**
151 | 默认配置
152 | */
153 | - (NBWaveConfig *)config
154 | {
155 | if (_config == nil) {
156 | _config = [NBWaveConfig defaultConfig];
157 | }
158 | return _config;
159 | }
160 | - (UIImageView *)imgView
161 | {
162 | if (_imgView == nil) {
163 | _imgView = [[UIImageView alloc] init];
164 | _imgView.image = [UIImage imageNamed:@"123"];
165 | _imgView.frame = CGRectMake(100, 100, self.config.imgSize.width, self.config.imgSize.height);
166 | [self addSubview:_imgView];
167 | }
168 | return _imgView;
169 | }
170 |
171 | /**
172 | 销毁定时器
173 | */
174 | - (void)dealloc
175 | {
176 | [self stopWave];
177 | }
178 |
179 | @end
180 |
--------------------------------------------------------------------------------
/波浪/波浪.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 48;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 04712B271F973B0C00E8A9EE /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 04712B261F973B0C00E8A9EE /* AppDelegate.m */; };
11 | 04712B2A1F973B0C00E8A9EE /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 04712B291F973B0C00E8A9EE /* ViewController.m */; };
12 | 04712B2D1F973B0C00E8A9EE /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 04712B2B1F973B0C00E8A9EE /* Main.storyboard */; };
13 | 04712B2F1F973B0C00E8A9EE /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 04712B2E1F973B0C00E8A9EE /* Assets.xcassets */; };
14 | 04712B321F973B0C00E8A9EE /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 04712B301F973B0C00E8A9EE /* LaunchScreen.storyboard */; };
15 | 04712B351F973B0C00E8A9EE /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 04712B341F973B0C00E8A9EE /* main.m */; };
16 | 04712B3F1F973B0D00E8A9EE /* __Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 04712B3E1F973B0D00E8A9EE /* __Tests.m */; };
17 | 04712B4A1F973B0D00E8A9EE /* __UITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 04712B491F973B0D00E8A9EE /* __UITests.m */; };
18 | 04712B591F973B5300E8A9EE /* NBWaveView.m in Sources */ = {isa = PBXBuildFile; fileRef = 04712B581F973B5300E8A9EE /* NBWaveView.m */; };
19 | 04712B5C1F973B8C00E8A9EE /* UIView+Extension.m in Sources */ = {isa = PBXBuildFile; fileRef = 04712B5B1F973B8C00E8A9EE /* UIView+Extension.m */; };
20 | 04712B5F1F98422500E8A9EE /* NBWaveConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = 04712B5E1F98422500E8A9EE /* NBWaveConfig.m */; };
21 | /* End PBXBuildFile section */
22 |
23 | /* Begin PBXContainerItemProxy section */
24 | 04712B3B1F973B0D00E8A9EE /* PBXContainerItemProxy */ = {
25 | isa = PBXContainerItemProxy;
26 | containerPortal = 04712B1A1F973B0C00E8A9EE /* Project object */;
27 | proxyType = 1;
28 | remoteGlobalIDString = 04712B211F973B0C00E8A9EE;
29 | remoteInfo = "波浪";
30 | };
31 | 04712B461F973B0D00E8A9EE /* PBXContainerItemProxy */ = {
32 | isa = PBXContainerItemProxy;
33 | containerPortal = 04712B1A1F973B0C00E8A9EE /* Project object */;
34 | proxyType = 1;
35 | remoteGlobalIDString = 04712B211F973B0C00E8A9EE;
36 | remoteInfo = "波浪";
37 | };
38 | /* End PBXContainerItemProxy section */
39 |
40 | /* Begin PBXFileReference section */
41 | 04712B221F973B0C00E8A9EE /* 波浪.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "波浪.app"; sourceTree = BUILT_PRODUCTS_DIR; };
42 | 04712B251F973B0C00E8A9EE /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; };
43 | 04712B261F973B0C00E8A9EE /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; };
44 | 04712B281F973B0C00E8A9EE /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; };
45 | 04712B291F973B0C00E8A9EE /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; };
46 | 04712B2C1F973B0C00E8A9EE /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
47 | 04712B2E1F973B0C00E8A9EE /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
48 | 04712B311F973B0C00E8A9EE /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
49 | 04712B331F973B0C00E8A9EE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
50 | 04712B341F973B0C00E8A9EE /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
51 | 04712B3A1F973B0D00E8A9EE /* 波浪Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "波浪Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
52 | 04712B3E1F973B0D00E8A9EE /* __Tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = __Tests.m; sourceTree = ""; };
53 | 04712B401F973B0D00E8A9EE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
54 | 04712B451F973B0D00E8A9EE /* 波浪UITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "波浪UITests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
55 | 04712B491F973B0D00E8A9EE /* __UITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = __UITests.m; sourceTree = ""; };
56 | 04712B4B1F973B0D00E8A9EE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
57 | 04712B571F973B5300E8A9EE /* NBWaveView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NBWaveView.h; sourceTree = ""; };
58 | 04712B581F973B5300E8A9EE /* NBWaveView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NBWaveView.m; sourceTree = ""; };
59 | 04712B5A1F973B8C00E8A9EE /* UIView+Extension.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UIView+Extension.h"; sourceTree = ""; };
60 | 04712B5B1F973B8C00E8A9EE /* UIView+Extension.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIView+Extension.m"; sourceTree = ""; };
61 | 04712B5D1F98422500E8A9EE /* NBWaveConfig.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NBWaveConfig.h; sourceTree = ""; };
62 | 04712B5E1F98422500E8A9EE /* NBWaveConfig.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NBWaveConfig.m; sourceTree = ""; };
63 | /* End PBXFileReference section */
64 |
65 | /* Begin PBXFrameworksBuildPhase section */
66 | 04712B1F1F973B0C00E8A9EE /* Frameworks */ = {
67 | isa = PBXFrameworksBuildPhase;
68 | buildActionMask = 2147483647;
69 | files = (
70 | );
71 | runOnlyForDeploymentPostprocessing = 0;
72 | };
73 | 04712B371F973B0D00E8A9EE /* Frameworks */ = {
74 | isa = PBXFrameworksBuildPhase;
75 | buildActionMask = 2147483647;
76 | files = (
77 | );
78 | runOnlyForDeploymentPostprocessing = 0;
79 | };
80 | 04712B421F973B0D00E8A9EE /* Frameworks */ = {
81 | isa = PBXFrameworksBuildPhase;
82 | buildActionMask = 2147483647;
83 | files = (
84 | );
85 | runOnlyForDeploymentPostprocessing = 0;
86 | };
87 | /* End PBXFrameworksBuildPhase section */
88 |
89 | /* Begin PBXGroup section */
90 | 04712B191F973B0C00E8A9EE = {
91 | isa = PBXGroup;
92 | children = (
93 | 04712B241F973B0C00E8A9EE /* 波浪 */,
94 | 04712B3D1F973B0D00E8A9EE /* 波浪Tests */,
95 | 04712B481F973B0D00E8A9EE /* 波浪UITests */,
96 | 04712B231F973B0C00E8A9EE /* Products */,
97 | );
98 | sourceTree = "";
99 | };
100 | 04712B231F973B0C00E8A9EE /* Products */ = {
101 | isa = PBXGroup;
102 | children = (
103 | 04712B221F973B0C00E8A9EE /* 波浪.app */,
104 | 04712B3A1F973B0D00E8A9EE /* 波浪Tests.xctest */,
105 | 04712B451F973B0D00E8A9EE /* 波浪UITests.xctest */,
106 | );
107 | name = Products;
108 | sourceTree = "";
109 | };
110 | 04712B241F973B0C00E8A9EE /* 波浪 */ = {
111 | isa = PBXGroup;
112 | children = (
113 | 04712B5A1F973B8C00E8A9EE /* UIView+Extension.h */,
114 | 04712B5B1F973B8C00E8A9EE /* UIView+Extension.m */,
115 | 04712B251F973B0C00E8A9EE /* AppDelegate.h */,
116 | 04712B261F973B0C00E8A9EE /* AppDelegate.m */,
117 | 04712B281F973B0C00E8A9EE /* ViewController.h */,
118 | 04712B291F973B0C00E8A9EE /* ViewController.m */,
119 | 04712B2B1F973B0C00E8A9EE /* Main.storyboard */,
120 | 04712B2E1F973B0C00E8A9EE /* Assets.xcassets */,
121 | 04712B301F973B0C00E8A9EE /* LaunchScreen.storyboard */,
122 | 04712B331F973B0C00E8A9EE /* Info.plist */,
123 | 04712B341F973B0C00E8A9EE /* main.m */,
124 | 04712B571F973B5300E8A9EE /* NBWaveView.h */,
125 | 04712B581F973B5300E8A9EE /* NBWaveView.m */,
126 | 04712B5D1F98422500E8A9EE /* NBWaveConfig.h */,
127 | 04712B5E1F98422500E8A9EE /* NBWaveConfig.m */,
128 | );
129 | path = "波浪";
130 | sourceTree = "";
131 | };
132 | 04712B3D1F973B0D00E8A9EE /* 波浪Tests */ = {
133 | isa = PBXGroup;
134 | children = (
135 | 04712B3E1F973B0D00E8A9EE /* __Tests.m */,
136 | 04712B401F973B0D00E8A9EE /* Info.plist */,
137 | );
138 | path = "波浪Tests";
139 | sourceTree = "";
140 | };
141 | 04712B481F973B0D00E8A9EE /* 波浪UITests */ = {
142 | isa = PBXGroup;
143 | children = (
144 | 04712B491F973B0D00E8A9EE /* __UITests.m */,
145 | 04712B4B1F973B0D00E8A9EE /* Info.plist */,
146 | );
147 | path = "波浪UITests";
148 | sourceTree = "";
149 | };
150 | /* End PBXGroup section */
151 |
152 | /* Begin PBXNativeTarget section */
153 | 04712B211F973B0C00E8A9EE /* 波浪 */ = {
154 | isa = PBXNativeTarget;
155 | buildConfigurationList = 04712B4E1F973B0D00E8A9EE /* Build configuration list for PBXNativeTarget "波浪" */;
156 | buildPhases = (
157 | 04712B1E1F973B0C00E8A9EE /* Sources */,
158 | 04712B1F1F973B0C00E8A9EE /* Frameworks */,
159 | 04712B201F973B0C00E8A9EE /* Resources */,
160 | );
161 | buildRules = (
162 | );
163 | dependencies = (
164 | );
165 | name = "波浪";
166 | productName = "波浪";
167 | productReference = 04712B221F973B0C00E8A9EE /* 波浪.app */;
168 | productType = "com.apple.product-type.application";
169 | };
170 | 04712B391F973B0D00E8A9EE /* 波浪Tests */ = {
171 | isa = PBXNativeTarget;
172 | buildConfigurationList = 04712B511F973B0D00E8A9EE /* Build configuration list for PBXNativeTarget "波浪Tests" */;
173 | buildPhases = (
174 | 04712B361F973B0D00E8A9EE /* Sources */,
175 | 04712B371F973B0D00E8A9EE /* Frameworks */,
176 | 04712B381F973B0D00E8A9EE /* Resources */,
177 | );
178 | buildRules = (
179 | );
180 | dependencies = (
181 | 04712B3C1F973B0D00E8A9EE /* PBXTargetDependency */,
182 | );
183 | name = "波浪Tests";
184 | productName = "波浪Tests";
185 | productReference = 04712B3A1F973B0D00E8A9EE /* 波浪Tests.xctest */;
186 | productType = "com.apple.product-type.bundle.unit-test";
187 | };
188 | 04712B441F973B0D00E8A9EE /* 波浪UITests */ = {
189 | isa = PBXNativeTarget;
190 | buildConfigurationList = 04712B541F973B0D00E8A9EE /* Build configuration list for PBXNativeTarget "波浪UITests" */;
191 | buildPhases = (
192 | 04712B411F973B0D00E8A9EE /* Sources */,
193 | 04712B421F973B0D00E8A9EE /* Frameworks */,
194 | 04712B431F973B0D00E8A9EE /* Resources */,
195 | );
196 | buildRules = (
197 | );
198 | dependencies = (
199 | 04712B471F973B0D00E8A9EE /* PBXTargetDependency */,
200 | );
201 | name = "波浪UITests";
202 | productName = "波浪UITests";
203 | productReference = 04712B451F973B0D00E8A9EE /* 波浪UITests.xctest */;
204 | productType = "com.apple.product-type.bundle.ui-testing";
205 | };
206 | /* End PBXNativeTarget section */
207 |
208 | /* Begin PBXProject section */
209 | 04712B1A1F973B0C00E8A9EE /* Project object */ = {
210 | isa = PBXProject;
211 | attributes = {
212 | LastUpgradeCheck = 0900;
213 | ORGANIZATIONNAME = mac;
214 | TargetAttributes = {
215 | 04712B211F973B0C00E8A9EE = {
216 | CreatedOnToolsVersion = 9.0;
217 | ProvisioningStyle = Automatic;
218 | };
219 | 04712B391F973B0D00E8A9EE = {
220 | CreatedOnToolsVersion = 9.0;
221 | ProvisioningStyle = Automatic;
222 | TestTargetID = 04712B211F973B0C00E8A9EE;
223 | };
224 | 04712B441F973B0D00E8A9EE = {
225 | CreatedOnToolsVersion = 9.0;
226 | ProvisioningStyle = Automatic;
227 | TestTargetID = 04712B211F973B0C00E8A9EE;
228 | };
229 | };
230 | };
231 | buildConfigurationList = 04712B1D1F973B0C00E8A9EE /* Build configuration list for PBXProject "波浪" */;
232 | compatibilityVersion = "Xcode 8.0";
233 | developmentRegion = en;
234 | hasScannedForEncodings = 0;
235 | knownRegions = (
236 | en,
237 | Base,
238 | );
239 | mainGroup = 04712B191F973B0C00E8A9EE;
240 | productRefGroup = 04712B231F973B0C00E8A9EE /* Products */;
241 | projectDirPath = "";
242 | projectRoot = "";
243 | targets = (
244 | 04712B211F973B0C00E8A9EE /* 波浪 */,
245 | 04712B391F973B0D00E8A9EE /* 波浪Tests */,
246 | 04712B441F973B0D00E8A9EE /* 波浪UITests */,
247 | );
248 | };
249 | /* End PBXProject section */
250 |
251 | /* Begin PBXResourcesBuildPhase section */
252 | 04712B201F973B0C00E8A9EE /* Resources */ = {
253 | isa = PBXResourcesBuildPhase;
254 | buildActionMask = 2147483647;
255 | files = (
256 | 04712B321F973B0C00E8A9EE /* LaunchScreen.storyboard in Resources */,
257 | 04712B2F1F973B0C00E8A9EE /* Assets.xcassets in Resources */,
258 | 04712B2D1F973B0C00E8A9EE /* Main.storyboard in Resources */,
259 | );
260 | runOnlyForDeploymentPostprocessing = 0;
261 | };
262 | 04712B381F973B0D00E8A9EE /* Resources */ = {
263 | isa = PBXResourcesBuildPhase;
264 | buildActionMask = 2147483647;
265 | files = (
266 | );
267 | runOnlyForDeploymentPostprocessing = 0;
268 | };
269 | 04712B431F973B0D00E8A9EE /* Resources */ = {
270 | isa = PBXResourcesBuildPhase;
271 | buildActionMask = 2147483647;
272 | files = (
273 | );
274 | runOnlyForDeploymentPostprocessing = 0;
275 | };
276 | /* End PBXResourcesBuildPhase section */
277 |
278 | /* Begin PBXSourcesBuildPhase section */
279 | 04712B1E1F973B0C00E8A9EE /* Sources */ = {
280 | isa = PBXSourcesBuildPhase;
281 | buildActionMask = 2147483647;
282 | files = (
283 | 04712B5F1F98422500E8A9EE /* NBWaveConfig.m in Sources */,
284 | 04712B5C1F973B8C00E8A9EE /* UIView+Extension.m in Sources */,
285 | 04712B2A1F973B0C00E8A9EE /* ViewController.m in Sources */,
286 | 04712B591F973B5300E8A9EE /* NBWaveView.m in Sources */,
287 | 04712B351F973B0C00E8A9EE /* main.m in Sources */,
288 | 04712B271F973B0C00E8A9EE /* AppDelegate.m in Sources */,
289 | );
290 | runOnlyForDeploymentPostprocessing = 0;
291 | };
292 | 04712B361F973B0D00E8A9EE /* Sources */ = {
293 | isa = PBXSourcesBuildPhase;
294 | buildActionMask = 2147483647;
295 | files = (
296 | 04712B3F1F973B0D00E8A9EE /* __Tests.m in Sources */,
297 | );
298 | runOnlyForDeploymentPostprocessing = 0;
299 | };
300 | 04712B411F973B0D00E8A9EE /* Sources */ = {
301 | isa = PBXSourcesBuildPhase;
302 | buildActionMask = 2147483647;
303 | files = (
304 | 04712B4A1F973B0D00E8A9EE /* __UITests.m in Sources */,
305 | );
306 | runOnlyForDeploymentPostprocessing = 0;
307 | };
308 | /* End PBXSourcesBuildPhase section */
309 |
310 | /* Begin PBXTargetDependency section */
311 | 04712B3C1F973B0D00E8A9EE /* PBXTargetDependency */ = {
312 | isa = PBXTargetDependency;
313 | target = 04712B211F973B0C00E8A9EE /* 波浪 */;
314 | targetProxy = 04712B3B1F973B0D00E8A9EE /* PBXContainerItemProxy */;
315 | };
316 | 04712B471F973B0D00E8A9EE /* PBXTargetDependency */ = {
317 | isa = PBXTargetDependency;
318 | target = 04712B211F973B0C00E8A9EE /* 波浪 */;
319 | targetProxy = 04712B461F973B0D00E8A9EE /* PBXContainerItemProxy */;
320 | };
321 | /* End PBXTargetDependency section */
322 |
323 | /* Begin PBXVariantGroup section */
324 | 04712B2B1F973B0C00E8A9EE /* Main.storyboard */ = {
325 | isa = PBXVariantGroup;
326 | children = (
327 | 04712B2C1F973B0C00E8A9EE /* Base */,
328 | );
329 | name = Main.storyboard;
330 | sourceTree = "";
331 | };
332 | 04712B301F973B0C00E8A9EE /* LaunchScreen.storyboard */ = {
333 | isa = PBXVariantGroup;
334 | children = (
335 | 04712B311F973B0C00E8A9EE /* Base */,
336 | );
337 | name = LaunchScreen.storyboard;
338 | sourceTree = "";
339 | };
340 | /* End PBXVariantGroup section */
341 |
342 | /* Begin XCBuildConfiguration section */
343 | 04712B4C1F973B0D00E8A9EE /* Debug */ = {
344 | isa = XCBuildConfiguration;
345 | buildSettings = {
346 | ALWAYS_SEARCH_USER_PATHS = NO;
347 | CLANG_ANALYZER_NONNULL = YES;
348 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
349 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
350 | CLANG_CXX_LIBRARY = "libc++";
351 | CLANG_ENABLE_MODULES = YES;
352 | CLANG_ENABLE_OBJC_ARC = YES;
353 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
354 | CLANG_WARN_BOOL_CONVERSION = YES;
355 | CLANG_WARN_COMMA = YES;
356 | CLANG_WARN_CONSTANT_CONVERSION = YES;
357 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
358 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
359 | CLANG_WARN_EMPTY_BODY = YES;
360 | CLANG_WARN_ENUM_CONVERSION = YES;
361 | CLANG_WARN_INFINITE_RECURSION = YES;
362 | CLANG_WARN_INT_CONVERSION = YES;
363 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
364 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
365 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
366 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
367 | CLANG_WARN_STRICT_PROTOTYPES = YES;
368 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
369 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
370 | CLANG_WARN_UNREACHABLE_CODE = YES;
371 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
372 | CODE_SIGN_IDENTITY = "iPhone Developer";
373 | COPY_PHASE_STRIP = NO;
374 | DEBUG_INFORMATION_FORMAT = dwarf;
375 | ENABLE_STRICT_OBJC_MSGSEND = YES;
376 | ENABLE_TESTABILITY = YES;
377 | GCC_C_LANGUAGE_STANDARD = gnu11;
378 | GCC_DYNAMIC_NO_PIC = NO;
379 | GCC_NO_COMMON_BLOCKS = YES;
380 | GCC_OPTIMIZATION_LEVEL = 0;
381 | GCC_PREPROCESSOR_DEFINITIONS = (
382 | "DEBUG=1",
383 | "$(inherited)",
384 | );
385 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
386 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
387 | GCC_WARN_UNDECLARED_SELECTOR = YES;
388 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
389 | GCC_WARN_UNUSED_FUNCTION = YES;
390 | GCC_WARN_UNUSED_VARIABLE = YES;
391 | IPHONEOS_DEPLOYMENT_TARGET = 11.0;
392 | MTL_ENABLE_DEBUG_INFO = YES;
393 | ONLY_ACTIVE_ARCH = YES;
394 | SDKROOT = iphoneos;
395 | };
396 | name = Debug;
397 | };
398 | 04712B4D1F973B0D00E8A9EE /* Release */ = {
399 | isa = XCBuildConfiguration;
400 | buildSettings = {
401 | ALWAYS_SEARCH_USER_PATHS = NO;
402 | CLANG_ANALYZER_NONNULL = YES;
403 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
404 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
405 | CLANG_CXX_LIBRARY = "libc++";
406 | CLANG_ENABLE_MODULES = YES;
407 | CLANG_ENABLE_OBJC_ARC = YES;
408 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
409 | CLANG_WARN_BOOL_CONVERSION = YES;
410 | CLANG_WARN_COMMA = YES;
411 | CLANG_WARN_CONSTANT_CONVERSION = YES;
412 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
413 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
414 | CLANG_WARN_EMPTY_BODY = YES;
415 | CLANG_WARN_ENUM_CONVERSION = YES;
416 | CLANG_WARN_INFINITE_RECURSION = YES;
417 | CLANG_WARN_INT_CONVERSION = YES;
418 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
419 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
420 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
421 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
422 | CLANG_WARN_STRICT_PROTOTYPES = YES;
423 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
424 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
425 | CLANG_WARN_UNREACHABLE_CODE = YES;
426 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
427 | CODE_SIGN_IDENTITY = "iPhone Developer";
428 | COPY_PHASE_STRIP = NO;
429 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
430 | ENABLE_NS_ASSERTIONS = NO;
431 | ENABLE_STRICT_OBJC_MSGSEND = YES;
432 | GCC_C_LANGUAGE_STANDARD = gnu11;
433 | GCC_NO_COMMON_BLOCKS = YES;
434 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
435 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
436 | GCC_WARN_UNDECLARED_SELECTOR = YES;
437 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
438 | GCC_WARN_UNUSED_FUNCTION = YES;
439 | GCC_WARN_UNUSED_VARIABLE = YES;
440 | IPHONEOS_DEPLOYMENT_TARGET = 11.0;
441 | MTL_ENABLE_DEBUG_INFO = NO;
442 | SDKROOT = iphoneos;
443 | VALIDATE_PRODUCT = YES;
444 | };
445 | name = Release;
446 | };
447 | 04712B4F1F973B0D00E8A9EE /* Debug */ = {
448 | isa = XCBuildConfiguration;
449 | buildSettings = {
450 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
451 | CODE_SIGN_STYLE = Automatic;
452 | DEVELOPMENT_TEAM = 39LJCWKXXE;
453 | INFOPLIST_FILE = "波浪/Info.plist";
454 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
455 | PRODUCT_BUNDLE_IDENTIFIER = "c.s.t.--";
456 | PRODUCT_NAME = "$(TARGET_NAME)";
457 | TARGETED_DEVICE_FAMILY = "1,2";
458 | };
459 | name = Debug;
460 | };
461 | 04712B501F973B0D00E8A9EE /* Release */ = {
462 | isa = XCBuildConfiguration;
463 | buildSettings = {
464 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
465 | CODE_SIGN_STYLE = Automatic;
466 | DEVELOPMENT_TEAM = 39LJCWKXXE;
467 | INFOPLIST_FILE = "波浪/Info.plist";
468 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
469 | PRODUCT_BUNDLE_IDENTIFIER = "c.s.t.--";
470 | PRODUCT_NAME = "$(TARGET_NAME)";
471 | TARGETED_DEVICE_FAMILY = "1,2";
472 | };
473 | name = Release;
474 | };
475 | 04712B521F973B0D00E8A9EE /* Debug */ = {
476 | isa = XCBuildConfiguration;
477 | buildSettings = {
478 | BUNDLE_LOADER = "$(TEST_HOST)";
479 | CODE_SIGN_STYLE = Automatic;
480 | DEVELOPMENT_TEAM = 39LJCWKXXE;
481 | INFOPLIST_FILE = "波浪Tests/Info.plist";
482 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
483 | PRODUCT_BUNDLE_IDENTIFIER = "c.s.t.--Tests";
484 | PRODUCT_NAME = "$(TARGET_NAME)";
485 | TARGETED_DEVICE_FAMILY = "1,2";
486 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/波浪.app/波浪";
487 | };
488 | name = Debug;
489 | };
490 | 04712B531F973B0D00E8A9EE /* Release */ = {
491 | isa = XCBuildConfiguration;
492 | buildSettings = {
493 | BUNDLE_LOADER = "$(TEST_HOST)";
494 | CODE_SIGN_STYLE = Automatic;
495 | DEVELOPMENT_TEAM = 39LJCWKXXE;
496 | INFOPLIST_FILE = "波浪Tests/Info.plist";
497 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
498 | PRODUCT_BUNDLE_IDENTIFIER = "c.s.t.--Tests";
499 | PRODUCT_NAME = "$(TARGET_NAME)";
500 | TARGETED_DEVICE_FAMILY = "1,2";
501 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/波浪.app/波浪";
502 | };
503 | name = Release;
504 | };
505 | 04712B551F973B0D00E8A9EE /* Debug */ = {
506 | isa = XCBuildConfiguration;
507 | buildSettings = {
508 | CODE_SIGN_STYLE = Automatic;
509 | DEVELOPMENT_TEAM = 39LJCWKXXE;
510 | INFOPLIST_FILE = "波浪UITests/Info.plist";
511 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
512 | PRODUCT_BUNDLE_IDENTIFIER = "c.s.t.--UITests";
513 | PRODUCT_NAME = "$(TARGET_NAME)";
514 | TARGETED_DEVICE_FAMILY = "1,2";
515 | TEST_TARGET_NAME = "波浪";
516 | };
517 | name = Debug;
518 | };
519 | 04712B561F973B0D00E8A9EE /* Release */ = {
520 | isa = XCBuildConfiguration;
521 | buildSettings = {
522 | CODE_SIGN_STYLE = Automatic;
523 | DEVELOPMENT_TEAM = 39LJCWKXXE;
524 | INFOPLIST_FILE = "波浪UITests/Info.plist";
525 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
526 | PRODUCT_BUNDLE_IDENTIFIER = "c.s.t.--UITests";
527 | PRODUCT_NAME = "$(TARGET_NAME)";
528 | TARGETED_DEVICE_FAMILY = "1,2";
529 | TEST_TARGET_NAME = "波浪";
530 | };
531 | name = Release;
532 | };
533 | /* End XCBuildConfiguration section */
534 |
535 | /* Begin XCConfigurationList section */
536 | 04712B1D1F973B0C00E8A9EE /* Build configuration list for PBXProject "波浪" */ = {
537 | isa = XCConfigurationList;
538 | buildConfigurations = (
539 | 04712B4C1F973B0D00E8A9EE /* Debug */,
540 | 04712B4D1F973B0D00E8A9EE /* Release */,
541 | );
542 | defaultConfigurationIsVisible = 0;
543 | defaultConfigurationName = Release;
544 | };
545 | 04712B4E1F973B0D00E8A9EE /* Build configuration list for PBXNativeTarget "波浪" */ = {
546 | isa = XCConfigurationList;
547 | buildConfigurations = (
548 | 04712B4F1F973B0D00E8A9EE /* Debug */,
549 | 04712B501F973B0D00E8A9EE /* Release */,
550 | );
551 | defaultConfigurationIsVisible = 0;
552 | defaultConfigurationName = Release;
553 | };
554 | 04712B511F973B0D00E8A9EE /* Build configuration list for PBXNativeTarget "波浪Tests" */ = {
555 | isa = XCConfigurationList;
556 | buildConfigurations = (
557 | 04712B521F973B0D00E8A9EE /* Debug */,
558 | 04712B531F973B0D00E8A9EE /* Release */,
559 | );
560 | defaultConfigurationIsVisible = 0;
561 | defaultConfigurationName = Release;
562 | };
563 | 04712B541F973B0D00E8A9EE /* Build configuration list for PBXNativeTarget "波浪UITests" */ = {
564 | isa = XCConfigurationList;
565 | buildConfigurations = (
566 | 04712B551F973B0D00E8A9EE /* Debug */,
567 | 04712B561F973B0D00E8A9EE /* Release */,
568 | );
569 | defaultConfigurationIsVisible = 0;
570 | defaultConfigurationName = Release;
571 | };
572 | /* End XCConfigurationList section */
573 | };
574 | rootObject = 04712B1A1F973B0C00E8A9EE /* Project object */;
575 | }
576 |
--------------------------------------------------------------------------------