EZAudioDisplayLink
@interface EZAudioDisplayLink : NSObject
The EZAudioDisplayLink provides a cross-platform (iOS and Mac) abstraction over the CADisplayLink for iOS and CVDisplayLink for Mac. The purpose of this class is to provide an accurate timer for views that need to redraw themselves at 60 fps. This class is used by the EZAudioPlot and, eventually, the EZAudioPlotGL to provide a timer mechanism to draw real-time plots.
-
Class method to create an EZAudioDisplayLink. The caller should implement the EZAudioDisplayLinkDelegate protocol to receive the
displayLinkNeedsDisplay:
delegate method to know when to redraw itself. - parameter: delegate An instance that implements the EZAudioDisplayLinkDelegate protocol. - returns: An instance of the EZAudioDisplayLink.Declaration
Objective-C
+ (instancetype)displayLinkWithDelegate: (id<EZAudioDisplayLinkDelegate>)delegate;
Swift
convenience init!(delegate: EZAudioDisplayLinkDelegate!)
Parameters
delegate
An instance that implements the EZAudioDisplayLinkDelegate protocol.
Return Value
An instance of the EZAudioDisplayLink.
-
The EZAudioDisplayLinkDelegate for which to receive the redraw calls.
Declaration
Objective-C
@property (readwrite, nonatomic) id<EZAudioDisplayLinkDelegate> delegate;
Swift
weak var delegate: EZAudioDisplayLinkDelegate! { get set }
-
Method to start the display link and provide the
displayLinkNeedsDisplay:
calls to thedelegate
Declaration
Objective-C
- (void)start;
Swift
func start()
-
Method to stop the display link from providing the
displayLinkNeedsDisplay:
calls to thedelegate
Declaration
Objective-C
- (void)stop;
Swift
func stop()