r/SwiftUI • • 20h ago

Question How to recreate the native draggable tab bar indicator without the background?

3 Upvotes

Hey everyone,
I’m currently developing a Swift app and want to recreate the native iOS tab bar interaction, but with just the text labels and the draggable selection pill, without the surrounding tab bar background.
The ChatGPT iOS app implemented pretty much exactly what I’m looking for in a recent update.
I’ve already tried a bunch of different approaches:

  • Modifying existing tab bar recreations on GitHub to remove the background
  • Looking for standalone implementations of the draggable selection pill
  • Exploring projects that use undocumented APIs

Unfortunately, most of these approaches are either too limited or don’t quite capture the native look and feel, especially when it comes to animations and dragging behavior.
Does anyone have an idea how to achieve this? Ideally using public APIs, but I’d also be interested in understanding how ChatGPT implements it.
I’ve attached a screen recording showing exactly what I’m trying to achieve.
Any help would be greatly appreciated!


r/SwiftUI • • 8h ago

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

Post image
9 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 • • 21h ago

Scaffolding 4.0 - full Stinsen usage parity

Thumbnail
github.com
3 Upvotes

Hey!

Just released Scaffolding 4.0. It's a SwiftUI coordinator pattern navigation library for iOS 18+ that's made as a Stinsen spiritual successor, for iOS 18 and above.

As this is a major update, many things have changed and are well documented in docs https://dotaeva.github.io/scaffolding/documentation/scaffolding/migratingto4.

Most notable change, which brings Stinsen's type safety to the table is move to typed routes. Routes are no longer automatically handled by Macro, but need to be annotated as `@Route`. This mitigates the need for user to specify expected typed when deeplinking. Usage becomes easier while avoiding Stinsen's keypaths, thus allowing autocomplete and compiler to help fully.

Apart from this, async has been preferred for a few patches, but now it's the only to use for specific scenarios where they are used. Closure syntax has now been removed. API's have been cleaned as well as code under the hood.

// 3.x
func settings() -> any Coordinatable { SettingsCoordinator() }


route(to: .settings, expecting: SettingsCoordinator.self)?
    .route(to: .account)


// 4.0
@Route func settings() -> SettingsCoordinator { .init() }


route(to: .settings)?
    .route(to: .account)

r/SwiftUI • • 22h ago

Drop Banner - A fluid in-app banners for SwiftUI

30 Upvotes

DropBanner, a banner that slides down from the top of the screen in a smooth, fluid way, Inspired by @jumeh work on X

It slides down smoothly and either pushes your screen down or floats over it as a card. Put any SwiftUI view inside.

iOS 17+, MIT

source: https://repgem.com/drop-banner-ios

Would love your feedback!


r/SwiftUI • • 23h ago

Promotion (must include link to source code) Open-sourced BentoKit (MIT): Offscreen SwiftUI .glassEffect(.regular) Metal renderer + Apple 20x12 Bento & carousel toolkit

Thumbnail
gallery
18 Upvotes

We have been building, using, and refining this internally for our Mac app Droppy for months, and just open-sourced the full codebase under the MIT license.

A big part of making Apple WWDC-style release Bentos look right is getting genuine macOS Liquid Glass refraction on hero typography, SF Symbol strips, and shortcut keycaps without opening any app window or faking it with CSS blur. Here is how the SwiftUI rendering pipeline works under apple-bento/src/:

1. Offscreen SwiftUI .glassEffect into Metal (glassword.swift, glyph.swift, keycaps.swift)
- glassword.swift turns a string into exact vector outlines using CoreText (CTLineCreateWithAttributedString + CTFontCreatePathForGlyph) inside a custom SwiftUI Shape (GlyphShape), optionally rounding corners via path stroking/union and supporting per-glyph or GlassEffectContainer composition.
- It renders Color.clear.glassEffect(.regular, in: shape) (or .clear with tint/stack options) over a backdrop image inside an NSHostingView hosted in a custom OffscreenWindow subclass (NSWindow overriding isKeyWindow, isMainWindow, _hasActiveAppearance, and no-op orderFront so nothing ever appears on screen).
- The layer tree is rasterized headless via Core Animation CARenderer directly into an offscreen MTLTexture at @3x, and we also emit a pixel-registered --noglass baseline so glass_proof.py can generate a 400% rim refraction diff proof.
- glyph.swift does the same for native SF Symbols: it parses the symbol's vector PDF drawing commands with CGPDFScanner to reconstruct clean CGPath outlines, then applies .glassEffect with left-to-right color stops across a symbol row.

2. Icon Composer ictool + calibrated bezels + 20x12 CoreGraphics composer
- make_icon.py builds multi-layer vector SVG .icon bundles and invokes Xcode's ictool --platform macOS --design-generation 27 for Default, Dark, ClearLight, and ClearDark renditions.
- compose.swift and tilt3d.swift handle the 20x12 Apple recap templates, 4-panel flowing social carousels (4800 x 1500 into four 1200 x 1500 panels), Core Animation 3D tilted UI stages, and procedural dithered tile backgrounds.
- bezel.py ships 9 calibrated Apple hardware bezels (MacBook Pro ProLED, MacBook Pro Notch, MacBook Air, MacBook Neo, Studio Display XDR, iMac, iPhone Pro) with display-cutout validation.

The attached renders were all produced straight from the CLI (meta Reddit Bento, X Bento, flowing 4-panel Facebook carousel, and the BentoKit overview). Requires macOS 26+ and Xcode 26+.

Full source (MIT): https://gitlab.com/droppyformac1/bentokit


r/SwiftUI • • 17h ago

Promotion (must include link to source code) A couple of weeks ago I shared my SwiftUI real-time stem separation app here. It now has a click track, transpose and a speed control (open source)

21 Upvotes

Hi all! A couple of weeks ago I posted Stelix here. It's a menu bar app that splits whatever your Mac is playing into vocals, drums, bass and other while it plays, with a slider for each one. I've shipped two updates since then, so here's what changed.

You can now transpose Live and Studio up or down by up to 12 semitones, and the drums aren't shifted with the rest. There's a click on the beats of the song, in both modes, where you pick the meter, the accent and the sound, or load a sound of your own. In Studio you can play the stems anywhere from 20% to 200% speed without changing the pitch, and save them at that speed. The BPM and the key of the song are shown above the controls and change when the song does.

The click, BPM and key come from Apple's on-device Music Understanding framework, so they need macOS 27. Transpose and speed work from macOS 15.

On the SwiftUI side I redesigned the panel. Transpose, speed and the click settings now sit in one "Controls" box under the stem sliders, with the BPM and key in its header. It uses Liquid Glass on macOS 26 and later, and the older look before that.

Source (GPL-3.0): https://github.com/stelix-app/stelix

Website and download: https://getstelix.com

If you already have it, it will offer the update by itself. I've only been able to test on macOS 27, so if you're on 15 or 26 I'd like to know whether it works for you, thanks!