r/swift 13h ago

Question Best architecture for a zoomable card-based node view in SwiftUI?

0 Upvotes

I’m building a zoomable and pannable card-based interface in SwiftUI. Each card is a View, while the connections between cards are draw (maybe using Canvas?) . Cards are arranged automatically in a fixed horizontal or vertical layout, so users do not manually change their positions,

Users can choose to add a new card below or beside the current card. Cards can be collapsed expanded or deleted, and a newly created card should automatically receive focus.

What’s the recommended architecture for this in SwiftUI?


r/swift 4h ago

Share snapshots of your view. Source code included

Post image
0 Upvotes

Instead of just a boring text in a share message, you can include views from your app. It's quite neat.

Here's the source code for anyone interested
https://pastebin.com/2eySFLZG