Method: UIView#rotate_to

Defined in:
lib/sugarcube-animations/uiview.rb

#rotate_to(options = {}, more_options = {}, &after) ⇒ Object

Changes the current rotation to new_angle (rotate rotates relative to the current rotation)



216
217
218
219
220
221
222
223
224
225
226
227
228
229
# File 'lib/sugarcube-animations/uiview.rb', line 216

def rotate_to(options={}, more_options={}, &after)
  if options.is_a? Numeric
    new_angle = options
    options = more_options
  else
    new_angle = options[:angle]
  end

  options[:after] = after

  animate(options) do
    self.transform = CGAffineTransformMakeRotation(new_angle)
  end
end