Skip to content

Instantly share code, notes, and snippets.

@MojtabaHs
Created January 8, 2020 09:05
Show Gist options
  • Save MojtabaHs/acd2b7cf2eb7ddba8df6177d2526a3ea to your computer and use it in GitHub Desktop.
Save MojtabaHs/acd2b7cf2eb7ddba8df6177d2526a3ea to your computer and use it in GitHub Desktop.
struct <#NSViewForSwiftUI#>: NSViewRepresentable {
typealias TheNSView = <#The Original UIView Type#> /* e.g. NSProgressIndicator */
var configuration = { (view: TheNSView) in }
func makeNSView(context: NSViewRepresentableContext<ProgressIndicator>) -> NSProgressIndicator {
TheNSView()
}
func updateNSView(_ nsView: NSProgressIndicator, context: NSViewRepresentableContext<ProgressIndicator>) {
configuration(nsView)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment