iOS實現類Siri曲線:Waver
Waver 是類似 Siri 的波紋曲線。
Requirements
Waver works on iOS 7.0 and later version and is compatible with ARC projects. It depends on the following Apple frameworks, which should already be included with most Xcode templates:
- Foundation.framework
- UIKit.framework
- CoreGraphics.framework
- QuartzCore.framework </ul>
- Add a pod entry for Waver to your Podfilepod 'Waver', '~> 0.2.0'
- Install the pod(s) by runningpod install.
- Include Waver wherever you need it with#import "Waver.h". </ol>
You will need LLVM 3.0 or later in order to build Waver.
Usage
Cocoapods
CocoaPods is the recommended way to add Waver to your project.
Or Copy the Waver folder to your project
Example
Waver * waver = [[Waver alloc] initWithFrame:CGRectMake(0, CGRectGetHeight(self.view.bounds)/2.0 - 50.0, CGRectGetWidth(self.view.bounds), 100.0)];__weak Waver * weakWaver = waver; waver.waverLevelCallback = ^() {
[self.recorder updateMeters]; CGFloat normalizedValue = pow (10, [self.recorder averagePowerForChannel:0] / 50); weakWaver.level = normalizedValue;
}; [self.view addSubview:waver];</pre>
本文由用戶 dc4g 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!