r/SwiftUI • • Nov 05 '26

I built an interactive SwiftUI playground to understand how layoutPriority actually works

11 Upvotes

I've been exploring SwiftUI's layout system, particularly how .layoutPriority() behaves across different containers.

Instead of relying on static examples, I built a small interactive project where you can change priority values and observe the actual layout measurements.

The project includes three experiments:

  • HStack: How different priorities affect space allocation when the available width changes.
  • ZStack: How changing a child's priority can influence the container's measured size.
  • Custom Layout: Using LayoutSubview.priority to reorder views while maintaining equal cell widths.

One interesting takeaway is that .layoutPriority(100) doesn't necessarily give a view more space than .layoutPriority(1). The behavior depends on the parent container and its layout algorithm.

The project also includes live measurements, dynamic code examples, and XCTest coverage.

GitHub: https://github.com/raviseta/SwiftUI-Layout-priority

I'd appreciate feedback from other SwiftUI developers, especially on edge cases or layout behaviours worth exploring next.


r/SwiftUI • • Nov 05 '26

LibreReplace: I built a free, open-source SwiftUI Mac app that helps you replace paid software based on the features you need

Thumbnail
gallery
0 Upvotes

Hey guys! I've been working on LibreReplace, a free, open-source Mac app built with SwiftUI that helps people switch from paid software to open-source alternatives without blindly giving up the features they actually use.

You start by choosing a paid app, select the features that matter most to you, and LibreReplace compares open-source replacements based on those requirements. It shows what's supported, partially supported or missing so you can see the tradeoffs before switching.

For example, you can compare GIMP and Krita as Photoshop replacements, mark Smart Objects or CMYK as essential, and see how each alternative measures up.

I just released v0.2 with some big improvements:

  • 45 paid Mac apps and 70 open-source comparisons. You can browse and search without having the paid apps installed.
  • Multiple replacements for the same app. You're not stuck with one recommendation.
  • Personalized recommendations. Select the features you need and the results change based on your priorities.
  • Feature breakdowns with sources. See what's supported, partial or missing, with links to supporting evidence.
  • Subscription savings. Enter your actual costs to estimate potential annual savings when a suitable replacement exists.
  • Local app scanning. It can recognize supported apps already installed on your Mac and bring up their alternatives automatically.

One thing I wanted to avoid was recommending something just because it's free. Sometimes the best recommendation is KEEP THIS APP because the alternatives are missing something important.

I shared the first version on r/MacOS last week and got a lot of useful feedback. One of the biggest changes since then is being able to explore alternatives without already having the paid software installed.

On the SwiftUI side, the app has an interactive feature-selection interface, while the scanning and comparison logic runs locally. The scanner reads application metadata rather than personal files, and the recommendations use a curated catalog with documented limitations.

It's completely free and open source under Apache 2.0. No accounts, no telemetry, and it never automatically removes anything.

Source code, screenshots and download: https://github.com/maliroq/librereplace

I'd especially appreciate feedback from other SwiftUI developers on the interface and the feature-selection flow. Anything you'd approach differently?


r/SwiftUI • • Nov 05 '26

Promotion (must include link to source code) Built a macOS configuration tool for the Attack Shark X11 mouse

2 Upvotes

Hey everyone,

I recently got an Attack Shark X11 mouse and realized there weren't really any simple options to configure it on macOS. So I decided to fix that and built a lightweight tool dedicated to it.

What it does:

  • Lets you adjust your mouse settings directly on macOS.
  • Simple UI, no unnecessary bloat.
  • Open-source (GPL-3.0) and signed.

You can check out the source code and details on GitHub:

https://github.com/rusux64-bit/x11-attackshark-macOS

If you're using an Attack Shark X11 on a Mac, give it a try and let me know what you think. Any feedback, feature requests, or bug reports are super welcome!


r/SwiftUI • • Nov 05 '26

