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

Version Path
motion-prime-1.0.7 motion-prime/support/mp_spinner.rb
motion-prime-1.0.6 motion-prime/support/mp_spinner.rb
motion-prime-1.0.5 motion-prime/support/mp_spinner.rb
motion-prime-1.0.4 motion-prime/support/mp_spinner.rb
motion-prime-1.0.3 motion-prime/support/mp_spinner.rb
motion-prime-1.0.2 motion-prime/support/mp_spinner.rb
motion-prime-1.0.1 motion-prime/support/mp_spinner.rb
motion-prime-1.0.0 motion-prime/support/mp_spinner.rb
motion-prime-0.9.9.2 motion-prime/support/mp_spinner.rb
motion-prime-0.9.9.1 motion-prime/support/mp_spinner.rb
motion-prime-0.9.9 motion-prime/support/mp_spinner.rb
motion-prime-0.9.8 motion-prime/support/mp_spinner.rb
motion-prime-0.9.7 motion-prime/support/mp_spinner.rb
motion-prime-0.9.6 motion-prime/support/mp_spinner.rb
motion-prime-0.9.5 motion-prime/support/mp_spinner.rb
motion-prime-0.9.4 motion-prime/support/mp_spinner.rb
motion-prime-0.9.3 motion-prime/support/mp_spinner.rb
motion-prime-0.9.2 motion-prime/support/mp_spinner.rb
motion-prime-0.9.1 motion-prime/support/mp_spinner.rb
motion-prime-0.9.0 motion-prime/support/mp_spinner.rb