2016-12-12 5 views
1

Wie kann ich den Wert NSErrorFailingURLStringKey in swift für ein UIWebView didFailLoadWithError drucken?swift uiwebview NSErrorFailingURLStringKey

Ich habe localizedDescription und andere Optionen für NSError, aber auf der Suche nach NSErrorFailingURLStringKey String.

Ist das möglich? Bitte helfen Sie.

Vielen Dank im Voraus.

Antwort

0
first your question not saying clear. 
var res = (task.response as! HTTPURLResponse) 
    print(" status code ->\(Int((res as! HTTPURLResponse).statusCode))") 
    do { 
     if res.statusCode == 440 { 
      // handel error here. 
     } 
     else if res.statusCode == 308 { 
      // handel error here. 
     } 
     else if res.statusCode == 400 || res.statusCode == 500 { 
      var dictFromData = try JSONSerialization.jsonObject(withData: error.userInfo![AFNetworkingOperationFailingURLResponseDataErrorKey], options: NSJSONReadingAllowFragments)! 
      // handel error here. 
     } 
     else { 
      // handel error here. 
     } 

    } 
    catch { 
    } 
Verwandte Themen