You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
thread '' panicked at 'Class with name UIViewController could not be found', /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/wry-0.26.0/src/webview/wkwebview/mod.rs:615:21
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
Steps To Reproduce
// we add a download handler to save the png file
let init_view = init_view.with_download_started_handler(move |_, suggested_path| {
// we change the suggested_path to the export_image
if !export_image.is_empty() {
let new_path = PathBuf::from(&export_image).as_path().to_path_buf();
*suggested_path = new_path.clone();
true
} else {
true
}
});
let init_view =
init_view.with_download_completed_handler(move |_uri, filepath, success| {
if !success {
println!(
"Failed to download to {}",
filepath.unwrap_or_default().to_str().unwrap_or_default()
);
} else if !minimized {
println!(
"Fished downloading to {}",
filepath.unwrap_or_default().to_str().unwrap_or_default()
);
}
});
Expected behavior
This would work
Screenshots
If applicable, add screenshots to help explain your problem.
Platform and Versions (please complete the following information):
OS: Mac
Rustc:
Would you want to assign yourself to resolve this bug?
Yes
No
Additional context
Add any other context about the problem here.
// Download handler
let download_delegate = if attributes.download_started_handler.is_some()
|| attributes.download_completed_handler.is_some()
{
let cls = match ClassDecl::new("WryDownloadDelegate", class!(NSObject)) {
Some(mut cls) => {
cls.add_ivar::<*mut c_void>("started");
cls.add_ivar::<*mut c_void>("completed");
cls.add_method(
sel!(download:decideDestinationUsingResponse:suggestedFilename:completionHandler:),
download_policy as extern "C" fn(&Object, Sel, id, id, id, id),
);
cls.add_method(
sel!(downloadDidFinish:),
download_did_finish as extern "C" fn(&Object, Sel, id),
);
cls.add_method(
sel!(download:didFailWithError:resumeData:),
download_did_fail as extern "C" fn(&Object, Sel, id, id, id),
);
cls.register()
}
None => class!(UIViewController),
};`
I think this class at the bottom needs to be the same name as the "WryDownloadDelegate" so should be - (None => class!(WryDownloadDelegate))
it looks like #815 and #817 forgot to change this other var name? It works if we dont call it
The text was updated successfully, but these errors were encountered:
Describe the bug
thread '' panicked at 'Class with name UIViewController could not be found', /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/wry-0.26.0/src/webview/wkwebview/mod.rs:615:21
note: run with
RUST_BACKTRACE=1
environment variable to display a backtraceSteps To Reproduce
Expected behavior
This would work
Screenshots
If applicable, add screenshots to help explain your problem.
Platform and Versions (please complete the following information):
OS: Mac
Rustc:
Would you want to assign yourself to resolve this bug?
Additional context
Add any other context about the problem here.
I think this class at the bottom needs to be the same name as the "WryDownloadDelegate" so should be - (None => class!(WryDownloadDelegate))
it looks like #815 and #817 forgot to change this other var name? It works if we dont call it
The text was updated successfully, but these errors were encountered: