Sha256: 8eb20cf88f04548af14e9b14c2e67b72d06e1f0f04ad5cbae2e6993badd7714b
Contents?: true
Size: 556 Bytes
Versions: 34
Compression:
Stored size: 556 Bytes
Contents
class MPSpinner < MBRoundProgressView def init_animation return if @firstTimestamp displayLink = CADisplayLink.displayLinkWithTarget(self, selector: :"handleDisplayLink:") displayLink.addToRunLoop(NSRunLoop.currentRunLoop, forMode: NSDefaultRunLoopMode) end def handleDisplayLink(displayLink) @firstTimestamp ||= displayLink.timestamp elapsed = (displayLink.timestamp - @firstTimestamp) rotate(elapsed) end def rotate(angle) self.layer.transform = CATransform3DMakeRotation((Math::PI * 2) * angle, 0, 0, 1) end end
Version data entries
34 entries across 34 versions & 1 rubygems