Module: Motionscan::Flash

Included in:
Scanner
Defined in:
lib/motionscan/flash.rb

Instance Method Summary collapse

Instance Method Details

#flashObject



5
6
7
8
9
10
11
12
13
14
# File 'lib/motionscan/flash.rb', line 5

def flash
  flashView = UIView.alloc.initWithFrame(@view.bounds)
  flashView.backgroundColor = UIColor.whiteColor
  @view.addSubview(flashView)

  UIView.animateWithDuration(0.4,
    animations:lambda { flashView.alpha = 0.0 },
    completion:lambda { |finished| flashView.removeFromSuperview }
  )
end