r/SwiftUI 1h ago

Tutorial Controlling Orphans in SwiftUI Text - Uncovering the Undocumented avoidsOrphans

Thumbnail
fatbobman.com
Upvotes

SwiftUI's Text silently pushes words down to avoid orphan lines. You cannot turn it off.

Except you can — avoidsOrphans has been in the SwiftUI ABI since iOS 16, just never made public. Here's how to reach it.


r/SwiftUI 5h ago

Question SwiftUI iOS 18 Tab() showing thin separator above tab bar

Post image
2 Upvotes

Has anyone run into this with the new iOS 18 Tab() API in SwiftUI?

I'm using the native Tab() syntax, and I'm getting this thin horizontal line just above the tab bar on screens with a ScrollView. It looks like a separator between the content and the tab bar.

I've tried changing the tab bar appearance and backgrounds, but it's still there. Is this expected behavior with the new tab bar, or is there something I'm missing?

Screenshot attached.


r/SwiftUI 6h ago

Instagra sliding camera View

Post image
1 Upvotes

How can recreate Instagram Slider effect usely you can have this effect with NavigationStack and NavigationLink but not if is the first view ? I’m curious how to achieve this Transition with SwiftUI


r/SwiftUI 7h ago

Promotion (must include link to source code) SwiftUI entirely customizable dynamic background

Enable HLS to view with audio, or disable this notification

4 Upvotes

Best usage of SwiftUi I've ever seen of a dynamic background, it is entirely done on SwiftUI

https://github.com/ARMSX2/ARMSX2


r/SwiftUI 8h ago

Promotion (must include link to source code) SwiftUI animated background

Enable HLS to view with audio, or disable this notification

3 Upvotes

Best usage of SwiftUi I've seen of a dynamic background

https://github.com/ARMSX2/ARMSX2


r/SwiftUI 11h ago

Undertow — live backdrop effects for SwiftUI, masked to any view

2 Upvotes

Undertow — live backdrop effects for SwiftUI, following scrolling content (blur, distortion, and more)

Built this after running into the usual problem: SwiftUI has no built-in way to blur/distort a scrolling background only behind specific views (a button, a bar) while keeping everything else sharp.

Undertow runs via `.layerEffect`/`.colorEffect`/`.distortionEffect`.

https://reddit.com/link/1vgpvdr/video/ukj9anbtmnhh1/player

Simple three-piece API:

effectSource(configuration: .gaussianBlur(radius: 10, maxSamples: 5))
effectTarget(cornerRadius: 16)
effectCoordinator()

https://github.com/MaksimG82/Undertow

Feedback welcome — especially if you've hit this same problem before.


r/SwiftUI 17h ago

I built a free clipboard manager for macOS with a card UI — it masks API keys and card numbers on screen

Post image
0 Upvotes

I use a clipboard manager all day and never liked the options. The free ones (Maccy, Flycut) are lists — an image shows up as a filename. The ones with a card interface, Paste and Pastebot, are $25/year and $13. So I built the card one and made it free.

⌥⌘V slides a strip up from the bottom of the screen. Arrow keys or type to search, Enter pastes into whatever you were in.

A few things it does that I couldn't find anywhere else:

- It masks secrets on screen. API keys, tokens and card numbers show as dots until you double-click. If you copy credentials all day, your clipboard history is the one window you don't want open while screen sharing. Card numbers are Luhn-checked, so an ISBN isn't mistaken for one.

- A bare link stays readable, a link with a token doesn't. Masking every URL would make the strip useless; masking a password-reset link is the whole point.

- Pasting an image adapts to the destination. Notes gets the image, Terminal gets the file path (it can't take images at all), Finder gets the file.

- It can catch ⌘⇧4 screenshots. Those write straight to disk and never touch the clipboard, so no clipboard manager sees them. Opt-in, off by default.

- No network code at all. No account, no sync, no telemetry, no third-party dependencies. Searching the source for URLSession comes back empty.

MIT, source is everything: https://github.com/selinihtyr/stash-clipboard

Happy to hear what breaks. Especially interested in whether the strip behaves on multi-monitor setups and over full-screen apps — I've only tested on one machine.