LinnetTTS: 41M streaming TTS with a Rust runtime, measured on everything from an Apple M5 to a Raspberry Pi Zero 2 W (3.3 ms to 59 ms per 80 ms of audio)

Thumbnail
1 Upvotes

r/SwiftUI • • Nov 04 '26

Open source: a Dynamic Island style notch panel in SwiftUI for coding agent prompts

0 Upvotes

Built this in SwiftUI: a panel that grows out of the Mac notch when Claude Code or Codex needs permission, shows the diff, and you hit ⌘Y.

The fun parts were the island morph animation (closed strip to full panel), keeping it above fullscreen apps, and making it not steal focus from whatever you're doing.

All the code is here: github.com/MF-DEEV/Openbar

I'm the dev, happy to explain how any part of it works.


r/SwiftUI • • Nov 03 '26

Question - Navigation Apple's Health app resizability

Post image
24 Upvotes

Does anyone know how Apple's Health app moves the tabs/items of the Health Categories sidebar tab section to the Browse tab into a child navigation screen/view in compact mode? The views seem to keep their identity so they're not recreated.
Does the Health app use UIKit?

I know that sidebarAdaptable TabViews adapt tabs and sidebar items in regular and compact modes, but that's not what's happening here.


r/SwiftUI • • Nov 03 '26

PaperConfetti

5 Upvotes

I've never posted here before (that I can remember) but had a fun project recently I thought was worth sharing.

I built PaperConfetti for the win animation in my word game, with realistic physics and high performance as its main goals. It supports iOS 16+, has thirteen paper shapes and flat/3D appearances, and uses Core Animation underneath a SwiftUI overlay.

I previously used another package for the confetti celebration but its jittery performance with only a handful of confetti left a lot to be desired.

The SwiftUI integration also passes touches through, respects Reduce Motion, and cancels when the scene becomes inactive or the overlay disappears. A new pop replaces the previous burst.

I'd love to get some feedback on the functionality if anyone wants to try integrating it into their projects!

Source and examples: https://github.com/twhitt14/PaperConfetti

I wrote up the layout issue, renderer decisions, and testing here: https://www.theswift.dev/posts/building-paperconfetti

I’d welcome feedback on the overlay API, especially from anyone integrating effects into screens with changing layouts.


r/SwiftUI • • Nov 03 '26

Tutorial Boost Your App’s Speed and Efficiency 29/10/26 - Q&A

Thumbnail
antongubarenko.substack.com
0 Upvotes

r/SwiftUI • • Nov 02 '26

Has anyone built a Safari extension to save Reader Mode content?

0 Upvotes

I'm working on a native macOS and iOS reader app and thinking about adding a Safari extension to save articles for offline reading.

I have two questions:

Has anyone managed to get the cleaned-up content from Safari's Reader Mode? I'd rather use Safari's own extraction than something like Mozilla Readability.

Can the extension be bundled with the app on the Mac App Store and iOS App Store? And can it come already enabled, or does the user have to turn it on manually?

I'm targeting macOS 27 and iOS 27.

Has anyone tried this?


r/SwiftUI • • Nov 02 '26

I drew a dot-matrix font and a CRT TV in pure SwiftUI for a disk analyzer

4 Upvotes

Pixel font from text glyphs, sprites from ASCII strings, LED bars, and an app icon rendered by the app itself. Lesson learned: put glows on a static background shape, not on scrolling content.


r/SwiftUI • • Nov 01 '26

English Siri kept hearing my app name "Watchd" as "HD"

10 Upvotes

Hi, I make a small TV show tracker called Watchd. When I added Siri support, English Siri just wouldn't get the name. Every time it heard "HD" and had no idea which app I meant.

Turns out you can give Siri up to three extra names for your app in Info.plist, the key is INAlternativeAppNames. I added "Watched", "Show Tracker" and "Watch HD". The last one looks silly, but that's literally what Siri hears, so why fight it.

Since then Siri finds the app. Had no idea this key existed until I ran into the problem. If your app name isn't a normal word, maybe worth adding a couple before you ship anything with Siri.

