Module: Spinner

Defined in:
lib/motion_spinner.rb,
lib/motion_spinner/spinner.rb

Class Method Summary collapse

Class Method Details

.start(view) ⇒ Object



2
3
4
5
6
7
8
# File 'lib/motion_spinner/spinner.rb', line 2

def self.start(view)
  @spinner = UIActivityIndicatorView.alloc.initWithActivityIndicatorStyle(UIActivityIndicatorViewStyleWhiteLarge)
  @spinner.setCenter(CGPointMake(UIScreen.mainScreen.bounds.size.width/2.0, UIScreen.mainScreen.bounds.size.height/2.0))
  view.addSubview(@spinner)
  @spinner.startAnimating
  @spinner
end

.stop(spinner) ⇒ Object



10
11
12
13
# File 'lib/motion_spinner/spinner.rb', line 10

def self.stop(spinner)
  spinner.stopAnimating
  spinner.removeFromSuperview
end