swift-cross-ui icon indicating copy to clipboard operation
swift-cross-ui copied to clipboard

Improve interoperability with native UI frameworks

Open stackotter opened this issue 6 months ago • 1 comments

This PR introduces various APIs related to improving interoperability between SwiftCrossUI view code and native UI frameworks. This includes:

  • Making it easier to make platform-specific modifications to the native widgets behind SwiftCrossUI views via the inspect family of modifiers
    • This allows people to work around missing SwiftCrossUI features and to access niche platform-specific APIs that we don't plan on wrapping
  • Enabling the hosting of SwiftCrossUI views in native apps via the FooHostingView family of types
  • Enabling the hosting of native views in SwiftCrossUI apps via the FooRepresentable family of types
    • (SwiftCrossUI already NSViewRepresentable, UIViewRepresentable and UIViewControllerRepresentable, but we still need to introduce similar APIs for the non-Apple backends)

So far I've completed the inspect family of view modifiers (which are housed in each backend), and introduced an AdvancedCustomizationExample app to showcase these new advanced customization APIs.

stackotter avatar Jun 26 '25 06:06 stackotter