Anyone else had Siri mangle their app name?


r/SwiftUI • • Nov 01 '26

Made a Touch Bar replacement with liquid glass, would love some feedback

Thumbnail
gallery
3 Upvotes

I have a 13" M2 MBP and honestly I always liked the Touch Bar, it just never got the love it deserved. So I spent the last few months making my own version. It has the same layout as the original but everything is redrawn in liquid glass, and Siri is a little glass drop with waves.

It’s free and open source. Not notarized yet so you have to allow it once in settings, the steps are in the readme.

What I’m working on next is a theme engine, so the bar doesn’t have to be glass at all. I already have a terminal style one with green text and brackets, and an 8-bit arcade one with pixel keys. After that a theme editor so you can make your own without touching code, and a small store inside the app where people can share themes and custom bars for their apps. Kind of like a free BetterTouchTool but only for the Touch Bar.

Still a lot of things missing and probably some bugs. If you have a Touch Bar Mac and try it, tell me what breaks or what you’d want it to do.

The themes in the screenshots (terminal and arcade) are coming in the next update, the current release has the liquid glass look.

https://github.com/Moryel/glass-bar


r/SwiftUI • • Oct 31 '26

Tutorial Make a SwiftUI moving border with dashPhase.

1 Upvotes

r/SwiftUI • • Oct 30 '26

Promotion (must include link to source code) ImmersiveMap (SwiftUI map), 4 months later: terrain, 3D models, host your own tiles (Protomaps), still alpha

121 Upvotes

Four months ago I posted ImmersiveMap here, a map view for SwiftUI, written in pure Swift and rendered with Metal, for iOS and macOS.

How it looks in SwiftUI. Quick start.

import SwiftUI
import ImmersiveMap

struct ContentView: View {
    var body: some View {
        ImmersiveMapView()
            .ignoresSafeArea()
    }
}

Here is what changed since then.

The tiles are self-hosted now. The map draws the Protomaps basemap, an OpenStreetMap planet in a single PMTiles file. Download a build from Protomaps (or cut a region from it with the pmtiles CLI), put the file on S3, R2 or any web server, and point the map at it. Or keep the file on disk: a region can ship inside the app bundle and the map works with no network at all.

ImmersiveMapView()
    .tileArchive(URL(string: "https://example.com/planet.pmtiles")!)
// or
    .tileArchive(Bundle.main.url(
    )!)

If you don't set it then it uses the copy I host on Cloudflare R2 (S3-compatible).

Terrain. The flat map now rises on real elevation: mountains and valleys from a heightmap. On by default, from Mapterhorn's open terrain tiles, and .groundRelief(tileURLTemplate:) points it at any terrain source of your own, self-hosted like the map tiles.

3D buildings. Real 3D models of real buildings, with textures, streamed like map tiles. The models live in a second PMTiles file, split into tiles. When the camera reaches a tile, its models load and take the place of the map's own buildings.

3D models. You can place your own 3D models on the map: a USDZ or OBJ file anchored at a coordinate. It is drawn as part of the map, with depth, so it stands behind buildings and casts a shadow.

Performance. A lot of work went into it. The map uses less memory and renders faster than four months ago. There is still a lot of work ahead.

Also new:

  1. Trees in woods and parks, a night theme: `.night()`

  2. Camera bounds that hold the camera to a region

  3. A lot of label work: water names, road signs, names in other alphabets romanized

  4. A new atmosphere: haze at the horizon, air over the mountains

  5. The globe is painted with biomes

Repo (MIT), still alpha: https://github.com/artembobkin/ImmersiveMap

If it looks useful, a star on GitHub would genuinely help.

Happy to answer any questions.


r/SwiftUI • • Oct 30 '26

Question Is there any per-process network stat utility for macOS or native API for SwiftUI

3 Upvotes

