├── .gitignore ├── .travis.yml ├── LICENSE ├── README.md ├── UUWaveView ├── UUWaveView.h └── UUWaveView.m ├── UUWaveViewDemo.xcodeproj ├── project.pbxproj └── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ └── IDEWorkspaceChecks.plist ├── UUWaveViewDemo ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── Icon-60.png │ │ ├── Icon-60@2x.png │ │ ├── Icon-60@3x.png │ │ ├── Icon-Small@2x.png │ │ ├── Icon-Small@3x.png │ │ ├── Icon-Spotlight-40.png │ │ ├── Icon-Spotlight-40@2x.png │ │ └── Icon-Spotlight-40@3x.png │ └── Contents.json ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Info.plist ├── ViewController.h ├── ViewController.m └── main.m └── extra └── demo.gif /.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/**/*.png 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 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: objective-c 2 | osx_image: xcode9 3 | 4 | script: 5 | - set -o pipefail 6 | - xcodebuild clean build -project UUWaveViewDemo.xcodeproj -scheme UUWaveViewDemo -sdk iphonesimulator -configuration Debug -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 youyou 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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # UUWaveView 2 | [![Build Status](https://travis-ci.org/iceyouyou/UUWaveView.svg?branch=master)](https://travis-ci.org/iceyouyou/UUWaveView) 3 | 4 | 用于iOS,创建带有波形效果的UI控件,可自定义波形线条的数量、颜色、振幅、传播速度等各种参数。 5 | 6 | ## Demo 7 | ![UUWaveView](https://raw.githubusercontent.com/iceyouyou/UUWaveView/master/extra/demo.gif) 8 | 9 | ## 使用方法 10 | 先通过UUWave的构造方法创建波形线条: 11 | ```objective-c 12 | UUWave *wave = [[UUWave alloc] initWithStyle:UUWaveStyleSin 13 | direction:UUWaveDirectionRight 14 | amplitude:20.0f 15 | width:200.0f 16 | lineWidth:2.0f 17 | offsetX:100.0f 18 | stepX:0.6f 19 | layerCreator:^CALayer *(CAShapeLayer *waveLayer) { 20 | waveLayer.backgroundColor = [UIColor clearColor].CGColor; 21 | waveLayer.fillColor = [UIColor clearColor].CGColor; 22 | waveLayer.strokeColor = [UIColor clearColor].CGColor; 23 | return waveLayer; 24 | }]; 25 | ``` 26 | 其中各参数的说明如下: 27 | ```objective-c 28 | - (instancetype)initWithStyle:(UUWaveStyle)style // 波形类型:正弦/余弦 29 | direction:(UUWaveDirection)direction // 波形移动的方向 30 | amplitude:(CGFloat)amplitude // 波形振幅 31 | width:(CGFloat)width // 波形一个周期对应的x轴宽度 32 | lineWidth:(CGFloat)lineWidth // 波形线条宽度 33 | offsetX:(CGFloat)offsetX // 波形x轴偏移量 34 | stepX:(CGFloat)stepX // 波形移动的步进值(传播速度) 35 | layerCreator:(CALayer* (^)(CAShapeLayer *waveLayer))layerCreator; 36 | // 自定义波形Layer的回调。其中waveLayer为波形Layer,可在此处指定各种颜色效果。 37 | // 返回值CALayer将被add到UUWaveView.layer上。 38 | ``` 39 | 然后构造UUWaveView,并将UUWave加入到UUWaveView中: 40 | ```objective-c 41 | UUWaveView *waveView = [[UUWaveView alloc] initWithFrame:CGRectMake(0.0f, 45.0f, 200.0f, 55.0f)]; 42 | [waveView addWaves:@[wave]]; 43 | [self.view addSubview:waveView]; 44 | ``` 45 | 使用start方法即可开启传播动画: 46 | ```objective-c 47 | [waveView start]; 48 | ``` 49 | 示例代码请参考UUWaveViewDemo。 50 | 51 | ## Compatibility 52 | - Requires ARC. 53 | - Supports iOS7+. 54 | 55 | ## License 56 | `UUWaveView` is available under the MIT license. See the [LICENSE](LICENSE) file for more info. -------------------------------------------------------------------------------- /UUWaveView/UUWaveView.h: -------------------------------------------------------------------------------- 1 | // 2 | // UUWaveView.h 3 | // UUWaveViewDemo 4 | // 5 | // Created by youyou on 2017/5/2. 6 | // Copyright © 2017年 iceyouyou. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | // 波形效果View 12 | #pragma mark - UUWaveView 13 | @interface UUWaveView : UIView 14 | 15 | - (void)start; // 开始动画 16 | - (void)stop; // 停止动画 17 | - (void)reset; // 波形复位 18 | - (void)addWaves:(NSArray*)waves; // 添加波形线条 19 | 20 | @end 21 | 22 | #pragma mark - UUWaveStyle 23 | typedef NS_ENUM(NSInteger, UUWaveStyle) { 24 | UUWaveStyleSin, // 正弦曲线波形 25 | UUWaveStyleCos // 余弦曲线波形 26 | }; 27 | 28 | #pragma mark - UUWaveDirection 29 | typedef NS_ENUM(NSInteger, UUWaveDirection) { 30 | UUWaveDirectionLeft, // 波形左移 31 | UUWaveDirectionRight // 波形右移 32 | }; 33 | 34 | #pragma mark - UUWave 35 | @interface UUWave : NSObject 36 | 37 | @property (nonatomic, strong) CAShapeLayer *layer; // 用于绘制波形的Layer 38 | @property (nonatomic, assign) UUWaveStyle style; // 波形类型:正弦/余弦 39 | @property (nonatomic, assign) UUWaveDirection direction; // 波形移动的方向 40 | @property (nonatomic, assign) CGFloat width; // 波形一个周期对应的x轴宽度 41 | @property (nonatomic, assign) CGFloat amplitude; // 波形振幅 42 | @property (nonatomic, assign) CGFloat lineWidth; // 波形线条宽度 43 | @property (nonatomic, assign) CGFloat offsetX; // 波形x轴偏移量 44 | @property (nonatomic, assign) CGFloat stepX; // 波形移动的步进值(影响波形传播速度) 45 | @property (nonatomic, assign) CGFloat moveX; // 波形传递时的当前x轴位置 46 | 47 | - (instancetype)initWithStyle:(UUWaveStyle)style 48 | direction:(UUWaveDirection)direction 49 | amplitude:(CGFloat)amplitude 50 | width:(CGFloat)width 51 | lineWidth:(CGFloat)lineWidth 52 | offsetX:(CGFloat)offsetX 53 | stepX:(CGFloat)stepX 54 | layerCreator:(CALayer* (^)(CAShapeLayer *waveLayer))layerCreator; 55 | - (CALayer*)createLayerWithFrame:(CGRect)frame; 56 | - (void)moveOneStep; 57 | - (void)clearLayer; 58 | 59 | @end 60 | 61 | #pragma mark - UUWaveWeakProxy(Private) 62 | @interface UUWaveWeakProxy : NSObject 63 | 64 | + (instancetype)proxyWithTarget:(id)target; 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /UUWaveView/UUWaveView.m: -------------------------------------------------------------------------------- 1 | // 2 | // WaveViewEx.m 3 | // UUWaveViewDemo 4 | // 5 | // Created by youyou on 2017/5/2. 6 | // Copyright © 2017年 iceyouyou. All rights reserved. 7 | // 8 | 9 | #import "UUWaveView.h" 10 | 11 | @interface UUWaveView () 12 | 13 | @property (nonatomic, strong) NSMutableArray *waves; 14 | @property (nonatomic, assign) CGFloat maxWaveAmplitude; 15 | @property (nonatomic, strong) CADisplayLink *displayLink; 16 | @property (nonatomic, assign) BOOL doUpdate; 17 | 18 | @end 19 | 20 | @implementation UUWaveView 21 | 22 | - (instancetype)initWithFrame:(CGRect)frame { 23 | self = [super initWithFrame:frame]; 24 | if (self) { 25 | self.layer.masksToBounds = YES; 26 | } 27 | return self; 28 | } 29 | 30 | - (void)layoutSubviews { 31 | [super layoutSubviews]; 32 | 33 | if (self.layer.sublayers.count > 0) { 34 | [self.layer.sublayers enumerateObjectsUsingBlock:^(CALayer * _Nonnull layer, NSUInteger idx, BOOL * _Nonnull stop) { 35 | layer.frame = self.bounds; 36 | }]; 37 | [_waves enumerateObjectsUsingBlock:^(UUWave * _Nonnull wave, NSUInteger idx, BOOL * _Nonnull stop) { 38 | if (wave.layer) { 39 | wave.layer.frame = self.bounds; 40 | } 41 | }]; 42 | [self drawOnce]; 43 | } 44 | } 45 | 46 | - (void)dealloc { 47 | [self stop]; 48 | } 49 | 50 | - (void)clear { 51 | [_waves makeObjectsPerformSelector:@selector(clearLayer)]; 52 | [self.layer.sublayers makeObjectsPerformSelector:@selector(removeFromSuperlayer)]; 53 | } 54 | 55 | - (void)addWaves:(NSArray*)waves { 56 | if (_waves) { 57 | [_waves removeAllObjects]; 58 | [_waves addObjectsFromArray:waves]; 59 | } else { 60 | self.waves = [NSMutableArray arrayWithArray:waves]; 61 | } 62 | [self createWaveLayer]; 63 | [self drawOnce]; 64 | } 65 | 66 | - (void)createWaveLayer { 67 | [_waves enumerateObjectsUsingBlock:^(UUWave * _Nonnull wave, NSUInteger idx, BOOL * _Nonnull stop) { 68 | self.maxWaveAmplitude = MAX(wave.amplitude + wave.lineWidth, self.maxWaveAmplitude); 69 | [self.layer addSublayer:[wave createLayerWithFrame:self.bounds]]; 70 | }]; 71 | } 72 | 73 | - (void)start { 74 | if (!_displayLink) { 75 | self.displayLink = [CADisplayLink displayLinkWithTarget:[UUWaveWeakProxy proxyWithTarget:self] selector:@selector(drawWave:)]; 76 | [_displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSRunLoopCommonModes]; 77 | } 78 | } 79 | 80 | - (void)stop { 81 | [_displayLink invalidate]; 82 | _displayLink = nil; 83 | } 84 | 85 | - (void)reset { 86 | [_waves enumerateObjectsUsingBlock:^(UUWave * _Nonnull wave, NSUInteger idx, BOOL * _Nonnull stop) { 87 | if (wave.layer) { 88 | wave.moveX = 0.0f; 89 | } 90 | }]; 91 | [self drawOnce]; 92 | } 93 | 94 | - (void)drawWave:(CADisplayLink *)displayLink { 95 | self.doUpdate = !_doUpdate; 96 | if (!_doUpdate) { 97 | // 隔帧绘制(每隔一帧CPU占用降低一半,移动速度降低一半) 98 | return; 99 | } 100 | 101 | [_waves enumerateObjectsUsingBlock:^(UUWave * _Nonnull wave, NSUInteger idx, BOOL * _Nonnull stop) { 102 | if (wave.layer) { 103 | [wave moveOneStep]; 104 | wave.layer.path = [self createWavePath:wave.style 105 | direction:wave.direction 106 | amplitude:wave.amplitude 107 | width:wave.width 108 | lineWidth:wave.lineWidth 109 | offsetX:wave.offsetX 110 | moveX:wave.moveX 111 | offsetY:self.maxWaveAmplitude].CGPath; 112 | } 113 | }]; 114 | } 115 | 116 | - (void)drawOnce { 117 | [_waves enumerateObjectsUsingBlock:^(UUWave * _Nonnull wave, NSUInteger idx, BOOL * _Nonnull stop) { 118 | if (wave.layer) { 119 | wave.layer.path = [self createWavePath:wave.style 120 | direction:wave.direction 121 | amplitude:wave.amplitude 122 | width:wave.width 123 | lineWidth:wave.lineWidth 124 | offsetX:wave.offsetX 125 | moveX:wave.moveX 126 | offsetY:self.maxWaveAmplitude].CGPath; 127 | } 128 | }]; 129 | } 130 | 131 | /* 132 | * 绘制正弦或余弦曲线的UIBezierPath(因为CALayer以左上角为坐标原点,所以实际绘制出的Sin、Cos曲线都是上下翻转的) 133 | * 134 | * 正弦曲线公式: 135 | * y = Asin(ωx + φ) + k 136 | * A - 振幅,即波峰的高度 137 | * (ωx + φ) - 相位,反应变量y所处的状态 138 | * ω - 角速度,控制正弦周期(单位角度内震动的次数) 139 | * φ - 初相,x=0时的相位,反映在坐标系上则为图像的左右移动 140 | * k - 偏距,反映在坐标系上则为图像的上移或下移 141 | * 142 | * 波形左移或右移: 143 | * y=Asin(ωx+φ),先变形公式为:y=Asin(ω(x+φ/ω)) 144 | * 右移m角度:y=Asin(ω(x+φ/ω-m)) 145 | * 左移m角度:y=Asin(ω(x+φ/ω+m)) 146 | */ 147 | - (UIBezierPath *)createWavePath:(UUWaveStyle)style 148 | direction:(UUWaveDirection)direction 149 | amplitude:(CGFloat)amplitude 150 | width:(CGFloat)width 151 | lineWidth:(CGFloat)lineWidth 152 | offsetX:(CGFloat)offsetX 153 | moveX:(CGFloat)moveX 154 | offsetY:(CGFloat)offsetY { 155 | UIBezierPath *wavePath = [UIBezierPath bezierPath]; 156 | CGFloat viewWidth = CGRectGetWidth(self.bounds) + lineWidth * 0.5f; 157 | CGFloat endX = 0.0f; 158 | for (CGFloat x = 0.0f; x <= viewWidth;) { 159 | CGFloat y = 0.0f; 160 | if (style == UUWaveStyleSin) { 161 | if (direction == UUWaveDirectionLeft) { 162 | y = amplitude * sinf((2 * M_PI / width) * (x + offsetX / (2 * M_PI / width) + moveX)) + offsetY; 163 | } else { 164 | y = amplitude * sinf((2 * M_PI / width) * (x + offsetX / (2 * M_PI / width) - moveX)) + offsetY; 165 | } 166 | } else { 167 | if (direction == UUWaveDirectionLeft) { 168 | y = amplitude * cosf((2 * M_PI / width) * (x + offsetX / (2 * M_PI / width) + moveX)) + offsetY; 169 | } else { 170 | y = amplitude * cosf((2 * M_PI / width) * (x + offsetX / (2 * M_PI / width) - moveX)) + offsetY; 171 | } 172 | } 173 | 174 | if (x == 0) { 175 | [wavePath moveToPoint:CGPointMake(x, y)]; 176 | } else { 177 | [wavePath addLineToPoint:CGPointMake(x, y)]; 178 | } 179 | 180 | endX = x; 181 | 182 | if (x == viewWidth) { 183 | break; 184 | } else { 185 | x = MIN(x + 10.0f, viewWidth); // 隔点绘制,降低CPU占用 186 | } 187 | } 188 | 189 | CGFloat endY = CGRectGetHeight(self.bounds) + lineWidth * 0.5f; 190 | [wavePath addLineToPoint:CGPointMake(endX, endY)]; 191 | [wavePath addLineToPoint:CGPointMake(0.0f, endY)]; 192 | 193 | return wavePath; 194 | } 195 | 196 | @end 197 | 198 | #pragma mark - UUWave 199 | @interface UUWave () 200 | 201 | @property (nonatomic, copy) CALayer* (^layerCreator)(CAShapeLayer *waveLayer); 202 | 203 | @end 204 | 205 | @implementation UUWave 206 | 207 | - (instancetype)initWithStyle:(UUWaveStyle)style 208 | direction:(UUWaveDirection)direction 209 | amplitude:(CGFloat)amplitude 210 | width:(CGFloat)width 211 | lineWidth:(CGFloat)lineWidth 212 | offsetX:(CGFloat)offsetX 213 | stepX:(CGFloat)stepX 214 | layerCreator:(CALayer* (^)(CAShapeLayer *waveLayer))layerCreator { 215 | if (self = [super init]) { 216 | _style = style; 217 | _direction = direction; 218 | _amplitude = amplitude; 219 | _width = width; 220 | _lineWidth = lineWidth; 221 | _offsetX = offsetX; 222 | _stepX = stepX; 223 | _layerCreator = layerCreator; 224 | } 225 | return self; 226 | } 227 | 228 | - (CALayer*)createLayerWithFrame:(CGRect)frame { 229 | self.layer = [CAShapeLayer layer]; 230 | _layer.frame = frame; 231 | _layer.lineWidth = _lineWidth; 232 | 233 | if (_layerCreator) { 234 | CALayer *layer = _layerCreator(_layer); 235 | if (layer) { 236 | return layer; 237 | } 238 | } 239 | return _layer; 240 | } 241 | 242 | - (void)moveOneStep { 243 | self.moveX = ((int)(_moveX * 10.0f + _stepX * 10.0f) % (int)(_width * 10.0f)) / 10.0f; 244 | } 245 | 246 | - (void)clearLayer { 247 | [_layer removeFromSuperlayer]; 248 | _layer = nil; 249 | } 250 | 251 | @end 252 | 253 | #pragma mark - UUWaveWeakProxy(Private) 254 | @interface UUWaveWeakProxy () 255 | 256 | @property (nonatomic, weak, readonly) id target; 257 | 258 | @end 259 | 260 | @implementation UUWaveWeakProxy 261 | 262 | + (instancetype)proxyWithTarget:(id)target { 263 | return [[UUWaveWeakProxy alloc] initWithTarget:target]; 264 | } 265 | 266 | - (instancetype)initWithTarget:(id)target { 267 | _target = target; 268 | return self; 269 | } 270 | 271 | - (id)forwardingTargetForSelector:(SEL)selector { 272 | return _target; 273 | } 274 | 275 | @end 276 | -------------------------------------------------------------------------------- /UUWaveViewDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 245E567B2106FE5C00B0A5D6 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 245E567A2106FE5C00B0A5D6 /* AppDelegate.m */; }; 11 | 245E567E2106FE5C00B0A5D6 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 245E567D2106FE5C00B0A5D6 /* ViewController.m */; }; 12 | 245E56812106FE5C00B0A5D6 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 245E567F2106FE5C00B0A5D6 /* Main.storyboard */; }; 13 | 245E56832106FE5D00B0A5D6 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 245E56822106FE5D00B0A5D6 /* Assets.xcassets */; }; 14 | 245E56862106FE5D00B0A5D6 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 245E56842106FE5D00B0A5D6 /* LaunchScreen.storyboard */; }; 15 | 245E56892106FE5D00B0A5D6 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 245E56882106FE5D00B0A5D6 /* main.m */; }; 16 | 245E56922106FF9A00B0A5D6 /* UUWaveView.m in Sources */ = {isa = PBXBuildFile; fileRef = 245E56902106FF9A00B0A5D6 /* UUWaveView.m */; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXFileReference section */ 20 | 245E56762106FE5C00B0A5D6 /* UUWaveViewDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = UUWaveViewDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 21 | 245E56792106FE5C00B0A5D6 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 22 | 245E567A2106FE5C00B0A5D6 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 23 | 245E567C2106FE5C00B0A5D6 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 24 | 245E567D2106FE5C00B0A5D6 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 25 | 245E56802106FE5C00B0A5D6 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 26 | 245E56822106FE5D00B0A5D6 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 27 | 245E56852106FE5D00B0A5D6 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 28 | 245E56872106FE5D00B0A5D6 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 29 | 245E56882106FE5D00B0A5D6 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 30 | 245E56902106FF9A00B0A5D6 /* UUWaveView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UUWaveView.m; sourceTree = ""; }; 31 | 245E56912106FF9A00B0A5D6 /* UUWaveView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UUWaveView.h; sourceTree = ""; }; 32 | /* End PBXFileReference section */ 33 | 34 | /* Begin PBXFrameworksBuildPhase section */ 35 | 245E56732106FE5C00B0A5D6 /* Frameworks */ = { 36 | isa = PBXFrameworksBuildPhase; 37 | buildActionMask = 2147483647; 38 | files = ( 39 | ); 40 | runOnlyForDeploymentPostprocessing = 0; 41 | }; 42 | /* End PBXFrameworksBuildPhase section */ 43 | 44 | /* Begin PBXGroup section */ 45 | 245E566D2106FE5C00B0A5D6 = { 46 | isa = PBXGroup; 47 | children = ( 48 | 245E568F2106FF9A00B0A5D6 /* UUWaveView */, 49 | 245E56782106FE5C00B0A5D6 /* UUWaveViewDemo */, 50 | 245E56772106FE5C00B0A5D6 /* Products */, 51 | ); 52 | sourceTree = ""; 53 | }; 54 | 245E56772106FE5C00B0A5D6 /* Products */ = { 55 | isa = PBXGroup; 56 | children = ( 57 | 245E56762106FE5C00B0A5D6 /* UUWaveViewDemo.app */, 58 | ); 59 | name = Products; 60 | sourceTree = ""; 61 | }; 62 | 245E56782106FE5C00B0A5D6 /* UUWaveViewDemo */ = { 63 | isa = PBXGroup; 64 | children = ( 65 | 245E56792106FE5C00B0A5D6 /* AppDelegate.h */, 66 | 245E567A2106FE5C00B0A5D6 /* AppDelegate.m */, 67 | 245E567C2106FE5C00B0A5D6 /* ViewController.h */, 68 | 245E567D2106FE5C00B0A5D6 /* ViewController.m */, 69 | 245E567F2106FE5C00B0A5D6 /* Main.storyboard */, 70 | 245E56822106FE5D00B0A5D6 /* Assets.xcassets */, 71 | 245E56842106FE5D00B0A5D6 /* LaunchScreen.storyboard */, 72 | 245E56872106FE5D00B0A5D6 /* Info.plist */, 73 | 245E56882106FE5D00B0A5D6 /* main.m */, 74 | ); 75 | path = UUWaveViewDemo; 76 | sourceTree = ""; 77 | }; 78 | 245E568F2106FF9A00B0A5D6 /* UUWaveView */ = { 79 | isa = PBXGroup; 80 | children = ( 81 | 245E56912106FF9A00B0A5D6 /* UUWaveView.h */, 82 | 245E56902106FF9A00B0A5D6 /* UUWaveView.m */, 83 | ); 84 | path = UUWaveView; 85 | sourceTree = ""; 86 | }; 87 | /* End PBXGroup section */ 88 | 89 | /* Begin PBXNativeTarget section */ 90 | 245E56752106FE5C00B0A5D6 /* UUWaveViewDemo */ = { 91 | isa = PBXNativeTarget; 92 | buildConfigurationList = 245E568C2106FE5D00B0A5D6 /* Build configuration list for PBXNativeTarget "UUWaveViewDemo" */; 93 | buildPhases = ( 94 | 245E56722106FE5C00B0A5D6 /* Sources */, 95 | 245E56732106FE5C00B0A5D6 /* Frameworks */, 96 | 245E56742106FE5C00B0A5D6 /* Resources */, 97 | ); 98 | buildRules = ( 99 | ); 100 | dependencies = ( 101 | ); 102 | name = UUWaveViewDemo; 103 | productName = UUWaveViewDemo; 104 | productReference = 245E56762106FE5C00B0A5D6 /* UUWaveViewDemo.app */; 105 | productType = "com.apple.product-type.application"; 106 | }; 107 | /* End PBXNativeTarget section */ 108 | 109 | /* Begin PBXProject section */ 110 | 245E566E2106FE5C00B0A5D6 /* Project object */ = { 111 | isa = PBXProject; 112 | attributes = { 113 | LastUpgradeCheck = 0940; 114 | ORGANIZATIONNAME = iceyouyou; 115 | TargetAttributes = { 116 | 245E56752106FE5C00B0A5D6 = { 117 | CreatedOnToolsVersion = 9.4.1; 118 | }; 119 | }; 120 | }; 121 | buildConfigurationList = 245E56712106FE5C00B0A5D6 /* Build configuration list for PBXProject "UUWaveViewDemo" */; 122 | compatibilityVersion = "Xcode 9.3"; 123 | developmentRegion = en; 124 | hasScannedForEncodings = 0; 125 | knownRegions = ( 126 | en, 127 | Base, 128 | ); 129 | mainGroup = 245E566D2106FE5C00B0A5D6; 130 | productRefGroup = 245E56772106FE5C00B0A5D6 /* Products */; 131 | projectDirPath = ""; 132 | projectRoot = ""; 133 | targets = ( 134 | 245E56752106FE5C00B0A5D6 /* UUWaveViewDemo */, 135 | ); 136 | }; 137 | /* End PBXProject section */ 138 | 139 | /* Begin PBXResourcesBuildPhase section */ 140 | 245E56742106FE5C00B0A5D6 /* Resources */ = { 141 | isa = PBXResourcesBuildPhase; 142 | buildActionMask = 2147483647; 143 | files = ( 144 | 245E56862106FE5D00B0A5D6 /* LaunchScreen.storyboard in Resources */, 145 | 245E56832106FE5D00B0A5D6 /* Assets.xcassets in Resources */, 146 | 245E56812106FE5C00B0A5D6 /* Main.storyboard in Resources */, 147 | ); 148 | runOnlyForDeploymentPostprocessing = 0; 149 | }; 150 | /* End PBXResourcesBuildPhase section */ 151 | 152 | /* Begin PBXSourcesBuildPhase section */ 153 | 245E56722106FE5C00B0A5D6 /* Sources */ = { 154 | isa = PBXSourcesBuildPhase; 155 | buildActionMask = 2147483647; 156 | files = ( 157 | 245E567E2106FE5C00B0A5D6 /* ViewController.m in Sources */, 158 | 245E56892106FE5D00B0A5D6 /* main.m in Sources */, 159 | 245E567B2106FE5C00B0A5D6 /* AppDelegate.m in Sources */, 160 | 245E56922106FF9A00B0A5D6 /* UUWaveView.m in Sources */, 161 | ); 162 | runOnlyForDeploymentPostprocessing = 0; 163 | }; 164 | /* End PBXSourcesBuildPhase section */ 165 | 166 | /* Begin PBXVariantGroup section */ 167 | 245E567F2106FE5C00B0A5D6 /* Main.storyboard */ = { 168 | isa = PBXVariantGroup; 169 | children = ( 170 | 245E56802106FE5C00B0A5D6 /* Base */, 171 | ); 172 | name = Main.storyboard; 173 | sourceTree = ""; 174 | }; 175 | 245E56842106FE5D00B0A5D6 /* LaunchScreen.storyboard */ = { 176 | isa = PBXVariantGroup; 177 | children = ( 178 | 245E56852106FE5D00B0A5D6 /* Base */, 179 | ); 180 | name = LaunchScreen.storyboard; 181 | sourceTree = ""; 182 | }; 183 | /* End PBXVariantGroup section */ 184 | 185 | /* Begin XCBuildConfiguration section */ 186 | 245E568A2106FE5D00B0A5D6 /* Debug */ = { 187 | isa = XCBuildConfiguration; 188 | buildSettings = { 189 | ALWAYS_SEARCH_USER_PATHS = NO; 190 | CLANG_ANALYZER_NONNULL = YES; 191 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 192 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 193 | CLANG_CXX_LIBRARY = "libc++"; 194 | CLANG_ENABLE_MODULES = YES; 195 | CLANG_ENABLE_OBJC_ARC = YES; 196 | CLANG_ENABLE_OBJC_WEAK = YES; 197 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 198 | CLANG_WARN_BOOL_CONVERSION = YES; 199 | CLANG_WARN_COMMA = YES; 200 | CLANG_WARN_CONSTANT_CONVERSION = YES; 201 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 202 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 203 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 204 | CLANG_WARN_EMPTY_BODY = YES; 205 | CLANG_WARN_ENUM_CONVERSION = YES; 206 | CLANG_WARN_INFINITE_RECURSION = YES; 207 | CLANG_WARN_INT_CONVERSION = YES; 208 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 209 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 210 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 211 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 212 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 213 | CLANG_WARN_STRICT_PROTOTYPES = YES; 214 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 215 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 216 | CLANG_WARN_UNREACHABLE_CODE = YES; 217 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 218 | CODE_SIGN_IDENTITY = "iPhone Developer"; 219 | COPY_PHASE_STRIP = NO; 220 | DEBUG_INFORMATION_FORMAT = dwarf; 221 | ENABLE_STRICT_OBJC_MSGSEND = YES; 222 | ENABLE_TESTABILITY = YES; 223 | GCC_C_LANGUAGE_STANDARD = gnu11; 224 | GCC_DYNAMIC_NO_PIC = NO; 225 | GCC_NO_COMMON_BLOCKS = YES; 226 | GCC_OPTIMIZATION_LEVEL = 0; 227 | GCC_PREPROCESSOR_DEFINITIONS = ( 228 | "DEBUG=1", 229 | "$(inherited)", 230 | ); 231 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 232 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 233 | GCC_WARN_UNDECLARED_SELECTOR = YES; 234 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 235 | GCC_WARN_UNUSED_FUNCTION = YES; 236 | GCC_WARN_UNUSED_VARIABLE = YES; 237 | IPHONEOS_DEPLOYMENT_TARGET = 11.4; 238 | MTL_ENABLE_DEBUG_INFO = YES; 239 | ONLY_ACTIVE_ARCH = YES; 240 | SDKROOT = iphoneos; 241 | }; 242 | name = Debug; 243 | }; 244 | 245E568B2106FE5D00B0A5D6 /* Release */ = { 245 | isa = XCBuildConfiguration; 246 | buildSettings = { 247 | ALWAYS_SEARCH_USER_PATHS = NO; 248 | CLANG_ANALYZER_NONNULL = YES; 249 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 250 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 251 | CLANG_CXX_LIBRARY = "libc++"; 252 | CLANG_ENABLE_MODULES = YES; 253 | CLANG_ENABLE_OBJC_ARC = YES; 254 | CLANG_ENABLE_OBJC_WEAK = YES; 255 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 256 | CLANG_WARN_BOOL_CONVERSION = YES; 257 | CLANG_WARN_COMMA = YES; 258 | CLANG_WARN_CONSTANT_CONVERSION = YES; 259 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 260 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 261 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 262 | CLANG_WARN_EMPTY_BODY = YES; 263 | CLANG_WARN_ENUM_CONVERSION = YES; 264 | CLANG_WARN_INFINITE_RECURSION = YES; 265 | CLANG_WARN_INT_CONVERSION = YES; 266 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 267 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 268 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 269 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 270 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 271 | CLANG_WARN_STRICT_PROTOTYPES = YES; 272 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 273 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 274 | CLANG_WARN_UNREACHABLE_CODE = YES; 275 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 276 | CODE_SIGN_IDENTITY = "iPhone Developer"; 277 | COPY_PHASE_STRIP = NO; 278 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 279 | ENABLE_NS_ASSERTIONS = NO; 280 | ENABLE_STRICT_OBJC_MSGSEND = YES; 281 | GCC_C_LANGUAGE_STANDARD = gnu11; 282 | GCC_NO_COMMON_BLOCKS = YES; 283 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 284 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 285 | GCC_WARN_UNDECLARED_SELECTOR = YES; 286 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 287 | GCC_WARN_UNUSED_FUNCTION = YES; 288 | GCC_WARN_UNUSED_VARIABLE = YES; 289 | IPHONEOS_DEPLOYMENT_TARGET = 11.4; 290 | MTL_ENABLE_DEBUG_INFO = NO; 291 | SDKROOT = iphoneos; 292 | VALIDATE_PRODUCT = YES; 293 | }; 294 | name = Release; 295 | }; 296 | 245E568D2106FE5D00B0A5D6 /* Debug */ = { 297 | isa = XCBuildConfiguration; 298 | buildSettings = { 299 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 300 | CODE_SIGN_STYLE = Automatic; 301 | INFOPLIST_FILE = UUWaveViewDemo/Info.plist; 302 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 303 | LD_RUNPATH_SEARCH_PATHS = ( 304 | "$(inherited)", 305 | "@executable_path/Frameworks", 306 | ); 307 | PRODUCT_BUNDLE_IDENTIFIER = com.iceyouyou.UUWaveViewDemo; 308 | PRODUCT_NAME = "$(TARGET_NAME)"; 309 | TARGETED_DEVICE_FAMILY = "1,2"; 310 | }; 311 | name = Debug; 312 | }; 313 | 245E568E2106FE5D00B0A5D6 /* Release */ = { 314 | isa = XCBuildConfiguration; 315 | buildSettings = { 316 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 317 | CODE_SIGN_STYLE = Automatic; 318 | INFOPLIST_FILE = UUWaveViewDemo/Info.plist; 319 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 320 | LD_RUNPATH_SEARCH_PATHS = ( 321 | "$(inherited)", 322 | "@executable_path/Frameworks", 323 | ); 324 | PRODUCT_BUNDLE_IDENTIFIER = com.iceyouyou.UUWaveViewDemo; 325 | PRODUCT_NAME = "$(TARGET_NAME)"; 326 | TARGETED_DEVICE_FAMILY = "1,2"; 327 | }; 328 | name = Release; 329 | }; 330 | /* End XCBuildConfiguration section */ 331 | 332 | /* Begin XCConfigurationList section */ 333 | 245E56712106FE5C00B0A5D6 /* Build configuration list for PBXProject "UUWaveViewDemo" */ = { 334 | isa = XCConfigurationList; 335 | buildConfigurations = ( 336 | 245E568A2106FE5D00B0A5D6 /* Debug */, 337 | 245E568B2106FE5D00B0A5D6 /* Release */, 338 | ); 339 | defaultConfigurationIsVisible = 0; 340 | defaultConfigurationName = Release; 341 | }; 342 | 245E568C2106FE5D00B0A5D6 /* Build configuration list for PBXNativeTarget "UUWaveViewDemo" */ = { 343 | isa = XCConfigurationList; 344 | buildConfigurations = ( 345 | 245E568D2106FE5D00B0A5D6 /* Debug */, 346 | 245E568E2106FE5D00B0A5D6 /* Release */, 347 | ); 348 | defaultConfigurationIsVisible = 0; 349 | defaultConfigurationName = Release; 350 | }; 351 | /* End XCConfigurationList section */ 352 | }; 353 | rootObject = 245E566E2106FE5C00B0A5D6 /* Project object */; 354 | } 355 | -------------------------------------------------------------------------------- /UUWaveViewDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /UUWaveViewDemo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /UUWaveViewDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // UUWaveViewDemo 4 | // 5 | // Created by Ye Yang on 2018/7/24. 6 | // Copyright © 2018年 iceyouyou. 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 | -------------------------------------------------------------------------------- /UUWaveViewDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // UUWaveViewDemo 4 | // 5 | // Created by Ye Yang on 2018/7/24. 6 | // Copyright © 2018年 iceyouyou. 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 | -------------------------------------------------------------------------------- /UUWaveViewDemo/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-Spotlight-40.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-60.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-Small@2x.png", 19 | "scale" : "2x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-Small@3x.png", 25 | "scale" : "3x" 26 | }, 27 | { 28 | "size" : "40x40", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-Spotlight-40@2x.png", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-Spotlight-40@3x.png", 37 | "scale" : "3x" 38 | }, 39 | { 40 | "size" : "60x60", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-60@2x.png", 43 | "scale" : "2x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-60@3x.png", 49 | "scale" : "3x" 50 | }, 51 | { 52 | "idiom" : "ios-marketing", 53 | "size" : "1024x1024", 54 | "scale" : "1x" 55 | } 56 | ], 57 | "info" : { 58 | "version" : 1, 59 | "author" : "xcode" 60 | } 61 | } -------------------------------------------------------------------------------- /UUWaveViewDemo/Assets.xcassets/AppIcon.appiconset/Icon-60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceyouyou/UUWaveView/504b392b92f0015febf9482462a2f3feffd90da2/UUWaveViewDemo/Assets.xcassets/AppIcon.appiconset/Icon-60.png -------------------------------------------------------------------------------- /UUWaveViewDemo/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceyouyou/UUWaveView/504b392b92f0015febf9482462a2f3feffd90da2/UUWaveViewDemo/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png -------------------------------------------------------------------------------- /UUWaveViewDemo/Assets.xcassets/AppIcon.appiconset/Icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceyouyou/UUWaveView/504b392b92f0015febf9482462a2f3feffd90da2/UUWaveViewDemo/Assets.xcassets/AppIcon.appiconset/Icon-60@3x.png -------------------------------------------------------------------------------- /UUWaveViewDemo/Assets.xcassets/AppIcon.appiconset/Icon-Small@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceyouyou/UUWaveView/504b392b92f0015febf9482462a2f3feffd90da2/UUWaveViewDemo/Assets.xcassets/AppIcon.appiconset/Icon-Small@2x.png -------------------------------------------------------------------------------- /UUWaveViewDemo/Assets.xcassets/AppIcon.appiconset/Icon-Small@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceyouyou/UUWaveView/504b392b92f0015febf9482462a2f3feffd90da2/UUWaveViewDemo/Assets.xcassets/AppIcon.appiconset/Icon-Small@3x.png -------------------------------------------------------------------------------- /UUWaveViewDemo/Assets.xcassets/AppIcon.appiconset/Icon-Spotlight-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceyouyou/UUWaveView/504b392b92f0015febf9482462a2f3feffd90da2/UUWaveViewDemo/Assets.xcassets/AppIcon.appiconset/Icon-Spotlight-40.png -------------------------------------------------------------------------------- /UUWaveViewDemo/Assets.xcassets/AppIcon.appiconset/Icon-Spotlight-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceyouyou/UUWaveView/504b392b92f0015febf9482462a2f3feffd90da2/UUWaveViewDemo/Assets.xcassets/AppIcon.appiconset/Icon-Spotlight-40@2x.png -------------------------------------------------------------------------------- /UUWaveViewDemo/Assets.xcassets/AppIcon.appiconset/Icon-Spotlight-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceyouyou/UUWaveView/504b392b92f0015febf9482462a2f3feffd90da2/UUWaveViewDemo/Assets.xcassets/AppIcon.appiconset/Icon-Spotlight-40@3x.png -------------------------------------------------------------------------------- /UUWaveViewDemo/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /UUWaveViewDemo/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /UUWaveViewDemo/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 | -------------------------------------------------------------------------------- /UUWaveViewDemo/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 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /UUWaveViewDemo/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // UUWaveViewDemo 4 | // 5 | // Created by Ye Yang on 2018/7/24. 6 | // Copyright © 2018年 iceyouyou. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /UUWaveViewDemo/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // UUWaveViewDemo 4 | // 5 | // Created by Ye Yang on 2018/7/24. 6 | // Copyright © 2018年 iceyouyou. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "UUWaveView.h" 11 | 12 | @interface ViewController () 13 | 14 | @property (nonatomic, strong) UIView *firstWaveViewBg; 15 | @property (nonatomic, strong) UUWaveView *firstWaveView; 16 | 17 | @property (nonatomic, strong) UIView *secondWaveViewBg; 18 | @property (nonatomic, strong) UUWaveView *secondWaveView; 19 | 20 | @property (nonatomic, strong) UIView *thirdWaveViewBg; 21 | @property (nonatomic, strong) UUWaveView *thirdWaveView; 22 | 23 | @end 24 | 25 | @implementation ViewController 26 | 27 | - (void)viewDidLoad { 28 | [super viewDidLoad]; 29 | 30 | [self nothingImportant]; 31 | 32 | // Demo 1 33 | UUWave *firstWave1 = [[UUWave alloc] initWithStyle:UUWaveStyleSin 34 | direction:UUWaveDirectionRight 35 | amplitude:5.0f 36 | width:CGRectGetWidth(_firstWaveViewBg.bounds) * 1.5f 37 | lineWidth:2.0f 38 | offsetX:CGRectGetWidth(_firstWaveViewBg.bounds) * 1.5f * 0.5f 39 | stepX:0.6f 40 | layerCreator:^CALayer *(CAShapeLayer *waveLayer) { 41 | waveLayer.backgroundColor = [UIColor clearColor].CGColor; 42 | waveLayer.fillColor = [UIColor colorWithRed:(118.0f / 255.0f) green:(214.0f / 255.0f) blue:(255.0f / 255.0f) alpha:0.5f].CGColor; 43 | waveLayer.strokeColor = [UIColor clearColor].CGColor; 44 | return waveLayer; 45 | }]; 46 | UUWave *firstWave2 = [[UUWave alloc] initWithStyle:UUWaveStyleSin 47 | direction:UUWaveDirectionLeft 48 | amplitude:10.0f 49 | width:CGRectGetWidth(_firstWaveViewBg.bounds) * 1.5f 50 | lineWidth:2.0f 51 | offsetX:0.0f 52 | stepX:1.2f 53 | layerCreator:^CALayer *(CAShapeLayer *waveLayer) { 54 | waveLayer.backgroundColor = [UIColor clearColor].CGColor; 55 | waveLayer.fillColor = [UIColor colorWithRed:(118.0f / 255.0f) green:(214.0f / 255.0f) blue:(255.0f / 255.0f) alpha:1.0f].CGColor; 56 | waveLayer.strokeColor = [UIColor clearColor].CGColor; 57 | return waveLayer; 58 | }]; 59 | _firstWaveView = [[UUWaveView alloc] initWithFrame:CGRectMake(0.0f, 45.0f, CGRectGetWidth(_firstWaveViewBg.bounds), 55.0f)]; 60 | [_firstWaveView addWaves:@[firstWave1, firstWave2]]; 61 | [_firstWaveViewBg addSubview:_firstWaveView]; 62 | 63 | // Demo 2 64 | UUWave *secondWave1 = [[UUWave alloc] initWithStyle:UUWaveStyleSin 65 | direction:UUWaveDirectionRight 66 | amplitude:20.0f 67 | width:CGRectGetWidth(_secondWaveViewBg.bounds) 68 | lineWidth:1.0f 69 | offsetX:0.0f 70 | stepX:1.2f 71 | layerCreator:^CALayer *(CAShapeLayer *waveLayer) { 72 | waveLayer.backgroundColor = [UIColor clearColor].CGColor; 73 | waveLayer.fillColor = [UIColor clearColor].CGColor; 74 | waveLayer.strokeColor = [UIColor whiteColor].CGColor; 75 | return waveLayer; 76 | }]; 77 | UUWave *secondWave2 = [[UUWave alloc] initWithStyle:UUWaveStyleCos 78 | direction:UUWaveDirectionLeft 79 | amplitude:20.0f 80 | width:CGRectGetWidth(_secondWaveViewBg.bounds) 81 | lineWidth:1.0f 82 | offsetX:0.0f 83 | stepX:1.2f 84 | layerCreator:^CALayer *(CAShapeLayer *waveLayer) { 85 | waveLayer.backgroundColor = [UIColor clearColor].CGColor; 86 | waveLayer.fillColor = [UIColor clearColor].CGColor; 87 | waveLayer.strokeColor = [UIColor whiteColor].CGColor; 88 | return waveLayer; 89 | }]; 90 | _secondWaveView = [[UUWaveView alloc] initWithFrame:CGRectMake(0.0f, 35.0f, CGRectGetWidth(_secondWaveViewBg.bounds), 65.0f)]; 91 | [_secondWaveView addWaves:@[secondWave1, secondWave2]]; 92 | [_secondWaveViewBg addSubview:_secondWaveView]; 93 | 94 | // Demo 3 95 | UUWave *thirdWave1 = [[UUWave alloc] initWithStyle:UUWaveStyleCos 96 | direction:UUWaveDirectionLeft 97 | amplitude:16.0f 98 | width:CGRectGetWidth(_thirdWaveViewBg.bounds) 99 | lineWidth:1.0f 100 | offsetX:CGRectGetWidth(_thirdWaveViewBg.bounds) * 0.5f 101 | stepX:1.2f 102 | layerCreator:^CALayer *(CAShapeLayer *waveLayer) { 103 | waveLayer.backgroundColor = [UIColor clearColor].CGColor; 104 | waveLayer.fillColor = [UIColor whiteColor].CGColor; 105 | 106 | CAGradientLayer *gradientLayer = [CAGradientLayer layer]; 107 | gradientLayer.frame = waveLayer.bounds; 108 | [gradientLayer setColors:@[(id)[[UIColor whiteColor] colorWithAlphaComponent:0.15f].CGColor, 109 | (id)[[UIColor whiteColor] colorWithAlphaComponent:0.15f].CGColor, 110 | (id)[[UIColor whiteColor] colorWithAlphaComponent:0.15f].CGColor]]; 111 | [gradientLayer setLocations:@[@0.1, @0.6, @1.0]]; 112 | [gradientLayer setStartPoint:CGPointMake(0.5f, 1.0f)]; 113 | [gradientLayer setEndPoint:CGPointMake(0.5f, 0.0f)]; 114 | [gradientLayer setMask:waveLayer]; 115 | 116 | return gradientLayer; 117 | }]; 118 | UUWave *thirdWave2 = [[UUWave alloc] initWithStyle:UUWaveStyleSin 119 | direction:UUWaveDirectionRight 120 | amplitude:16.0f 121 | width:CGRectGetWidth(_thirdWaveViewBg.bounds) 122 | lineWidth:1.0f 123 | offsetX:CGRectGetWidth(_thirdWaveViewBg.bounds) * 0.25f 124 | stepX:0.8f 125 | layerCreator:^CALayer *(CAShapeLayer *waveLayer) { 126 | waveLayer.backgroundColor = [UIColor clearColor].CGColor; 127 | waveLayer.fillColor = [UIColor whiteColor].CGColor; 128 | 129 | CAGradientLayer *gradientLayer = [CAGradientLayer layer]; 130 | gradientLayer.frame = waveLayer.bounds; 131 | [gradientLayer setColors:@[(id)[[UIColor whiteColor] colorWithAlphaComponent:0.15f].CGColor, 132 | (id)[[UIColor whiteColor] colorWithAlphaComponent:0.15f].CGColor, 133 | (id)[[UIColor whiteColor] colorWithAlphaComponent:0.15f].CGColor]]; 134 | [gradientLayer setLocations:@[@0.1, @0.6, @1.0]]; 135 | [gradientLayer setStartPoint:CGPointMake(0.5f, 1.0f)]; 136 | [gradientLayer setEndPoint:CGPointMake(0.5f, 0.0f)]; 137 | [gradientLayer setMask:waveLayer]; 138 | 139 | return gradientLayer; 140 | }]; 141 | UUWave *thirdWave3 = [[UUWave alloc] initWithStyle:UUWaveStyleCos 142 | direction:UUWaveDirectionLeft 143 | amplitude:16.0f 144 | width:CGRectGetWidth(_thirdWaveViewBg.bounds) 145 | lineWidth:1.0f 146 | offsetX:CGRectGetWidth(_thirdWaveViewBg.bounds) 147 | stepX:0.4f 148 | layerCreator:^CALayer *(CAShapeLayer *waveLayer) { 149 | waveLayer.backgroundColor = [UIColor clearColor].CGColor; 150 | waveLayer.fillColor = [UIColor whiteColor].CGColor; 151 | 152 | CAGradientLayer *gradientLayer = [CAGradientLayer layer]; 153 | gradientLayer.frame = waveLayer.bounds; 154 | [gradientLayer setColors:@[(id)[[UIColor whiteColor] colorWithAlphaComponent:0.15f].CGColor, 155 | (id)[[UIColor whiteColor] colorWithAlphaComponent:0.15f].CGColor, 156 | (id)[[UIColor whiteColor] colorWithAlphaComponent:0.15f].CGColor]]; 157 | [gradientLayer setLocations:@[@0.1, @0.6, @1.0]]; 158 | [gradientLayer setStartPoint:CGPointMake(0.5f, 1.0f)]; 159 | [gradientLayer setEndPoint:CGPointMake(0.5f, 0.0f)]; 160 | [gradientLayer setMask:waveLayer]; 161 | 162 | return gradientLayer; 163 | }]; 164 | _thirdWaveView = [[UUWaveView alloc] initWithFrame:CGRectMake(0.0f, 35.0f, CGRectGetWidth(_thirdWaveViewBg.bounds), 65.0f)]; 165 | [_thirdWaveView addWaves:@[thirdWave1, thirdWave2, thirdWave3]]; 166 | [_thirdWaveViewBg addSubview:_thirdWaveView]; 167 | } 168 | 169 | - (void)nothingImportant { 170 | CGFloat screenWidth = [UIScreen mainScreen].bounds.size.width; 171 | 172 | UILabel *title = [[UILabel alloc] initWithFrame:CGRectMake(20.0f, 40.0f, screenWidth - 40.0f, 20.0f)]; 173 | title.textAlignment = NSTextAlignmentCenter; 174 | title.text = @"UUWaveView Demo"; 175 | title.font = [UIFont systemFontOfSize:14.0f]; 176 | [self.view addSubview:title]; 177 | 178 | // first WaveView 179 | UILabel *firstWaveViewTitle = [[UILabel alloc] initWithFrame:CGRectMake(20.0f, 80.0f, screenWidth - 40.0f, 20.0f)]; 180 | firstWaveViewTitle.text = @"Demo 1"; 181 | firstWaveViewTitle.font = [UIFont systemFontOfSize:12.0f]; 182 | [self.view addSubview:firstWaveViewTitle]; 183 | 184 | _firstWaveViewBg = [[UIView alloc] initWithFrame:CGRectMake(0.0f, 105.0f, screenWidth, 100.0f)]; 185 | [self.view addSubview:_firstWaveViewBg]; 186 | 187 | UIView *firstLine = [[UIView alloc] initWithFrame:CGRectMake(0.0f, 205.0f, screenWidth, 1.0f)]; 188 | firstLine.backgroundColor = [UIColor blackColor]; 189 | [self.view addSubview:firstLine]; 190 | 191 | // second WaveView 192 | UILabel *secondWaveViewTitle = [[UILabel alloc] initWithFrame:CGRectMake(20.0f, 225.0f, screenWidth - 40.0f, 20.0f)]; 193 | secondWaveViewTitle.text = @"Demo 2"; 194 | secondWaveViewTitle.font = [UIFont systemFontOfSize:12.0f]; 195 | [self.view addSubview:secondWaveViewTitle]; 196 | 197 | _secondWaveViewBg = [[UIView alloc] initWithFrame:CGRectMake(0.0f, 250.0f, screenWidth, 100.0f)]; 198 | [self.view addSubview:_secondWaveViewBg]; 199 | 200 | CAGradientLayer *secondWaveViewBgGradientLayer = [[CAGradientLayer alloc] init]; 201 | secondWaveViewBgGradientLayer.frame = _secondWaveViewBg.bounds; 202 | secondWaveViewBgGradientLayer.startPoint = CGPointMake(1.0f, 0.5f); 203 | secondWaveViewBgGradientLayer.endPoint = CGPointMake(0.0f, 0.5f); 204 | secondWaveViewBgGradientLayer.colors = @[(__bridge id)[UIColor colorWithRed:(255.0f / 255.0f) green:(127.0f / 255.0f) blue:(115.0f / 255.0f) alpha:1.0f].CGColor, 205 | (__bridge id)[UIColor colorWithRed:(255.0f / 255.0f) green:(76.0f / 255.0f) blue:(59.0f / 255.0f) alpha:1.0f].CGColor]; 206 | [_secondWaveViewBg.layer addSublayer:secondWaveViewBgGradientLayer]; 207 | 208 | // third WaveView 209 | UILabel *thirdWaveViewTitle = [[UILabel alloc] initWithFrame:CGRectMake(20.0f, 370.0f, screenWidth - 40.0f, 20.0f)]; 210 | thirdWaveViewTitle.text = @"Demo 3"; 211 | thirdWaveViewTitle.font = [UIFont systemFontOfSize:12.0f]; 212 | [self.view addSubview:thirdWaveViewTitle]; 213 | 214 | _thirdWaveViewBg = [[UIView alloc] initWithFrame:CGRectMake(0.0f, 395.0f, screenWidth, 100.0f)]; 215 | [self.view addSubview:_thirdWaveViewBg]; 216 | 217 | CAGradientLayer *thirdWaveViewBgGradientLayer = [CAGradientLayer layer]; 218 | thirdWaveViewBgGradientLayer.frame = _thirdWaveViewBg.bounds; 219 | [thirdWaveViewBgGradientLayer setColors:@[(id)[UIColor colorWithRed:(80.0f / 255.0f) green:(140.0f / 255.0f) blue:(238.0f / 255.0f) alpha:1.0f].CGColor, 220 | (id)[UIColor colorWithRed:(0.0f / 255.0f) green:(211.0f / 255.0f) blue:(151.0f / 255.0f) alpha:1.0f].CGColor]]; 221 | [thirdWaveViewBgGradientLayer setStartPoint:CGPointMake(0.0f, 0.5f)]; 222 | [thirdWaveViewBgGradientLayer setEndPoint:CGPointMake(1.0f, 0.5f)]; 223 | [_thirdWaveViewBg.layer addSublayer:thirdWaveViewBgGradientLayer]; 224 | 225 | // start button 226 | UIButton *startBtn = [[UIButton alloc] initWithFrame:CGRectMake(20.0f, 515.0f, 50.0f, 20.0f)]; 227 | startBtn.titleLabel.font = [UIFont systemFontOfSize:10.0f]; 228 | [startBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; 229 | [startBtn setTitle:@"Start" forState:UIControlStateNormal]; 230 | startBtn.layer.cornerRadius = 4.0f; 231 | startBtn.layer.borderWidth = 1.0f; 232 | [self.view addSubview:startBtn]; 233 | [startBtn addTarget:self action:@selector(handleStartAction:) forControlEvents:UIControlEventTouchUpInside]; 234 | 235 | // stop button 236 | UIButton *stopBtn = [[UIButton alloc] initWithFrame:CGRectMake(80.0f, 515.0f, 50.0f, 20.0f)]; 237 | stopBtn.titleLabel.font = [UIFont systemFontOfSize:10.0f]; 238 | [stopBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; 239 | [stopBtn setTitle:@"Stop" forState:UIControlStateNormal]; 240 | stopBtn.layer.cornerRadius = 4.0f; 241 | stopBtn.layer.borderWidth = 1.0f; 242 | [self.view addSubview:stopBtn]; 243 | [stopBtn addTarget:self action:@selector(handleStopAction:) forControlEvents:UIControlEventTouchUpInside]; 244 | 245 | // reset button 246 | UIButton *resetBtn = [[UIButton alloc] initWithFrame:CGRectMake(140.0f, 515.0f, 50.0f, 20.0f)]; 247 | resetBtn.titleLabel.font = [UIFont systemFontOfSize:10.0f]; 248 | [resetBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; 249 | [resetBtn setTitle:@"Reset" forState:UIControlStateNormal]; 250 | resetBtn.layer.cornerRadius = 4.0f; 251 | resetBtn.layer.borderWidth = 1.0f; 252 | [self.view addSubview:resetBtn]; 253 | [resetBtn addTarget:self action:@selector(handleResetAction:) forControlEvents:UIControlEventTouchUpInside]; 254 | } 255 | 256 | - (void)handleStartAction:(id)sender { 257 | [_firstWaveView start]; 258 | [_secondWaveView start]; 259 | [_thirdWaveView start]; 260 | } 261 | 262 | - (void)handleStopAction:(id)sender { 263 | [_firstWaveView stop]; 264 | [_secondWaveView stop]; 265 | [_thirdWaveView stop]; 266 | } 267 | 268 | - (void)handleResetAction:(id)sender { 269 | [_firstWaveView reset]; 270 | [_secondWaveView reset]; 271 | [_thirdWaveView reset]; 272 | } 273 | 274 | @end 275 | -------------------------------------------------------------------------------- /UUWaveViewDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // UUWaveViewDemo 4 | // 5 | // Created by Ye Yang on 2018/7/24. 6 | // Copyright © 2018年 iceyouyou. 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 | -------------------------------------------------------------------------------- /extra/demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceyouyou/UUWaveView/504b392b92f0015febf9482462a2f3feffd90da2/extra/demo.gif --------------------------------------------------------------------------------