Installation Guide for barKoder's iOS Barcode Scanner SDK
Please follow these simple steps to integrate our SDK into your iOS project.
Create a new group #
Name the group “frameworks”. This name is optional, you can use any label you prefer.

Add Barkoder.xcframework and BarkoderSDK.xcframework #
Add these items to the frameworks group (Copy items if needed, Create groups and Add to desired targets).

Enable Bitcode (set it to NO) #
In Build Settings, set Enable Bitcode to NO as shown in the image.

Update Info.plist #
Open Info.plist with Source Code and add the following changes:
<key>NSCameraUsageDescription</key>
<string>BKD Scanner requires using camera</string>

Add BarkoderView as a view #
Import BarkoderSDK and delcare barkoderView as a view
import UIKit
import BarkoderSDK
class ViewController: UIViewController {
private var barkoderView: BarkoderView!
override func viewDidLoad() {
super.viewDidLoad()
setupUI()
setupConstraints()
}
private func setupUI() {
barkoderView = BarkoderView()
view.addSubview(barkoderView)
}
private func setupConstraints() {
barkoderView.translatesAutoresizingMaskIntoConstraints = false
barkoderView.leadingAnchor.constraint(equalTo: view.leadingAnchor).isActive = true
barkoderView.topAnchor.constraint(equalTo: view.topAnchor).isActive = true
barkoderView.trailingAnchor.constraint(equalTo: view.trailingAnchor).isActive = true
barkoderView.bottomAnchor.constraint(equalTo: view.bottomAnchor).isActive = true
}
}
Licensing #
Create barKoder Config #
Setup the Barkoder Config according to your needs:
To perform scanning, the config property must be properly set.
private func createBarkoderConfig() {
barkoderView.config = BarkoderConfig(licenseKey: "LICENSE_KEY") { licenseResult in print("Licensing SDK: \(licenseResult)") }
// Enable QR barcode type
guard let decoderConfig = barkoderView.config?.decoderConfig else { return }
decoderConfig.qr.enabled = true
}
Implement BarkoderResultDelegate protocol #
To receive the scanned results we need to implement this protocol:
extension ViewController: BarkoderResultDelegate {
func scanningFinished(_ decoderResults: [DecoderResult], thumbnails: [UIImage]?, image: UIImage?) {
if let textualData = decoderResults[0].textualData {
print("Scanned result: ", textualData)
}
}
}
Start the scanning process #
And finally start the scanning process:
try? barkoderView.startScanning(self)