I'm setting up a barcode reader app, got 3 tab bar item and one of them "SCAN" tab and another one of them is "WEBVIEW" tab. When user scan the barcode or qr, it's giving a string and going to webview's url. I want to send this string to url and open the webview tab. Can you help me with this problem ?
if (metadataObjects.count > 0 && metadataObjects.first is AVMetadataMachineReadableCodeObject) {
let scan = metadataObjects.first as! AVMetadataMachineReadableCodeObject
let alertController = UIAlertController(title: "Barkod Tarandı", message: scan.stringValue, preferredStyle: .alert)
alertController.addAction(UIAlertAction(title: "TAMAM", style: .default, handler:nil))
present(alertController, animated: true, completion: nil)
if(scan.stringValue != nil)
{
if let aString = URL(string: "" + ("http://www.truebilisim.com/myiphone/true/mymagazaplus/barkod.php?barkod=\(scan.stringValue)")) {
webalani.loadRequest(URLRequest(url: aString))
}
}
}