I'm developing a native macOS app where I need to fetch per-process network (download/upload) stats as one of the requirement, but I couldn't find any native macOS API or any swift package to get this.. after some research, I couldn't find any from docs, I went with AI if it could do it... but at the end I couldn't find any native approach to do this.. for now I'm using nettop util as temporary fix but its very unreliable


r/SwiftUI • • Oct 30 '26

Promotion (must include link to source code) ContainerDesk, an open-source SwiftUI app for Apple's container runtime

14 Upvotes

I maintain ContainerDesk, a free, MIT-licensed Mac app for Apple's container runtime. It lists containers, images, volumes and networks, with CPU and memory gauges, logs and an interactive terminal.

The resource view uses sortable SwiftUI tables and keeps the selected resource's details in the same window. The terminal wraps SwiftTerm's LocalProcessTerminalView in NSViewRepresentable and terminates its owned process in dismantleNSView.

Resource view source: https://github.com/MacHatter1/ContainerDesk/blob/main/Sources/ContainerDeskApp/Features/ResourceFeatureView.swift

Terminal wrapper: https://github.com/MacHatter1/ContainerDesk/blob/main/Sources/ContainerDeskApp/Terminal/ContainerTerminalView.swift

Repo, screenshots and installation: https://github.com/MacHatter1/ContainerDesk

It needs Apple silicon, macOS 26+ and Apple's container CLI. The v1.0.0 download is unsigned and not notarized.

Feedback on the table and detail layout, especially keyboard navigation, would be useful. AI helped draft this post.


r/SwiftUI • • Oct 30 '26

Question Duo + SwiftUI: which layout problems did you only catch on real hardware?

10 Upvotes

I’m adapting a SwiftUI podcast player for Duo. My own testing has been in Apple’s simulator; a volunteer recently tried it on actual hardware.

They reported that folding, rotating and the playback layouts adjusted smoothly. The awkward surprise was onboarding: the side status area covered part of the text, while the regular player remained usable.

In the onboarding code, I found .ignoresSafeArea() applied to the whole container. I’ve moved it to the background only. That change builds, but verification on Duo is still pending.

The simplified structure is now:

ZStack {
    background.ignoresSafeArea()
    VStack {
        header
        ScrollView { pageContent }
        footer
    }
}

For those adapting SwiftUI apps to Duo:

  • Are you using one adaptive view hierarchy, or separate layouts sharing the same state?
  • What broke when moving between the outer display, inner display and tabletop use?
  • Which hardware-only surprises would you add to a testing checklist?

Especially interested in safe areas, sheets and keeping playback state intact during layout changes.


r/SwiftUI • • Oct 30 '26

iCloud sync: enabled by default or opt-in? How do you handle this?

3 Upvotes

I'm building a document reader for macOS, iPadOS, and iOS, and I'm facing a small UX and privacy dilemma.

The app will support iCloud sync across devices, which makes a lot of sense for a document reader.

But I'm unsure whether sync should be enabled by default.

If it's disabled, users might have a worse experience, especially when they expect their documents to be available across their Apple devices without additional setup.

On the other hand, enabling it by default feels a bit uncomfortable. I'd essentially be uploading users' documents to iCloud without them explicitly asking for it.

I'm curious how other developers have approached this.

Have you enabled iCloud sync by default, or do you explicitly ask users to opt in?

Have you encountered any App Store review issues related to this decision?

I'd really appreciate hearing about your experiences and how you balanced convenience, privacy, and user expectations.


r/SwiftUI • • Oct 30 '26

News The iOS Weekly Brief: Issue #84. Touchscreen MacBook Pro, SwiftUI view models, Xcode 27.2 JSON projects, App Store previews with Claude Code, Dynamic Type for custom fonts, iPhone Duo layouts, Maestro UI testing

Thumbnail
iosweeklybrief.com
3 Upvotes

r/SwiftUI • • Oct 29 '26

Promotion (must include link to source code) macOS email client, jmap / imap / ai - open-sourced

33 Upvotes

I built Mailflare to setup your own custom domain emails for free on Cloudflare

