ja dostaję ten błąd:"Nie można wywołać wartość typu non-funkcyjny 'HTTPURLResponse?" (Alamofire 4.0) [Swift 3.0]
"Cannot call value of non-function type 'HTTPURLResponse?'"
na odcinku:
.response { (request, response, data, error)
i zastanawiałem się, czy ktoś może mi w tym pomóc.
Alamofire.download(urlToCall, method: .get) { temporaryURL, response in
if FileManager.default.fileExists(atPath: finalPath!.path!) {
do {
try FileManager.default.removeItem(atPath: finalPath!.path!)
} catch {
// Error - handle if required
}
}
return finalPath!
}
.response { (request, response, data, error) in
if error != nil {
}
var myDict: NSDictionary?
let path = finalPath!
myDict = NSDictionary(contentsOf: path)
if let dict = myDict {
success(dict)
}
if finalPath != nil {
//doSomethingWithTheFile(finalPath!, fileName: fileName!)
}
}
prawdopodobnie związane: http://stackoverflow.com/q/32932748/3303915 –
Nie. Podobny problem, ale nie taki sam. Różne wersje szybkich i alamofire. –
Czy kierujesz na system iOS 8? Nie znam powodu, ale Alamofire dla Swift 3 musi być co najmniej iOS 9. Pozdrawiam –