diff --git a/BCScanner.podspec b/BCScanner.podspec new file mode 100644 index 0000000..ec7f5f0 --- /dev/null +++ b/BCScanner.podspec @@ -0,0 +1,13 @@ +Pod::Spec.new do |s| + s.name = "BCScanner" + s.version = "0.0.1" + s.summary = "A barcode and qr code scanner that wraps the iOS7 scanning capabilities in a UIViewController" + s.homepage = "https://github.com/michaelochs/BCScanner" + s.license = { :type => 'Apache License, Version 2.0', :file => 'LICENSE' } + s.author = 'Michael Ochs' + s.platform = :ios, '7.0' + s.source = { :git => "https://github.com/michaelochs/BCScanner.git", :commit => "ae445da822b3058fe57f8c262ef8596326f31929" } + s.source_files = 'BCScanner', 'BCScanner/**/*.{h,m}' + s.framework = 'AVFoundation' + s.requires_arc = true +end diff --git a/BCScanner/BCScannerViewController.m b/BCScanner/BCScannerViewController.m index 300dc50..2c68a1d 100644 --- a/BCScanner/BCScannerViewController.m +++ b/BCScanner/BCScannerViewController.m @@ -209,13 +209,16 @@ - (void)viewDidLoad self.previewView.session = self.session; - UIImage *hudImage = [self.delegate scannerHUDImage:self]; - if (hudImage) { - UIImageView *hudImageView = [[UIImageView alloc] initWithImage:hudImage]; - hudImageView.contentMode = UIViewContentModeScaleToFill; - [self.previewView addSubview:hudImageView]; - _hudImageView = hudImageView; - } + if ([self.delegate respondsToSelector:@selector(scannerHUDImage:)]) + { + UIImage *hudImage = [self.delegate scannerHUDImage:self]; + if (hudImage) { + UIImageView *hudImageView = [[UIImageView alloc] initWithImage:hudImage]; + hudImageView.contentMode = UIViewContentModeScaleToFill; + [self.previewView addSubview:hudImageView]; + _hudImageView = hudImageView; + } + } UITapGestureRecognizer *tapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(focusAndExpose:)]; [self.previewView addGestureRecognizer:tapRecognizer];