Class: ScannerViewController
- Inherits:
-
UIViewController
- Object
- UIViewController
- ScannerViewController
- Defined in:
- app/scanner_view_controller.rb
Instance Method Summary collapse
Instance Method Details
#init ⇒ Object
3 4 5 6 7 8 9 10 11 12 |
# File 'app/scanner_view_controller.rb', line 3 def init super = UILabel.alloc.initWithFrame([[10,10],[300,40]]) .textAlignment = UITextAlignmentCenter .alpha = 0.8 .backgroundColor = UIColor.darkGrayColor .layer.zPosition = 2 self.view.addSubview() self end |
#viewDidAppear(animated) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'app/scanner_view_controller.rb', line 14 def viewDidAppear(animated) @scanner = Motionscan::Scanner.initWithFrame(self.view.bounds) @scanner.displayScannerInView(self.view) @scanner.startWithStatus( lambda { .text = "Will start scanning" }, success:lambda {|result| .text = "#{result.data[:type]}" }, error:lambda {|error|}, notFound:lambda {} ) end |
#viewWillDisappear(animated) ⇒ Object
29 30 31 |
# File 'app/scanner_view_controller.rb', line 29 def viewWillDisappear(animated) @scanner.stop end |