robb / Cartography

A declarative Auto Layout DSL for Swift :iphone::triangular_ruler:
Other
7.35k stars 526 forks source link

Namespace collision with SwiftUI 'View' #349

Open brzzdev opened 1 year ago

brzzdev commented 1 year ago

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 commented 9 months ago

Also collides with Context from both UIViewRepresentable and NSViewRepresentable