Implementing a complex vector art app in SwiftUI (macOS)?

For years I've poked at a little personal project, an electronic schematic capture app. It's basically a specialized version of something like Illustrator or Omnigraffle, in that you create graphical objects from primitives, instantiate them onto the canvas, and connect them with polylines.

I'm very new to SwiftUI, but I'm wondering if it makes sense to build a new custom view to handle drawing this canvas as a "native" SwiftUI view. I know it's possible to wrap NSViews in SwiftUI, but if SwiftUI can handle it, I'd like to just reimplement it.

There are a number of requirements that complicate things:
  • This view lives inside a scroll view (or at least, it has bounds that usually extend beyond the window).

  • The view contains custom graphics and text.

  • Some graphical elements span large portions of the canvas (e.g. the poly lines connecting components).

  • The number of individual elements can be quite high (performance concerns). Quadtrees are often used to help with this.

  • It zooms

  • Marquee-selection

  • Mouse down, drag, and up changes the model in significant and varied ways.

  • Hovering can change appearance of some items.

Can SwiftUI handle all this? I tried to find an example or documentation, but was not having much luck. Almost everything is iOS-focused, so precise and nuanced mouse handling is uncommon.

Implementing a complex vector art app in SwiftUI (macOS)?
 
 
Q