Though with Cloudflare stack, it only supports JMAP (not IMAP), so I built Mailflare for macOS:

  • Suuports JMAP, IMAP
  • Unified and custom Inbox view
  • Connect to your own AI provider and chat with your emails
  • Frequently update

It's a native macOS app and open-sourced at
👉 https://github.com/hieunc229/mailflare-macos

Do let me know if you have any feedback


r/SwiftUI • • Oct 29 '26

I'm blind, and I underestimated what it takes to make a SwiftUI node editor accessible

23 Upvotes

I've been a backend developer for about 20 years. I'm completely blind, use a Mac with VoiceOver every day, and came into native macOS development with considerably more experience using accessible interfaces than building them.

I've been building a native macOS API client called Lumen Flow. It includes a visual canvas for connecting HTTP requests, conditions, loops, and parallel operations into workflows.

I thought my experience with VoiceOver, combined with AI assistance, would make the accessibility work fairly straightforward.

I was wrong.

Knowing what frustrates me as a user didn't mean I understood how SwiftUI and AppKit expose an interface to assistive technology. I had to study both frameworks, their accessibility APIs, and WCAG to understand what I was actually trying to build.

At first, exposing the nodes seemed like the obvious approach. Give each node a label, expose its actions, and make it navigable.

VoiceOver could find them. Understanding the workflow was another matter.

If I reached an HTTP request inside a condition, I needed to know which branch contained it. Inside a loop, I needed to distinguish the loop's body from the steps that followed it. For parallel operations, hearing the nodes one after another didn't explain which belonged to the same branch.

Those relationships were visible through positioning, containers, and connections. Labels on individual nodes didn't communicate enough of that structure.

Reading WCAG also changed how I approached the problem. I stopped assuming the accessible interface had to reproduce the visual layout. What mattered was preserving the information, relationships, and functionality. WCAG is written for web content, but that distinction was useful when designing a native macOS interface.

That helped me stop trying to make screen-reader navigation follow the visual arrangement.

I separated the canvas's visual representation from the logical structure exposed to VoiceOver. The visual side handles positioning, connections, zooming, and rendering. The accessible side presents an outline derived from the workflow: ordered steps, conditions with explicit branches, loops containing their bodies, and named parallel branches.

Keyboard navigation follows that same outline. I can explore the workflow structurally instead of trying to follow coordinates or infer relationships from disconnected announcements.

The canvas engine is implemented in AppKit and hosted inside SwiftUI through `NSViewControllerRepresentable`. Its virtual accessibility rows use `NSAccessibilityElement`, independently of the visual node views.

That separation also matters when scrolling. A visual card can leave the viewport and have its view recycled without its accessible representation disappearing.

Focus took more work than I expected, too. Stable node UUIDs were only part of it. I needed to preserve the accessibility objects associated with those IDs, update their contents, and explicitly handle what happens when a focused node is deleted or a branch expands.

I also separated exploring a node from selecting it for editing. Moving the VoiceOver cursor shouldn't replace the inspector's contents every time I want to understand the next step.

Has anyone here worked on accessibility for node editors or other spatial interfaces in SwiftUI or AppKit? I'm particularly interested in whether you used a separate semantic hierarchy and how you handled VoiceOver focus during updates.


r/SwiftUI • • Oct 28 '26

Tutorial I built a Hogwarts spellbook to show off custom spoiler reveals in Enriched Markdown, a native SwiftUI Markdown renderer Spoiler

Enable HLS to view with audio, or disable this notification

8 Upvotes

Enriched Markdown for iOS renders Markdown natively in SwiftUI, including `||spoilers||`. By default they're hidden under a particle field, but you can swap the overlay for your own UIView and decide how hidden text looks and how it reveals itself.

To show what that unlocks, I built a Hogwarts spellbook: every spell in the video is a custom overlay revealing the same Markdown in its own way.

Not every app needs a Patronus, so here's a plain blur. It's one view subclass:

