Skip to content

Commit

Permalink
Fix Xcode warning
Browse files Browse the repository at this point in the history
fix the waning: [WKWebView _setDrawsTransparentBackground:] is deprecated and should not be used.
  • Loading branch information
caocanx committed May 16, 2023
1 parent 69ff50a commit f0387fc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Sources/MarkdownWebView/MarkdownWebView.swift
Expand Up @@ -82,7 +82,12 @@ public struct MarkdownWebView: PlatformViewRepresentable {

/// Set transparent background.
#if os(macOS)
self.platformView.setValue(true, forKey: "drawsTransparentBackground")
if NSAppKitVersion.current.rawValue > 1500 {
self.platformView.setValue(false, forKey: "drawsBackground")
}
else {
self.platformView.setValue(true, forKey: "drawsTransparentBackground")
}
#elseif os(iOS)
self.platformView.isOpaque = false
#endif
Expand Down

0 comments on commit f0387fc

Please sign in to comment.