Vote count:
0
This is the code that i used.
import UIKit import WebKit
class ViewController: UIViewController, UISearchBarDelegate {
@IBOutlet weak var searchbar: UISearchBar!
@IBOutlet weak var webview: UIWebView!
func searchBarSearchButtonClicked(searchBar: UISearchBar!) {
searchBar.resignFirstResponder()
var text = searchBar.text
var url = NSURL(string: text) //type "http://www.apple.com"
var req = NSURLRequest(URL:url!)
self.webview!.loadRequest(req)
}
override func viewDidLoad() {
super.viewDidLoad()
self.searchbar.delegate = self
}
}
I have no clue why its not launching the app correctly.
asked 59 secs ago
i added someones code that i found on stackoverflow for a UISearchabr and UIWebview and my app just gets stuck at the launch screen for minutes
Aucun commentaire:
Enregistrer un commentaire