I have a button that, when pressed, it should take you to a url composed with some variables. All the variables are one word except "texto".
If "texto" is one word, all works ok. The problem comes when "texto" is more than one word (even a word and a space), and the button does not take you to url.
My code is the following:
@IBAction func pay(_ sender: Any) {
NSLog("%@", texto);
let urlString:String = "https://webpage/video.php?user=\(user)&pass=\(pass)&texto=\(texto)&esp=\(espec)&l_origen=\(l_origen)&l_destino=\(l_destino)"
if let url = URL(string:urlString){
let svc = SFSafariViewController(url: url)
self.present(svc, animated: true, completion: nil)
}
}