Skip to content

Commit

Permalink
Add completeAndInvalidate to CADisplayLink
Browse files Browse the repository at this point in the history
  • Loading branch information
Reflejo committed Aug 11, 2017
1 parent 994d931 commit 3aa00e4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Source/CADisplayLink+LambdaKit.swift
Expand Up @@ -51,6 +51,12 @@ extension CADisplayLink {
}
}

/// Invalidates the current CADisplayLink but calling the handler one more time with progress = 1.0.
public func completeAndInvalidate() {
self.closureWrapper?.handler(1.0)
self.invalidate()
}

/// Creates a DisplayLink and add it to the main run loop. The displayLink will execute for the given
/// duration in seconds.
///
Expand Down

0 comments on commit 3aa00e4

Please sign in to comment.