You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Modify textResultCallback. Replace the content of textResultCallback with the following code:
>- Objective-C
>- Swift
>
>1.
```objc
- (void)textResultCallback:(NSInteger)frameId imageData:(iImageData *)imageData results:(NSArray *)results{
if (results) {
NSString *msgText = @"";
for (NSInteger i = 0; i< [results count]; i++) {
msgText = [msgText stringByAppendingString:[NSString stringWithFormat:@"\nFormat: %@\nText: %@\n", results[i].barcodeFormatString, results[i].barcodeText]];
}
dispatch_async(dispatch_get_main_queue(), ^{
self.resultView.hidden = false;
self.resultView.text = msgText;
});
}else{
return;
}
}
```
2.
```swift
class ViewController: UIViewController, DBRTextResultListener {
var resultView:UITextView!
...
// Add code to config the result view.
func textResultCallback(_ frameId: Int, imageData: iImageData, results: [iTextResult]?) {
if (results != nil){
var viewText:String = "\("Total Result(s):") \(results?.count ?? 0)"
for res in results! {
viewText = viewText + "\n\("Format:") \(res.barcodeFormatString!) \n\("Text:") \(res.barcodeText ?? "None")\n"
}
DispatchQueue.main.async{
self.resultView.isHidden = false
self.resultView.text = viewText
}
}else{
return
}
}
}
```
Method textResultCallback is where you receive the barcode results when using video barcode decoding. It is triggered each time when an image is processed.
For more details about how to get started with Dynamsoft Barcode Reader, please view the [user guide]({{ site.oc }}user-guide.html).