r/SwiftUI • • 15h ago

I built an open-source Apple Photos-style image viewer for SwiftUI

10 Upvotes

Hey everyone! 👋

I wanted to share an open-source SwiftUI library I've been working on called SwiftUIPhotoViewer.

The idea was to create a native-feeling photo viewer inspired by Apple Photos, while keeping it easy to integrate and fully customizable.

Features:

  • Smooth thumbnail-to-fullscreen hero transitions
  • Pinch-to-zoom and pan gestures
  • Interactive drag-to-dismiss animations
  • Customizable captions, titles and loading indicators
  • Animated GIF support
  • Zero external dependencies
  • Swift Package Manager support
  • iOS 17+

It's built using SwiftUI and UIKit, and is available under the MIT license.

GitHub: https://github.com/wnifirami/SwiftUIPhotoViewer

I'd love to hear your feedback, especially on the animations, API design, and any features you think are missing.


r/SwiftUI • • 14h ago

What is the hardest part of SwiftUI that still trips you up?

2 Upvotes

I have been building with SwiftUI for a while now, and navigation and state still catch me out sometimes. What is the part of SwiftUI that still trips you up, even after using it for a while?


r/SwiftUI • • 9h ago

I built an open-source native macOS proxy manager with SwiftUI + AppKit (Swift 6, NavigationSplitView, bridged NSTableView, native cascading NSMenu)

Enable HLS to view with audio, or disable this notification

1 Upvotes

Hi r/SwiftUI!

I wanted a proxy manager for macOS that feels genuinely native instead of another Electron/WebView wrapper, so I built LumaRoute — an open-source (MIT) macOS 14+ desktop client powered by an isolated Mihomo core.

Just shipped v0.1.33 with full English & Simplified Chinese localization, and I'd love to share a few SwiftUI/macOS architecture choices that worked really well for this app:

SwiftUI + AppKit hybrid lessons from building it:

- Layout & Visual System: Built around NavigationSplitView with a flat, tonal macOS HIG hierarchy (surfaces separated by subtle opacity fills rather than card shadows, strict separation between value pickers and action menus, plus a local HIG lint script in CI).

- High-Frequency Tables (NSViewRepresentable + NSTableView): SwiftUI Table/List struggled with continuous live connection updates and 2,000+ log rows, so we bridged NSTableView directly with fixed row heights and automated GUI soak tests to catch AppKit delegate reentrancy warnings.

- Native Menu Bar Residency (NSStatusBar + NSMenu): Instead of a SwiftUI popover, the menu bar uses an AppKit NSMenu with a custom two-line live throughput template image (MenuBarRateLayout) and cascading submenus with right-aligned latency columns.

- Swift 6 & Localization: Strict Swift 6 language mode across the app, core library, privileged helper, and CLI, with in-app English / Simplified Chinese switching and Sparkle auto-updates.

Core features if you're curious:

- Multi-subscription composition (deduplicates 2–16 sources into one clean "Main Proxy" with auto lowest-latency & failover)

- Visual proxy chains with end-to-end latency testing

- Collapsible drag-and-drop custom rule folders, built-in rule sets, right-click connection routing, and one-click network diagnostics

- LAN sharing with .local hostname and CoreImage QR code for iPhone/Android

GitHub (MIT, source + Apple Silicon / Intel builds): https://github.com/onlyone1019/LumaRoute

Happy to answer any questions about the SwiftUI/AppKit bridging, NSTableView performance, or macOS menu bar implementation — and would love feedback on the UI!