UIWebView's “loadData” method does not accept nil for baseURL in Swift 2
问题 I don't want to pass any value to baseURL parameter in loadData method of UIWebView . In Swift 1.2, nil works fine: self.loadFundInfo.loadData(responseData, MIMEType: contentType, textEncodingName: "", baseURL: nil) In Swift 2.0, how to do the same thing? I am getting this error: Nil is not compatible with expected argument type NSURL 回答1: The error message is rather self-explanatory: the baseURL parameter must now be of type NSURL , not NSURL? (not an optional anymore, so it can not be nil).