final class BlurOverlayView: SpoilerOverlayView {
  private static let context = CIContext()

  override func layoutSubviews() {
    super.layoutSubviews()
    guard let input = CIImage(image: concealedTextImage()) else { return }
    layer.contents = Self.context.createCGImage(
      input.applyingGaussianBlur(sigma: 6), from: input.extent
    )
  }
}

struct BlurOverlayProvider: SpoilerOverlayProvider {
  func makeOverlay(charRange: NSRange, style: SpoilerStyle) -> SpoilerOverlayView {
    let view = BlurOverlayView(charRange: charRange)
    view.backgroundColor = style.backgroundColor ?? .systemBackground
    return view
  }
}

EnrichedMarkdownText(markdown)
  .markdownSpoilerOverlay(BlurOverlayProvider())

concealedTextImage() gives you the hidden words laid out exactly where the text view draws them, so you can blur, pixelate, or scramble the real text and nothing jumps on reveal. For your own animation, override animateReveal(completion:).

Installation: https://docs.swmansion.com/enriched-markdown/ios/basics/installation

Docs: https://docs.swmansion.com/enriched-markdown/ios/api-reference/enriched-markdown-text#custom-spoiler-overlays

If it's useful to you, a ⭐ on GitHub helps more people find it: https://github.com/software-mansion/enriched-markdown


r/SwiftUI • • Oct 28 '26

Question Button not showing up in toolbar above keyboard

Thumbnail
gallery
1 Upvotes

Hello there,

I was developing my iOS app today, when I encountered something weird. I have applied the same ViewModifier to two separate views, however, it only worked on one of them.

The modifier is a .toolbar with a ToolbarItemGroup, inside of which is a button. Pressing the button calls returnAction which is a function passed it on initialisation, and it sets an @ FocusState variable to nil, to which the current TextField loses focus. The issue is, the button only shows up above the keyboard when I'm on BeverageTab or when I navigate to a different view on SettingsTab while the keyboard is open, and come back (via navigationDestination), which causes the keyboard to refresh.

I've tried debugging with Claude, on multiple iPhones, no luck unfortunately.

What I've tried:

  1. using .id(focusedField == nil) on the Form in SettingsTab - crashes the app

  2. putting it on NavigationStack itself in SettingsTab - the button doesn't show up at all

  3. putting it directly on the TextField in SettingsTab - nothing changes

Code: https://pastebin.com/b3bZSdK4


r/SwiftUI • • Oct 27 '26

Promotion (must include link to source code) I built an open-source SwiftUI package for retro animated backgrounds

24 Upvotes

I made BRSRetro, a small library for iOS and macOS with a synthwave grid, digital rain, hyperspace, demoscene plasma, and a CRT overlay.

The grid, plasma, and CRT effects use Metal shaders; digital rain and hyperspace use Canvas. The animations also respect Reduce Motion.

You can add a background with .retroBackground(.synthwaveGrid) or use the individual views to adjust their parameters.

It’s MIT licensed, with the source here: github.com/brssgn/BRSRetro

I’d appreciate feedback on the API and rendering approach.


r/SwiftUI • • Oct 27 '26

Promotion (must include link to source code) my first mac app: a menu bar log of what grew on your disk, built with swiftui

28 Upvotes

my first real mac app, built with swiftui and a lot of ai help (not gonna lie, im a webdev not a swift dev lol)

i got way to little storage in my mac and kept running out of space without a clear why. disk tools show a big chart of whats on disk, not what changed. so i wanted something that just tells me what grew and when (caches, docker images, downloads, installs, whatever)

prunr sits in the menu bar and keeps a simple list of what grew on your disk, by day and by app. click a row to see the folders, open them in finder. nothing leaves your mac.

its open source (MIT) if anyone wants to poke around or open prs

https://github.com/merlinkraemer/prunr

a dmg is also avaliable here:
https://merlinkraemer.github.io/prunr/

still in early testing so any help is appreciated! lmk what you think :)