@IBOutlet var webView: UIWebView
@IBOutlet var textAddress: UITextField
override func viewDidLoad() {
super.viewDidLoad()
var url = NSURL(string: "http://www.sina.com.cn")
var request : NSURLRequest = NSURLRequest(URL: url)
self.webView.loadRequest(request)
}
@IBAction func didGo(sender: AnyObject) {
var str = textAddress.text
if !str.hasPrefix("http://")
{
str = "http://" + str
}
println("\(str)")
self.view.endEditing(true)
var url = NSURL(string: str)
var request : NSURLRequest = NSURLRequest(URL: url)
self.webView.loadRequest(request)
}