Bug
When you try to extend from NSViewRepresentable but you have a class named Context
swift throws a error message that doesn't help at all.
Type 'MetalViewRepresentable' does not conform to protocol 'NSViewRepresentable'
Steps to reproduce
- Create a MacOS App
- Copy this code
struct MetalViewRepresentable: NSViewRepresentable {
@Binding var metalView: MTKView
func makeNSView(context: Context) -> some NSView {
metalView
}
func updateNSView(_ uiView: NSViewType, context: Context) {
}
}
- Write this line of code in any file
class Context {}