Method: UIView#fade

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

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

Changes the layer opacity.



111
112
113
114
115
116
117
118
119
120
121
# File 'lib/sugarcube-animations/uiview.rb', line 111

def fade(options={}, &after)
  if options.is_a? Numeric
    options = { opacity: options }
  end

  options[:after] = after

  animate(options) do
    self.alpha = options[:opacity]
  end
end