File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 1
1
Pod ::Spec . new do |s |
2
2
s . name = 'LambdaKit'
3
- s . version = '0.0.4 '
3
+ s . version = '0.1.0 '
4
4
s . license = 'MIT'
5
5
s . summary = 'Closures on most used UIKit methods'
6
6
s . homepage = 'https://github.com/Reflejo/LambdaKit'
Original file line number Diff line number Diff line change @@ -56,17 +56,20 @@ extension CADisplayLink {
56
56
///
57
57
/// - parameter duration: The duration in seconds.
58
58
/// - parameter handler: The closure to execute for every tick.
59
- public class func runFor( _ duration: CFTimeInterval , handler: @escaping LKDisplayLinkClosure ) {
59
+ public static func runFor( _ duration: CFTimeInterval ,
60
+ handler: @escaping LKDisplayLinkClosure ) -> CADisplayLink
61
+ {
60
62
let displayLink = CADisplayLink ( target: self , selector: #selector( CADisplayLink . tick ( _: ) ) )
61
63
62
64
displayLink. closureWrapper = ClosuresWrapper ( handler: handler, duration: duration)
63
65
displayLink. add ( to: RunLoop . main, forMode: RunLoopMode . defaultRunLoopMode)
66
+ return displayLink
64
67
}
65
68
66
69
// MARK: Private methods
67
70
68
71
@objc
69
- private class func tick( _ displayLink: CADisplayLink ) {
72
+ private static func tick( _ displayLink: CADisplayLink ) {
70
73
guard let closureWrapper = displayLink. closureWrapper else {
71
74
return
72
75
}
You can’t perform that action at this time.
0 commit comments