gualtierofrigerio / WKWebViewDownloadHelper

Download a file from a WKWebView
37 stars 16 forks source link

Cannot convert value of type '[webview.MimeType]' to expected argument type '[WKDownloadHelper.MimeType]' #5

Open MartinDeBeer opened 2 years ago

MartinDeBeer commented 2 years ago

I am trying to use your code, but it's giving me this error Cannot convert value of type '[webview.MimeType]' to expected argument type '[WKDownloadHelper.MimeType]' and nothing I do is fixing it.

let mimeTypes = [
            MimeType(type: "pdf", fileExtension: "pdf"),
            MimeType(type: "jpg", fileExtension: "jpg"),
            MimeType(type: "png", fileExtension: "png")
        ]
downloadHelper = WKDownloadHelper(webView: webView, supportedMimeTypes: mimeTypes, delegate: self)

Any help would be appreciated, thank you in advance

gualtierofrigerio commented 2 years ago

Hi, are you using my SPM package https://github.com/gualtierofrigerio/WKDownloadHelper? Try this solution https://github.com/gualtierofrigerio/WKDownloadHelper/issues/4

rogerwh commented 2 years ago

This happens to me, but the solution that you share before its not working. Could you help me pls?

image

gualtierofrigerio commented 2 years ago

I saw you also commented the other issue where I suggested the workaround, but you have a different problem there. This problem happens after you add the typealias?

MartinDeBeer commented 2 years ago

Honestly bro, I got annoyed and decided to rather just use the add to home feature instead of struggling with Apple, because I got it to work and then I found out that you can't save files to the file explorer

Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: Gualtiero @.> Sent: Saturday, August 20, 2022 5:45:33 PM To: gualtierofrigerio/WKWebViewDownloadHelper @.> Cc: MartinDeBeer @.>; Author @.> Subject: Re: [gualtierofrigerio/WKWebViewDownloadHelper] Cannot convert value of type '[webview.MimeType]' to expected argument type '[WKDownloadHelper.MimeType]' (Issue #5)

I saw you also commented the other issue where I suggested the workaround, but you have a different problem there. This problem happens after you add the typealias?

— Reply to this email directly, view it on GitHubhttps://github.com/gualtierofrigerio/WKWebViewDownloadHelper/issues/5#issuecomment-1221339507, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ATARRC67XEGBMJVBOX3AUL3V2D4R3ANCNFSM5ZUCK75Q. You are receiving this because you authored the thread.Message ID: @.***>