Good morning staff
I can load a web page quietly into a UIWebView with the following Swift code:
import UIKit
class ConteudoOnlineViewController: UIViewController {
@IBOutlet weak var pagina: UIWebView!
override func viewDidLoad() {
super.viewDidLoad()
pagina.delegate = self as? UIWebViewDelegate
if let url = URL(string: "http://www.meusite.com.br/login.aspx") {
let request = URLRequest(url: url)
pagina.loadRequest(request)
}
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
But my site has a login page and I created a validation to access directly by passing a token, it happens that now I can not load this page in UIWebView, it simply does not appear anything. Could someone give me an idea of what I should do ??
import UIKit
class ConteudoOnlineViewController: UIViewController {
@IBOutlet weak var pagina: UIWebView!
override func viewDidLoad() {
super.viewDidLoad()
pagina.delegate = self as? UIWebViewDelegate
if let url = URL(string: "http://www.meusite.com.br/login.aspx?token=6D5C6A4BF468D43ABD521A3C9D3469C3") {
let request = URLRequest(url: url)
pagina.loadRequest(request)
}
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}