Draw a waveform diagram
Effect
Source
Https://github.com/YouXianMing/Animations
////DRAWWAVEVIEWCONTROLLER.M//Animations////Created by youxianming on 15/12/5.//copyright©2015 year youxianming. All rights reserved.//#import "DrawWaveViewController.h"#import "WxHxD.h"#import "DrawView.h"#import "DrawLineView.h"#import "uiview+setrect.h"@interfaceDrawwaveviewcontroller () @property (nonatomic, strong) Drawview*Drawview, @property (nonatomic, strong) Drawlineview*Drawlineview, @property (nonatomic, strong) Cadisplaylink*DisplayLink;@end@implementationDrawwaveviewcontroller- (void) viewdidload {[Super viewdidload];}- (void) Setup {[Super Setup]; Self.drawview= [[Drawview alloc] Initwithframe:cgrectmake (0,0, Width, $)]; Self.drawView.center=Self.view.center; Self.drawview.y+= -; [Self.view AddSubview:self.drawView]; Self.drawlineview= [[Drawlineview alloc] Initwithframe:cgrectmake (0,0, Width, $)]; Self.drawLineView.center=Self.view.center; Self.drawlineview.y-= -; [Self.view AddSubview:self.drawLineView]; Self.displaylink=[Cadisplaylink displaylinkwithtarget:self selector: @selector (drawevent)]; [Self.displaylink Addtorunloop:[nsrunloop Currentrunloop] formode:nsdefaultrunloopmode]; [Self Bringtitleviewtofront];}- (void) drawevent {[Self.drawview setneedsdisplay]; [Self.drawlineview Setneedsdisplay];}@end
Details
Draw a waveform diagram