├── .swift-version
├── Screenshot.png
├── ROBarcodeScanner.xcodeproj
├── xcuserdata
│ └── prine.xcuserdatad
│ │ ├── xcdebugger
│ │ └── Breakpoints_v2.xcbkptlist
│ │ └── xcschemes
│ │ ├── xcschememanagement.plist
│ │ └── ROBarcodeScanner.xcscheme
├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ ├── IDEWorkspaceChecks.plist
│ │ └── ROBarcodeScanner.xccheckout
└── project.pbxproj
├── ROBarcodeScannerTests
├── Info.plist
└── ROBarcodeScannerTests.swift
├── ROBarcodeScanner.podspec
├── LICENSE
├── ROBarcodeScanner
├── Images.xcassets
│ └── AppIcon.appiconset
│ │ └── Contents.json
├── ViewController.swift
├── Info.plist
└── AppDelegate.swift
├── .gitignore
├── README.md
└── Source
├── ROBarcodeScannerViewController.swift
└── ROBarcodeScanner.storyboard
/.swift-version:
--------------------------------------------------------------------------------
1 | 3.0
2 |
--------------------------------------------------------------------------------
/Screenshot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/prine/ROBarcodeScanner/HEAD/Screenshot.png
--------------------------------------------------------------------------------
/ROBarcodeScanner.xcodeproj/xcuserdata/prine.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
--------------------------------------------------------------------------------
/ROBarcodeScanner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ROBarcodeScanner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ROBarcodeScanner.xcodeproj/xcuserdata/prine.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | ROBarcodeScanner.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | CBD0622B1B6233ED002A5F18
16 |
17 | primary
18 |
19 |
20 | CBD062401B6233ED002A5F18
21 |
22 | primary
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/ROBarcodeScannerTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 |
24 |
25 |
--------------------------------------------------------------------------------
/ROBarcodeScanner.podspec:
--------------------------------------------------------------------------------
1 | #
2 | # Be sure to run `pod lib lint ROStorageBar.podspec' to ensure this is a
3 | # valid spec and remove all comments before submitting the spec.
4 | #
5 | # Any lines starting with a # are optional, but encouraged
6 | #
7 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
8 | #
9 |
10 |
11 | Pod::Spec.new do |spec|
12 | spec.name = 'ROBarcodeScanner'
13 | spec.version = '2.2.2'
14 | spec.license = { :type => 'MIT' }
15 | spec.homepage = 'https://github.com/prine/ROBarcodeScanner'
16 | spec.authors = { 'Robin Oster' => 'robin.oster@rascor.com' }
17 | spec.summary = 'Scans different Barcodes and returns the result as String'
18 | spec.source = { :git => 'https://github.com/prine/ROBarcodeScanner.git', :tag => "2.2.2" }
19 | spec.source_files = 'Source/*.swift'
20 | spec.framework = 'SystemConfiguration'
21 | spec.ios.framework = 'UIKit'
22 | spec.ios.deployment_target = '10.2'
23 | spec.resources = ['Source/*.Storyboard']
24 | end
25 |
--------------------------------------------------------------------------------
/ROBarcodeScannerTests/ROBarcodeScannerTests.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ROBarcodeScannerTests.swift
3 | // ROBarcodeScannerTests
4 | //
5 | // Created by Robin Oster on 24/07/15.
6 | // Copyright (c) 2015 RASCOR International AG. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import XCTest
11 |
12 | class ROBarcodeScannerTests: XCTestCase {
13 |
14 | override func setUp() {
15 | super.setUp()
16 | // Put setup code here. This method is called before the invocation of each test method in the class.
17 | }
18 |
19 | override func tearDown() {
20 | // Put teardown code here. This method is called after the invocation of each test method in the class.
21 | super.tearDown()
22 | }
23 |
24 | func testExample() {
25 | // This is an example of a functional test case.
26 | XCTAssert(true, "Pass")
27 | }
28 |
29 | func testPerformanceExample() {
30 | // This is an example of a performance test case.
31 | self.measure() {
32 | // Put the code you want to measure the time of here.
33 | }
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2019 Robin Oster
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
20 |
--------------------------------------------------------------------------------
/ROBarcodeScanner/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "29x29",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "29x29",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "40x40",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "40x40",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "60x60",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "60x60",
31 | "scale" : "3x"
32 | },
33 | {
34 | "idiom" : "ipad",
35 | "size" : "29x29",
36 | "scale" : "1x"
37 | },
38 | {
39 | "idiom" : "ipad",
40 | "size" : "29x29",
41 | "scale" : "2x"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "size" : "40x40",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "ipad",
50 | "size" : "40x40",
51 | "scale" : "2x"
52 | },
53 | {
54 | "idiom" : "ipad",
55 | "size" : "76x76",
56 | "scale" : "1x"
57 | },
58 | {
59 | "idiom" : "ipad",
60 | "size" : "76x76",
61 | "scale" : "2x"
62 | },
63 | {
64 | "idiom" : "ipad",
65 | "size" : "83.5x83.5",
66 | "scale" : "2x"
67 | }
68 | ],
69 | "info" : {
70 | "version" : 1,
71 | "author" : "xcode"
72 | }
73 | }
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Xcode
2 | #
3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
4 |
5 | ## Build generated
6 | build/
7 | DerivedData/
8 |
9 | ## Various settings
10 | *.pbxuser
11 | !default.pbxuser
12 | *.mode1v3
13 | !default.mode1v3
14 | *.mode2v3
15 | !default.mode2v3
16 | *.perspectivev3
17 | !default.perspectivev3
18 | xcuserdata/
19 |
20 | ## Other
21 | *.moved-aside
22 | *.xcuserstate
23 |
24 | ## Obj-C/Swift specific
25 | *.hmap
26 | *.ipa
27 | *.dSYM.zip
28 | *.dSYM
29 |
30 | ## Playgrounds
31 | timeline.xctimeline
32 | playground.xcworkspace
33 |
34 | # Swift Package Manager
35 | #
36 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
37 | # Packages/
38 | .build/
39 |
40 | # CocoaPods
41 | #
42 | # We recommend against adding the Pods directory to your .gitignore. However
43 | # you should judge for yourself, the pros and cons are mentioned at:
44 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
45 | #
46 | # Pods/
47 |
48 | # Carthage
49 | #
50 | # Add this line if you want to avoid checking in source code from Carthage dependencies.
51 | # Carthage/Checkouts
52 |
53 | Carthage/Build
54 |
55 | # fastlane
56 | #
57 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
58 | # screenshots whenever they are needed.
59 | # For more information about the recommended setup visit:
60 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md
61 |
62 | fastlane/report.xml
63 | fastlane/Preview.html
64 | fastlane/screenshots
65 | fastlane/test_output
66 | 0
67 |
68 |
--------------------------------------------------------------------------------
/ROBarcodeScanner.xcodeproj/project.xcworkspace/xcshareddata/ROBarcodeScanner.xccheckout:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDESourceControlProjectFavoriteDictionaryKey
6 |
7 | IDESourceControlProjectIdentifier
8 | DC8B9BA8-83DC-4128-ACC6-7FFB6FE15FFD
9 | IDESourceControlProjectName
10 | ROBarcodeScanner
11 | IDESourceControlProjectOriginsDictionary
12 |
13 | 7F24851518C96AF132B9FA4F115D3B7952186574
14 | https://github.com/prine/ROBarcodeScanner.git
15 |
16 | IDESourceControlProjectPath
17 | ROBarcodeScanner.xcodeproj
18 | IDESourceControlProjectRelativeInstallPathDictionary
19 |
20 | 7F24851518C96AF132B9FA4F115D3B7952186574
21 | ../..
22 |
23 | IDESourceControlProjectURL
24 | https://github.com/prine/ROBarcodeScanner.git
25 | IDESourceControlProjectVersion
26 | 111
27 | IDESourceControlProjectWCCIdentifier
28 | 7F24851518C96AF132B9FA4F115D3B7952186574
29 | IDESourceControlProjectWCConfigurations
30 |
31 |
32 | IDESourceControlRepositoryExtensionIdentifierKey
33 | public.vcs.git
34 | IDESourceControlWCCIdentifierKey
35 | 7F24851518C96AF132B9FA4F115D3B7952186574
36 | IDESourceControlWCCName
37 | ROBarcodeScanner
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/ROBarcodeScanner/ViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.swift
3 | // ROBarcodeScanner
4 | //
5 | // Created by Robin Oster on 24/07/15.
6 | // Copyright (c) 2015 RASCOR International AG. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class ViewController: UIViewController {
12 |
13 | @IBOutlet var scanButton:UIButton!
14 | @IBOutlet var scanResult:UILabel!
15 |
16 | var barcodeScanner:ROBarcodeScannerViewController?
17 |
18 | override func viewDidLoad() {
19 | super.viewDidLoad()
20 |
21 | barcodeScanner = self.storyboard!.instantiateViewController(withIdentifier: "ROBarcodeScannerViewControllerScene") as? ROBarcodeScannerViewController
22 | }
23 |
24 | @IBAction func scanClicked() {
25 |
26 | // Define the callback which is executed when the barcode has been scanned
27 | barcodeScanner?.barcodeScanned = { (barcode:String) in
28 |
29 | // When the screen is tapped, return to first view (barcode is beeing passed as param)
30 | _ = self.navigationController?.popViewController(animated: true)
31 | print("Received following barcode: \(barcode)")
32 |
33 | DispatchQueue.main.async {
34 | self.scanResult.text = "\(barcode)"
35 | }
36 | }
37 |
38 | // Push the ViewController when you want to scan something
39 | if let barcodeScanner = self.barcodeScanner {
40 | self.navigationController?.pushViewController(barcodeScanner, animated: true)
41 | }
42 | }
43 |
44 | override func didReceiveMemoryWarning() {
45 | super.didReceiveMemoryWarning()
46 | // Dispose of any resources that can be recreated.
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/ROBarcodeScanner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 2.2.2
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 18093
23 | LSRequiresIPhoneOS
24 |
25 | NSCameraUsageDescription
26 | Camera is used to scan barcodes.
27 | UILaunchStoryboardName
28 | ROBarcodeScanner
29 | UIMainStoryboardFile
30 | ROBarcodeScanner
31 | UIRequiredDeviceCapabilities
32 |
33 | armv7
34 |
35 | UISupportedInterfaceOrientations
36 |
37 | UIInterfaceOrientationPortrait
38 | UIInterfaceOrientationLandscapeLeft
39 | UIInterfaceOrientationLandscapeRight
40 | UIInterfaceOrientationPortraitUpsideDown
41 |
42 | UISupportedInterfaceOrientations~ipad
43 |
44 | UIInterfaceOrientationPortrait
45 | UIInterfaceOrientationPortraitUpsideDown
46 | UIInterfaceOrientationLandscapeLeft
47 | UIInterfaceOrientationLandscapeRight
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/ROBarcodeScanner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // ROBarcodeScanner
4 | //
5 | // Created by Robin Oster on 24/07/15.
6 | // Copyright (c) 2015 RASCOR International AG. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | @UIApplicationMain
12 | class AppDelegate: UIResponder, UIApplicationDelegate {
13 |
14 | var window: UIWindow?
15 |
16 |
17 | private func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
18 | // Override point for customization after application launch.
19 | return true
20 | }
21 |
22 | func applicationWillResignActive(_ application: UIApplication) {
23 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
24 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
25 | }
26 |
27 | func applicationDidEnterBackground(_ application: UIApplication) {
28 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
30 | }
31 |
32 | func applicationWillEnterForeground(_ application: UIApplication) {
33 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
34 | }
35 |
36 | func applicationDidBecomeActive(_ application: UIApplication) {
37 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
38 | }
39 |
40 | func applicationWillTerminate(_ application: UIApplication) {
41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
42 | }
43 |
44 |
45 | }
46 |
47 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # ROBarcodeScanner
2 | Scans different Barcodes and returns the result as String. Inspired by the Tutorial from Appcoda: [AppCoda](http://www.appcoda.com/qr-code-reader-swift/).
3 |
4 | ## Installation
5 |
6 | ROBarcodeScanner is available through [CocoaPods](http://cocoapods.org). To install
7 | it, simply add the following line to your Podfile:
8 |
9 | ```ruby
10 | pod "ROBarcodeScanner"
11 | ```
12 |
13 | ## How to use
14 |
15 | The ROBarcodeScannerViewController is a predefined view for the scanning. It shows the video and a result label on the bottom of the screen. When it detects an accepted barcode it does mark the barcode in the video window with green border. With a tap on the screen the user can confirm that the correct barcode was scanned and the callback is called.
16 |
17 | 
18 |
19 | ```swift
20 | var barcodeScanner:ROBarcodeScannerViewController?
21 |
22 | // Define the callback which handles the returned result
23 | barcodeScanner?.barcodeScanned = { (barcode:String) in
24 | // The scanned result can be fetched here
25 | println("Barcode scanned: \(barcode)")
26 | }
27 |
28 | // Push the view
29 | if let barcodeScanner = self.barcodeScanner {
30 | self.navigationController?.pushViewController(barcodeScanner, animated: true)
31 | }
32 |
33 | ```
34 |
35 | ## License
36 |
37 | ```
38 | The MIT License (MIT)
39 |
40 | Copyright (c) 2019 Robin Oster (http://prine.ch)
41 |
42 | Permission is hereby granted, free of charge, to any person obtaining a copy of
43 | this software and associated documentation files (the "Software"), to deal in
44 | the Software without restriction, including without limitation the rights to
45 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
46 | the Software, and to permit persons to whom the Software is furnished to do so,
47 | subject to the following conditions:
48 |
49 | The above copyright notice and this permission notice shall be included in all
50 | copies or substantial portions of the Software.
51 |
52 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
53 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
54 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
55 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
56 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
57 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
58 | ```
59 |
60 | ## Author
61 |
62 | Robin Oster, robin.oster@rascor.com
63 |
--------------------------------------------------------------------------------
/ROBarcodeScanner.xcodeproj/xcuserdata/prine.xcuserdatad/xcschemes/ROBarcodeScanner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
29 |
35 |
36 |
37 |
38 |
39 |
44 |
45 |
47 |
53 |
54 |
55 |
56 |
57 |
63 |
64 |
65 |
66 |
67 |
68 |
78 |
80 |
86 |
87 |
88 |
89 |
90 |
91 |
97 |
99 |
105 |
106 |
107 |
108 |
110 |
111 |
114 |
115 |
116 |
--------------------------------------------------------------------------------
/Source/ROBarcodeScannerViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ROBarcodeScannerViewController.swift
3 | // ROBarcodeScanner
4 | //
5 | // Inspired by the Tutorial from http://www.appcoda.com/qr-code-reader-swift/
6 | //
7 | // Created by Robin Oster on 24/07/15.
8 | // Copyright (c) 2015 RASCOR International AG. All rights reserved.
9 | //
10 |
11 | import UIKit
12 | import AVFoundation
13 |
14 | public class ROBarcodeScannerViewController: UIViewController, AVCaptureMetadataOutputObjectsDelegate {
15 |
16 | @IBOutlet weak var messageLabel:UILabel!
17 | @IBOutlet weak var videoView:UIView!
18 |
19 | var captureSession:AVCaptureSession?
20 | var videoPreviewLayer:AVCaptureVideoPreviewLayer?
21 | var qrCodeFrameView:UIView?
22 | var captureDevice:AVCaptureDevice?
23 |
24 | var lastCapturedCode:String?
25 |
26 | public var barcodeScanned:((String) -> ())?
27 |
28 | private var allowedTypes = [AVMetadataObject.ObjectType.upce,
29 | AVMetadataObject.ObjectType.code39,
30 | AVMetadataObject.ObjectType.code39Mod43,
31 | AVMetadataObject.ObjectType.ean13,
32 | AVMetadataObject.ObjectType.ean8,
33 | AVMetadataObject.ObjectType.code93,
34 | AVMetadataObject.ObjectType.code128,
35 | AVMetadataObject.ObjectType.pdf417,
36 | AVMetadataObject.ObjectType.qr,
37 | AVMetadataObject.ObjectType.aztec]
38 |
39 | public override func viewDidLoad() {
40 | super.viewDidLoad()
41 |
42 | // Retrieve the default capturing device for using the camera
43 | self.captureDevice = AVCaptureDevice.default(for: .video)
44 |
45 | // Get an instance of the AVCaptureDeviceInput class using the previous device object.
46 | var error:NSError?
47 | let input: AnyObject!
48 | do {
49 | if let captureDevice = self.captureDevice {
50 | input = try AVCaptureDeviceInput(device: captureDevice)
51 |
52 | if (error != nil) {
53 | // If any error occurs, simply log the description of it and don't continue any more.
54 | print("\(String(describing: error?.localizedDescription))")
55 | return
56 | }
57 |
58 | // Initialize the captureSession object and set the input device on the capture session.
59 | captureSession = AVCaptureSession()
60 | captureSession?.addInput(input as! AVCaptureInput)
61 |
62 | // Initialize a AVCaptureMetadataOutput object and set it as the output device to the capture session.
63 | let captureMetadataOutput = AVCaptureMetadataOutput()
64 | captureSession?.addOutput(captureMetadataOutput)
65 |
66 | // Set delegate and use the default dispatch queue to execute the call back
67 | captureMetadataOutput.setMetadataObjectsDelegate(self, queue: DispatchQueue.main)
68 | captureMetadataOutput.metadataObjectTypes = self.allowedTypes
69 |
70 | // Initialize the video preview layer and add it as a sublayer to the viewPreview view's layer.
71 |
72 | if let captureSession = captureSession {
73 | videoPreviewLayer = AVCaptureVideoPreviewLayer(session: captureSession)
74 | videoPreviewLayer?.videoGravity = AVLayerVideoGravity.resize
75 | videoPreviewLayer?.frame = videoView.layer.bounds
76 | videoView.layer.addSublayer(videoPreviewLayer!)
77 |
78 | // Start video capture.
79 | captureSession.startRunning()
80 |
81 | // Move the message label to the top view
82 | view.bringSubviewToFront(messageLabel)
83 |
84 | // Initialize QR Code Frame to highlight the QR code
85 | qrCodeFrameView = UIView()
86 | qrCodeFrameView?.layer.borderColor = UIColor.red.cgColor
87 | qrCodeFrameView?.layer.borderWidth = 2
88 | qrCodeFrameView?.autoresizingMask = [UIView.AutoresizingMask.flexibleTopMargin, UIView.AutoresizingMask.flexibleBottomMargin, UIView.AutoresizingMask.flexibleLeftMargin, UIView.AutoresizingMask.flexibleRightMargin]
89 |
90 | view.addSubview(qrCodeFrameView!)
91 | view.bringSubviewToFront(qrCodeFrameView!)
92 | }
93 | }
94 | } catch let error1 as NSError {
95 | error = error1
96 | input = nil
97 | }
98 | }
99 |
100 | public override func viewWillLayoutSubviews() {
101 | super.viewDidLayoutSubviews()
102 |
103 | videoPreviewLayer?.frame = self.videoView.layer.bounds
104 |
105 | let orientation = UIApplication.shared.statusBarOrientation
106 |
107 | if let videoPreviewLayer = self.videoPreviewLayer {
108 | switch(orientation) {
109 | case UIInterfaceOrientation.landscapeLeft:
110 | videoPreviewLayer.connection?.videoOrientation = AVCaptureVideoOrientation.landscapeLeft
111 |
112 | case UIInterfaceOrientation.landscapeRight:
113 | videoPreviewLayer.connection?.videoOrientation = AVCaptureVideoOrientation.landscapeRight
114 |
115 | case UIInterfaceOrientation.portrait:
116 | videoPreviewLayer.connection?.videoOrientation = AVCaptureVideoOrientation.portrait
117 |
118 | case UIInterfaceOrientation.portraitUpsideDown:
119 | videoPreviewLayer.connection?.videoOrientation = AVCaptureVideoOrientation.portraitUpsideDown
120 |
121 | default:
122 | print("Unknown orientation state")
123 | }
124 | }
125 | }
126 |
127 | public override func viewDidLayoutSubviews() {
128 |
129 | }
130 |
131 | public override func didRotate(from fromInterfaceOrientation: UIInterfaceOrientation) {
132 | videoPreviewLayer?.frame = videoView.layer.bounds
133 | }
134 |
135 | // DIFFERENT FUNCTION, i fixed in maybe rascor?!
136 | // func metadataOutput(_ output: AVCaptureMetadataOutput, didOutput metadataObjects: [AVMetadataObject], from connection: AVCaptureConnection)
137 | public func metadataOutput(_ output: AVCaptureMetadataOutput, didOutput metadataObjects: [AVMetadataObject], from connection: AVCaptureConnection) {
138 |
139 | // Check if the metadataObjects array is not nil and it contains at least one object.
140 | if metadataObjects.count == 0 {
141 | qrCodeFrameView?.frame = CGRect.zero
142 | messageLabel.text = "No QR code is detected"
143 | return
144 | }
145 |
146 | // Get the metadata object.
147 | let metadataObj = metadataObjects[0] as! AVMetadataMachineReadableCodeObject
148 |
149 | if self.allowedTypes.contains(metadataObj.type) {
150 | // If the found metadata is equal to the QR code metadata then update the status label's text and set the bounds
151 | let barCodeObject = videoPreviewLayer?.transformedMetadataObject(for: metadataObj as AVMetadataMachineReadableCodeObject) as! AVMetadataMachineReadableCodeObject
152 |
153 | qrCodeFrameView?.frame = barCodeObject.bounds;
154 |
155 | if metadataObj.stringValue != nil {
156 | messageLabel.text = metadataObj.stringValue
157 | lastCapturedCode = metadataObj.stringValue
158 |
159 | print("Scanned barcode: \(String(describing: metadataObj.stringValue))")
160 | }
161 | }
162 | }
163 |
164 | public override func touchesBegan(_ touches: Set, with event: UIEvent?) {
165 | _ = self.navigationController?.popViewController(animated: true)
166 |
167 | if let barcodeScannedTemp = barcodeScanned, let lastCapturedCodeTemp = lastCapturedCode {
168 | // Notify via callback
169 | barcodeScannedTemp(lastCapturedCodeTemp)
170 | }
171 | }
172 |
173 | public override func didReceiveMemoryWarning() {
174 | super.didReceiveMemoryWarning()
175 | }
176 | }
177 |
--------------------------------------------------------------------------------
/Source/ROBarcodeScanner.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
54 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
--------------------------------------------------------------------------------
/ROBarcodeScanner.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | CBD062321B6233ED002A5F18 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBD062311B6233ED002A5F18 /* AppDelegate.swift */; };
11 | CBD062391B6233ED002A5F18 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = CBD062381B6233ED002A5F18 /* Images.xcassets */; };
12 | CBD062481B6233ED002A5F18 /* ROBarcodeScannerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBD062471B6233ED002A5F18 /* ROBarcodeScannerTests.swift */; };
13 | CBD062541B626BFE002A5F18 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBD062531B626BFE002A5F18 /* ViewController.swift */; };
14 | CBD0625A1B6282D7002A5F18 /* LICENSE in Resources */ = {isa = PBXBuildFile; fileRef = CBD062571B6282D7002A5F18 /* LICENSE */; };
15 | CBD0625C1B6282D7002A5F18 /* ROBarcodeScanner.podspec in Resources */ = {isa = PBXBuildFile; fileRef = CBD062591B6282D7002A5F18 /* ROBarcodeScanner.podspec */; };
16 | CBD062601B6287DC002A5F18 /* ROBarcodeScanner.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CBD0625E1B6287DC002A5F18 /* ROBarcodeScanner.storyboard */; };
17 | CBD062611B6287DC002A5F18 /* ROBarcodeScannerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBD0625F1B6287DC002A5F18 /* ROBarcodeScannerViewController.swift */; };
18 | CBD062631B68C5DC002A5F18 /* Screenshot.png in Resources */ = {isa = PBXBuildFile; fileRef = CBD062621B68C5DC002A5F18 /* Screenshot.png */; };
19 | /* End PBXBuildFile section */
20 |
21 | /* Begin PBXContainerItemProxy section */
22 | CBD062421B6233ED002A5F18 /* PBXContainerItemProxy */ = {
23 | isa = PBXContainerItemProxy;
24 | containerPortal = CBD062241B6233ED002A5F18 /* Project object */;
25 | proxyType = 1;
26 | remoteGlobalIDString = CBD0622B1B6233ED002A5F18;
27 | remoteInfo = ROBarcodeScanner;
28 | };
29 | /* End PBXContainerItemProxy section */
30 |
31 | /* Begin PBXFileReference section */
32 | CBD0622C1B6233ED002A5F18 /* ROBarcodeScanner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ROBarcodeScanner.app; sourceTree = BUILT_PRODUCTS_DIR; };
33 | CBD062301B6233ED002A5F18 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
34 | CBD062311B6233ED002A5F18 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
35 | CBD062381B6233ED002A5F18 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; };
36 | CBD062411B6233ED002A5F18 /* ROBarcodeScannerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ROBarcodeScannerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
37 | CBD062461B6233ED002A5F18 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
38 | CBD062471B6233ED002A5F18 /* ROBarcodeScannerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ROBarcodeScannerTests.swift; sourceTree = ""; };
39 | CBD062531B626BFE002A5F18 /* ViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; };
40 | CBD062571B6282D7002A5F18 /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE; sourceTree = ""; };
41 | CBD062581B6282D7002A5F18 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; };
42 | CBD062591B6282D7002A5F18 /* ROBarcodeScanner.podspec */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ROBarcodeScanner.podspec; sourceTree = ""; };
43 | CBD0625E1B6287DC002A5F18 /* ROBarcodeScanner.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = ROBarcodeScanner.storyboard; path = Source/ROBarcodeScanner.storyboard; sourceTree = SOURCE_ROOT; };
44 | CBD0625F1B6287DC002A5F18 /* ROBarcodeScannerViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ROBarcodeScannerViewController.swift; path = Source/ROBarcodeScannerViewController.swift; sourceTree = SOURCE_ROOT; };
45 | CBD062621B68C5DC002A5F18 /* Screenshot.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Screenshot.png; sourceTree = ""; };
46 | /* End PBXFileReference section */
47 |
48 | /* Begin PBXFrameworksBuildPhase section */
49 | CBD062291B6233ED002A5F18 /* Frameworks */ = {
50 | isa = PBXFrameworksBuildPhase;
51 | buildActionMask = 2147483647;
52 | files = (
53 | );
54 | runOnlyForDeploymentPostprocessing = 0;
55 | };
56 | CBD0623E1B6233ED002A5F18 /* Frameworks */ = {
57 | isa = PBXFrameworksBuildPhase;
58 | buildActionMask = 2147483647;
59 | files = (
60 | );
61 | runOnlyForDeploymentPostprocessing = 0;
62 | };
63 | /* End PBXFrameworksBuildPhase section */
64 |
65 | /* Begin PBXGroup section */
66 | CBD062231B6233ED002A5F18 = {
67 | isa = PBXGroup;
68 | children = (
69 | CBD062571B6282D7002A5F18 /* LICENSE */,
70 | CBD062581B6282D7002A5F18 /* README.md */,
71 | CBD062591B6282D7002A5F18 /* ROBarcodeScanner.podspec */,
72 | CBD062621B68C5DC002A5F18 /* Screenshot.png */,
73 | CBD0622E1B6233ED002A5F18 /* ROBarcodeScanner */,
74 | CBD062441B6233ED002A5F18 /* ROBarcodeScannerTests */,
75 | CBD0622D1B6233ED002A5F18 /* Products */,
76 | );
77 | sourceTree = "";
78 | };
79 | CBD0622D1B6233ED002A5F18 /* Products */ = {
80 | isa = PBXGroup;
81 | children = (
82 | CBD0622C1B6233ED002A5F18 /* ROBarcodeScanner.app */,
83 | CBD062411B6233ED002A5F18 /* ROBarcodeScannerTests.xctest */,
84 | );
85 | name = Products;
86 | sourceTree = "";
87 | };
88 | CBD0622E1B6233ED002A5F18 /* ROBarcodeScanner */ = {
89 | isa = PBXGroup;
90 | children = (
91 | CBD062311B6233ED002A5F18 /* AppDelegate.swift */,
92 | CBD062531B626BFE002A5F18 /* ViewController.swift */,
93 | CBD062381B6233ED002A5F18 /* Images.xcassets */,
94 | CBD0625D1B6287C1002A5F18 /* Source */,
95 | CBD0622F1B6233ED002A5F18 /* Supporting Files */,
96 | );
97 | path = ROBarcodeScanner;
98 | sourceTree = "";
99 | };
100 | CBD0622F1B6233ED002A5F18 /* Supporting Files */ = {
101 | isa = PBXGroup;
102 | children = (
103 | CBD062301B6233ED002A5F18 /* Info.plist */,
104 | );
105 | name = "Supporting Files";
106 | sourceTree = "";
107 | };
108 | CBD062441B6233ED002A5F18 /* ROBarcodeScannerTests */ = {
109 | isa = PBXGroup;
110 | children = (
111 | CBD062471B6233ED002A5F18 /* ROBarcodeScannerTests.swift */,
112 | CBD062451B6233ED002A5F18 /* Supporting Files */,
113 | );
114 | path = ROBarcodeScannerTests;
115 | sourceTree = "";
116 | };
117 | CBD062451B6233ED002A5F18 /* Supporting Files */ = {
118 | isa = PBXGroup;
119 | children = (
120 | CBD062461B6233ED002A5F18 /* Info.plist */,
121 | );
122 | name = "Supporting Files";
123 | sourceTree = "";
124 | };
125 | CBD0625D1B6287C1002A5F18 /* Source */ = {
126 | isa = PBXGroup;
127 | children = (
128 | CBD0625E1B6287DC002A5F18 /* ROBarcodeScanner.storyboard */,
129 | CBD0625F1B6287DC002A5F18 /* ROBarcodeScannerViewController.swift */,
130 | );
131 | name = Source;
132 | sourceTree = "";
133 | };
134 | /* End PBXGroup section */
135 |
136 | /* Begin PBXNativeTarget section */
137 | CBD0622B1B6233ED002A5F18 /* ROBarcodeScanner */ = {
138 | isa = PBXNativeTarget;
139 | buildConfigurationList = CBD0624B1B6233ED002A5F18 /* Build configuration list for PBXNativeTarget "ROBarcodeScanner" */;
140 | buildPhases = (
141 | CBD062281B6233ED002A5F18 /* Sources */,
142 | CBD062291B6233ED002A5F18 /* Frameworks */,
143 | CBD0622A1B6233ED002A5F18 /* Resources */,
144 | );
145 | buildRules = (
146 | );
147 | dependencies = (
148 | );
149 | name = ROBarcodeScanner;
150 | productName = ROBarcodeScanner;
151 | productReference = CBD0622C1B6233ED002A5F18 /* ROBarcodeScanner.app */;
152 | productType = "com.apple.product-type.application";
153 | };
154 | CBD062401B6233ED002A5F18 /* ROBarcodeScannerTests */ = {
155 | isa = PBXNativeTarget;
156 | buildConfigurationList = CBD0624E1B6233ED002A5F18 /* Build configuration list for PBXNativeTarget "ROBarcodeScannerTests" */;
157 | buildPhases = (
158 | CBD0623D1B6233ED002A5F18 /* Sources */,
159 | CBD0623E1B6233ED002A5F18 /* Frameworks */,
160 | CBD0623F1B6233ED002A5F18 /* Resources */,
161 | );
162 | buildRules = (
163 | );
164 | dependencies = (
165 | CBD062431B6233ED002A5F18 /* PBXTargetDependency */,
166 | );
167 | name = ROBarcodeScannerTests;
168 | productName = ROBarcodeScannerTests;
169 | productReference = CBD062411B6233ED002A5F18 /* ROBarcodeScannerTests.xctest */;
170 | productType = "com.apple.product-type.bundle.unit-test";
171 | };
172 | /* End PBXNativeTarget section */
173 |
174 | /* Begin PBXProject section */
175 | CBD062241B6233ED002A5F18 /* Project object */ = {
176 | isa = PBXProject;
177 | attributes = {
178 | LastSwiftMigration = 0700;
179 | LastSwiftUpdateCheck = 0700;
180 | LastUpgradeCheck = 1020;
181 | ORGANIZATIONNAME = "RASCOR International AG";
182 | TargetAttributes = {
183 | CBD0622B1B6233ED002A5F18 = {
184 | CreatedOnToolsVersion = 6.4;
185 | DevelopmentTeam = 39J9X3JBYC;
186 | LastSwiftMigration = 0800;
187 | };
188 | CBD062401B6233ED002A5F18 = {
189 | CreatedOnToolsVersion = 6.4;
190 | DevelopmentTeam = 39J9X3JBYC;
191 | LastSwiftMigration = 0800;
192 | TestTargetID = CBD0622B1B6233ED002A5F18;
193 | };
194 | };
195 | };
196 | buildConfigurationList = CBD062271B6233ED002A5F18 /* Build configuration list for PBXProject "ROBarcodeScanner" */;
197 | compatibilityVersion = "Xcode 3.2";
198 | developmentRegion = English;
199 | hasScannedForEncodings = 0;
200 | knownRegions = (
201 | English,
202 | en,
203 | Base,
204 | );
205 | mainGroup = CBD062231B6233ED002A5F18;
206 | productRefGroup = CBD0622D1B6233ED002A5F18 /* Products */;
207 | projectDirPath = "";
208 | projectRoot = "";
209 | targets = (
210 | CBD0622B1B6233ED002A5F18 /* ROBarcodeScanner */,
211 | CBD062401B6233ED002A5F18 /* ROBarcodeScannerTests */,
212 | );
213 | };
214 | /* End PBXProject section */
215 |
216 | /* Begin PBXResourcesBuildPhase section */
217 | CBD0622A1B6233ED002A5F18 /* Resources */ = {
218 | isa = PBXResourcesBuildPhase;
219 | buildActionMask = 2147483647;
220 | files = (
221 | CBD062601B6287DC002A5F18 /* ROBarcodeScanner.storyboard in Resources */,
222 | CBD0625C1B6282D7002A5F18 /* ROBarcodeScanner.podspec in Resources */,
223 | CBD0625A1B6282D7002A5F18 /* LICENSE in Resources */,
224 | CBD062391B6233ED002A5F18 /* Images.xcassets in Resources */,
225 | CBD062631B68C5DC002A5F18 /* Screenshot.png in Resources */,
226 | );
227 | runOnlyForDeploymentPostprocessing = 0;
228 | };
229 | CBD0623F1B6233ED002A5F18 /* Resources */ = {
230 | isa = PBXResourcesBuildPhase;
231 | buildActionMask = 2147483647;
232 | files = (
233 | );
234 | runOnlyForDeploymentPostprocessing = 0;
235 | };
236 | /* End PBXResourcesBuildPhase section */
237 |
238 | /* Begin PBXSourcesBuildPhase section */
239 | CBD062281B6233ED002A5F18 /* Sources */ = {
240 | isa = PBXSourcesBuildPhase;
241 | buildActionMask = 2147483647;
242 | files = (
243 | CBD062541B626BFE002A5F18 /* ViewController.swift in Sources */,
244 | CBD062611B6287DC002A5F18 /* ROBarcodeScannerViewController.swift in Sources */,
245 | CBD062321B6233ED002A5F18 /* AppDelegate.swift in Sources */,
246 | );
247 | runOnlyForDeploymentPostprocessing = 0;
248 | };
249 | CBD0623D1B6233ED002A5F18 /* Sources */ = {
250 | isa = PBXSourcesBuildPhase;
251 | buildActionMask = 2147483647;
252 | files = (
253 | CBD062481B6233ED002A5F18 /* ROBarcodeScannerTests.swift in Sources */,
254 | );
255 | runOnlyForDeploymentPostprocessing = 0;
256 | };
257 | /* End PBXSourcesBuildPhase section */
258 |
259 | /* Begin PBXTargetDependency section */
260 | CBD062431B6233ED002A5F18 /* PBXTargetDependency */ = {
261 | isa = PBXTargetDependency;
262 | target = CBD0622B1B6233ED002A5F18 /* ROBarcodeScanner */;
263 | targetProxy = CBD062421B6233ED002A5F18 /* PBXContainerItemProxy */;
264 | };
265 | /* End PBXTargetDependency section */
266 |
267 | /* Begin XCBuildConfiguration section */
268 | CBD062491B6233ED002A5F18 /* Debug */ = {
269 | isa = XCBuildConfiguration;
270 | buildSettings = {
271 | ALWAYS_SEARCH_USER_PATHS = NO;
272 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
273 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
274 | CLANG_CXX_LIBRARY = "libc++";
275 | CLANG_ENABLE_MODULES = YES;
276 | CLANG_ENABLE_OBJC_ARC = YES;
277 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
278 | CLANG_WARN_BOOL_CONVERSION = YES;
279 | CLANG_WARN_COMMA = YES;
280 | CLANG_WARN_CONSTANT_CONVERSION = YES;
281 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
282 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
283 | CLANG_WARN_EMPTY_BODY = YES;
284 | CLANG_WARN_ENUM_CONVERSION = YES;
285 | CLANG_WARN_INFINITE_RECURSION = YES;
286 | CLANG_WARN_INT_CONVERSION = YES;
287 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
288 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
289 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
290 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
291 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
292 | CLANG_WARN_STRICT_PROTOTYPES = YES;
293 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
294 | CLANG_WARN_UNREACHABLE_CODE = YES;
295 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
296 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
297 | COPY_PHASE_STRIP = NO;
298 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
299 | ENABLE_STRICT_OBJC_MSGSEND = YES;
300 | ENABLE_TESTABILITY = YES;
301 | GCC_C_LANGUAGE_STANDARD = gnu99;
302 | GCC_DYNAMIC_NO_PIC = NO;
303 | GCC_NO_COMMON_BLOCKS = YES;
304 | GCC_OPTIMIZATION_LEVEL = 0;
305 | GCC_PREPROCESSOR_DEFINITIONS = (
306 | "DEBUG=1",
307 | "$(inherited)",
308 | );
309 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
310 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
311 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
312 | GCC_WARN_UNDECLARED_SELECTOR = YES;
313 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
314 | GCC_WARN_UNUSED_FUNCTION = YES;
315 | GCC_WARN_UNUSED_VARIABLE = YES;
316 | IPHONEOS_DEPLOYMENT_TARGET = 10.2;
317 | MTL_ENABLE_DEBUG_INFO = YES;
318 | ONLY_ACTIVE_ARCH = YES;
319 | SDKROOT = iphoneos;
320 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
321 | SWIFT_VERSION = 4.2;
322 | TARGETED_DEVICE_FAMILY = "1,2";
323 | };
324 | name = Debug;
325 | };
326 | CBD0624A1B6233ED002A5F18 /* Release */ = {
327 | isa = XCBuildConfiguration;
328 | buildSettings = {
329 | ALWAYS_SEARCH_USER_PATHS = NO;
330 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
331 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
332 | CLANG_CXX_LIBRARY = "libc++";
333 | CLANG_ENABLE_MODULES = YES;
334 | CLANG_ENABLE_OBJC_ARC = YES;
335 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
336 | CLANG_WARN_BOOL_CONVERSION = YES;
337 | CLANG_WARN_COMMA = YES;
338 | CLANG_WARN_CONSTANT_CONVERSION = YES;
339 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
340 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
341 | CLANG_WARN_EMPTY_BODY = YES;
342 | CLANG_WARN_ENUM_CONVERSION = YES;
343 | CLANG_WARN_INFINITE_RECURSION = YES;
344 | CLANG_WARN_INT_CONVERSION = YES;
345 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
346 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
347 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
348 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
349 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
350 | CLANG_WARN_STRICT_PROTOTYPES = YES;
351 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
352 | CLANG_WARN_UNREACHABLE_CODE = YES;
353 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
354 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
355 | COPY_PHASE_STRIP = NO;
356 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
357 | ENABLE_NS_ASSERTIONS = NO;
358 | ENABLE_STRICT_OBJC_MSGSEND = YES;
359 | GCC_C_LANGUAGE_STANDARD = gnu99;
360 | GCC_NO_COMMON_BLOCKS = YES;
361 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
362 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
363 | GCC_WARN_UNDECLARED_SELECTOR = YES;
364 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
365 | GCC_WARN_UNUSED_FUNCTION = YES;
366 | GCC_WARN_UNUSED_VARIABLE = YES;
367 | IPHONEOS_DEPLOYMENT_TARGET = 10.2;
368 | MTL_ENABLE_DEBUG_INFO = NO;
369 | SDKROOT = iphoneos;
370 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
371 | SWIFT_VERSION = 4.2;
372 | TARGETED_DEVICE_FAMILY = "1,2";
373 | VALIDATE_PRODUCT = YES;
374 | };
375 | name = Release;
376 | };
377 | CBD0624C1B6233ED002A5F18 /* Debug */ = {
378 | isa = XCBuildConfiguration;
379 | buildSettings = {
380 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
381 | CODE_SIGN_IDENTITY = "iPhone Developer";
382 | DEVELOPMENT_TEAM = 39J9X3JBYC;
383 | INFOPLIST_FILE = ROBarcodeScanner/Info.plist;
384 | IPHONEOS_DEPLOYMENT_TARGET = 8.4;
385 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
386 | PRODUCT_BUNDLE_IDENTIFIER = "com.rascor.$(PRODUCT_NAME:rfc1034identifier)";
387 | PRODUCT_NAME = "$(TARGET_NAME)";
388 | SWIFT_VERSION = 4.2;
389 | };
390 | name = Debug;
391 | };
392 | CBD0624D1B6233ED002A5F18 /* Release */ = {
393 | isa = XCBuildConfiguration;
394 | buildSettings = {
395 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
396 | CODE_SIGN_IDENTITY = "iPhone Developer";
397 | DEVELOPMENT_TEAM = 39J9X3JBYC;
398 | INFOPLIST_FILE = ROBarcodeScanner/Info.plist;
399 | IPHONEOS_DEPLOYMENT_TARGET = 8.4;
400 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
401 | PRODUCT_BUNDLE_IDENTIFIER = "com.rascor.$(PRODUCT_NAME:rfc1034identifier)";
402 | PRODUCT_NAME = "$(TARGET_NAME)";
403 | SWIFT_VERSION = 4.2;
404 | };
405 | name = Release;
406 | };
407 | CBD0624F1B6233ED002A5F18 /* Debug */ = {
408 | isa = XCBuildConfiguration;
409 | buildSettings = {
410 | BUNDLE_LOADER = "$(TEST_HOST)";
411 | DEVELOPMENT_TEAM = 39J9X3JBYC;
412 | FRAMEWORK_SEARCH_PATHS = "$(inherited)";
413 | GCC_PREPROCESSOR_DEFINITIONS = (
414 | "DEBUG=1",
415 | "$(inherited)",
416 | );
417 | INFOPLIST_FILE = ROBarcodeScannerTests/Info.plist;
418 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
419 | PRODUCT_BUNDLE_IDENTIFIER = "com.rascor.$(PRODUCT_NAME:rfc1034identifier)";
420 | PRODUCT_NAME = "$(TARGET_NAME)";
421 | SWIFT_VERSION = 4.2;
422 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ROBarcodeScanner.app/ROBarcodeScanner";
423 | };
424 | name = Debug;
425 | };
426 | CBD062501B6233ED002A5F18 /* Release */ = {
427 | isa = XCBuildConfiguration;
428 | buildSettings = {
429 | BUNDLE_LOADER = "$(TEST_HOST)";
430 | DEVELOPMENT_TEAM = 39J9X3JBYC;
431 | FRAMEWORK_SEARCH_PATHS = "$(inherited)";
432 | INFOPLIST_FILE = ROBarcodeScannerTests/Info.plist;
433 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
434 | PRODUCT_BUNDLE_IDENTIFIER = "com.rascor.$(PRODUCT_NAME:rfc1034identifier)";
435 | PRODUCT_NAME = "$(TARGET_NAME)";
436 | SWIFT_VERSION = 4.2;
437 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ROBarcodeScanner.app/ROBarcodeScanner";
438 | };
439 | name = Release;
440 | };
441 | /* End XCBuildConfiguration section */
442 |
443 | /* Begin XCConfigurationList section */
444 | CBD062271B6233ED002A5F18 /* Build configuration list for PBXProject "ROBarcodeScanner" */ = {
445 | isa = XCConfigurationList;
446 | buildConfigurations = (
447 | CBD062491B6233ED002A5F18 /* Debug */,
448 | CBD0624A1B6233ED002A5F18 /* Release */,
449 | );
450 | defaultConfigurationIsVisible = 0;
451 | defaultConfigurationName = Debug;
452 | };
453 | CBD0624B1B6233ED002A5F18 /* Build configuration list for PBXNativeTarget "ROBarcodeScanner" */ = {
454 | isa = XCConfigurationList;
455 | buildConfigurations = (
456 | CBD0624C1B6233ED002A5F18 /* Debug */,
457 | CBD0624D1B6233ED002A5F18 /* Release */,
458 | );
459 | defaultConfigurationIsVisible = 0;
460 | defaultConfigurationName = Debug;
461 | };
462 | CBD0624E1B6233ED002A5F18 /* Build configuration list for PBXNativeTarget "ROBarcodeScannerTests" */ = {
463 | isa = XCConfigurationList;
464 | buildConfigurations = (
465 | CBD0624F1B6233ED002A5F18 /* Debug */,
466 | CBD062501B6233ED002A5F18 /* Release */,
467 | );
468 | defaultConfigurationIsVisible = 0;
469 | defaultConfigurationName = Debug;
470 | };
471 | /* End XCConfigurationList section */
472 | };
473 | rootObject = CBD062241B6233ED002A5F18 /* Project object */;
474 | }
475 |
--------------------------------------------------------------------------------