在Swift2中,我使用了以下代码:letpath=NSBundle.mainBundle().pathForResource("Document",ofType:"pdf")!leturl=NSURL.fileURLWithPath(path)webView.loadRequest(NSURLRequest(URL:url))现在,使用Xcode8和Swift3,Xcode自动将其转换为:letpath=Bundle.main.pathForResource("Translation",ofType:"pdf")!leturl=URL.fileURL(withPath:path)we