Invalid conversion from throwing function of type '(AFDownloadResponse)

 Problem:

I had the error as like below

Invalid conversion from throwing function of type '(AFDownloadResponse<URL?>) throws -> Void' (aka '(DownloadResponse<Optional<URL>, AFError>) throws -> ()') to non-throwing function type '(AFDownloadResponse<URL?>) -> Void' (aka '(DownloadResponse<Optional<URL>, AFError>) -> ()')


 I had added the line below after that error came


                        let fileURLs = try FileManager.default.contentsOfDirectory(at: URL(string: path)!, includingPropertiesForKeys: nil)



Firebase download after that added the above line then error came

Solution:

The error came because of you don't handled the try block.After added with do and catch block error was removed.Happy coding

                    do {


                        let fileURLs = try FileManager.default.contentsOfDirectory(at: URL(string: path)!, includingPropertiesForKeys: nil)

                            }

                            catch {

                            }



Comments

Popular posts from this blog

Invalid bundle error while upload the app to the app Store

Saved Image in document directory and save path in coredata not able to fetch the image file iOS swift