Merge pull request #8 from lemarier/fix/webview-ios

fix(webview): `setWantsLayer` selector is not available on iOS
This commit is contained in:
Ryan McGrath 2021-04-25 16:07:20 -07:00 committed by GitHub
commit 650d8c472d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -71,7 +71,10 @@ fn allocate_webview(
let zero: CGRect = Rect::zero().into(); let zero: CGRect = Rect::zero().into();
let webview_alloc: id = msg_send![register_webview_class(), alloc]; let webview_alloc: id = msg_send![register_webview_class(), alloc];
let webview: id = msg_send![webview_alloc, initWithFrame:zero configuration:configuration]; let webview: id = msg_send![webview_alloc, initWithFrame:zero configuration:configuration];
#[cfg(target_os = "macos")]
let _: () = msg_send![webview, setWantsLayer:YES]; let _: () = msg_send![webview, setWantsLayer:YES];
let _: () = msg_send![webview, setTranslatesAutoresizingMaskIntoConstraints:NO]; let _: () = msg_send![webview, setTranslatesAutoresizingMaskIntoConstraints:NO];
if let Some(delegate) = &objc_delegate { if let Some(delegate) = &objc_delegate {