Cartography icon indicating copy to clipboard operation
Cartography copied to clipboard

Namespace collision with SwiftUI 'View'

Open brzzdev opened this issue 1 year ago • 1 comments

https://github.com/robb/Cartography/blob/d0dc3f340dec22c96255ca385ff4b9e45fbe9b8e/Cartography/View.swift#L13 https://github.com/robb/Cartography/blob/d0dc3f340dec22c96255ca385ff4b9e45fbe9b8e/Cartography/View.swift#L22

causes 'View' is ambiguous for type lookup in this context when using Cartography in the same file as a SwiftUI View. For example, with HostingViews.

It can be fixed by specifying SwiftUI.View and var body: some SwiftUI.View, but seems best to avoid clashing with built-in types.

brzzdev avatar Mar 08 '23 21:03 brzzdev

Also collides with Context from both UIViewRepresentable and NSViewRepresentable

brzzdev avatar Oct 05 '23 22:10 brzzdev