Customize the DataScannerViewController highlights

Hi Everyone,

I am planning to customize the DataScannerViewController highlights using overlayContainerViewin the DataScannerViewControllerDelegate method as below.

 func dataScanner(_ dataScanner: DataScannerViewController, didAdd addedItems: [RecognizedItem], allItems: [RecognizedItem]) {
        for item in addedItems {
            let newView = newHighlightView(forItem: item)
            itemHighlightViews[item.id] = newView
            dataScanner.overlayContainerView.addSubview(newView)
        }
    }

I created an UIView instance with the item bounds in the newHighlightView function and then drawn the 4 corner lines on the view border but when I scan the barcode these 4 corner lines are not lined up with the barcode and these corner lines are displaying somewhere else.

Can you please suggest how to customize the DataScannerViewController highlights and display them in correct position.

Is there anyway we can change the DataScannerViewController highlights color? Please suggest.

Thanks in advance.

Regards,
Narayana