At work, they were given the task to write an application on ios, in which there will be only a web-view, which will open the desired site. I am using x-code version 8.0 swift language. writing the following code

class ViewController: UIViewController { @IBOutlet weak var brouser: UIWebView! let defaultURL = "https://yandex.ru" override func viewDidLoad() { super.viewDidLoad() self.brouser.loadRequest(NSURLRequest(url: NSURL(string: defaultURL)! as URL) as URLRequest) } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. }} 

A white application window appears on the emulator and nothing else happens. Please tell me how to fix it.

  • Add a description of what you think the code should do. - Anatol
  • I launched the application and it opened yandex.ru google.ru mail.ru habrahabr.ru, but the site I need does not tear, as I understand it opens only the https version of the site with the mobile version, and ignores others, I don’t understand how to fix it - Ilya

1 answer 1

You need in Info.plist to allow download via http.

enter image description here

Or specify Exception Domains