I'm trying to implement custom highlight views for iOS 16 DataScannerViewController
. So far I can add the subviews to the overlayContainerView but I'm struggling with converting from the item bounds to the view bounds.
func dataScanner(_ dataScanner: DataScannerViewController, didUpdate updatedItems: [RecognizedItem], allItems: [RecognizedItem]) {
for item in updatedItems {
if let view = parent.itemHighlightViews[item.id] {
view.bounds = item.bounds //Cannot assign value of type 'RecognizedItem.Bounds' to type 'CGRect'
}
}
}
How can I position my highlight views correctly?