QLPreviewRepresentedView
public struct QLPreviewRepresentedView: NSViewRepresentable
Show a QL preview of an URL
Note
I don’t use the SwiftUI.quickLookPreview($url)
here because
that seems to conflict with a NSTextView
in a `NSViewRepresentable.
Unsaved documents cannot be previewed on macOS 14 for some unknown reason…
-
The URL to view
Declaration
Swift
var url: URL
-
Init the
View
Declaration
Swift
public init(url: URL)
Parameters
url
The URL to view
-
Make the
View
Declaration
Swift
public func makeNSView(context: NSViewRepresentableContext<QLPreviewRepresentedView>) -> QLPreviewView
-
Update the
View
Declaration
Swift
public func updateNSView( _ nsView: QLPreviewView, context: NSViewRepresentableContext<QLPreviewRepresentedView> )