r/SwiftUI • • Oct 17 '24

News Rule 2 (regarding app promotion) has been updated

138 Upvotes

Hello, the mods of r/SwiftUI have agreed to update rule 2 regarding app promotions.
We've noticed an increase of spam accounts and accounts whose only contribution to the sub is the promotion of their app.

To keep the sub useful, interesting, and related to SwiftUI, we've therefor changed the promotion rule:

  • Promotion is now only allowed for apps that also provide the source code
  • Promotion (of open source projects) is allowed every day of the week, not just on Saturday anymore

By only allowing apps that are open source, we can make sure that the app in question is more than just 'inspiration' - as others can learn from the source code. After all, an app may be built with SwiftUI, it doesn't really contribute much to the sub if it is shared without source code.
We understand that folks love to promote their apps - and we encourage you to do so, but this sub isn't the right place for it.


r/SwiftUI • • 3h ago

Question Finding Hacking with swiftUI hard to learn. Help needed!

4 Upvotes

Hi all.
I don't have much programing experience other than a year of react-native and some core java all learnt on my own. I made an android app with a tiny help form a more experienced developer. That was back in 2017. I moved to business and now I am back to coding. I'm 36 years of age now.

I am learning swift and swiftUI from 'hacking with swift' and now I am on day 58. Except for the initial days, I find swift and swiftUI hard to follow. The syntax is very confusing and I easily forget things in a day or two. I find the teachings of Paul hard to follow and I repeat the videos again and again to understand. Now on 58th day, I am already overwhelmed. I am upset because on other threads, people commented as they could grasp the concept easily and could start app building right away.

I am wondering if I'm one off case and programming is not for me or people really find swiftUI hard to learn? Any tips or advises will be most welcome.


r/SwiftUI • • 2h ago

Question How can I change bg of segment picker?

Thumbnail
gallery
3 Upvotes

I have attached three images.
- First image shows what I want to create
- Second image shows what I get.

I Just only want to remove that default background color of the picker and my 80% problem solved.

Code

```
Picker("Period", selection: $selection) {

ForEach(options, id: \.self) { option in

Text(option)

.tag(option)

}

}

.padding(4)

.frame(height: 40)

.frame(maxWidth: 420)

.background {

Capsule()

.fill(Color.textFieldBackground)

}

.pickerStyle(.segmented)
```


r/SwiftUI • • 39m ago

News SwiftUI Weekly - Issue #244

Thumbnail
weekly.swiftwithmajid.com
1 Upvotes

r/SwiftUI • • 4h ago

Promotion (must include link to source code) Shipped v1.2 of Wudland (open-source SwiftUI + HealthKit + WKWebView cosy village): deterministic Step Tree & native sheet architecture

Thumbnail
gallery
2 Upvotes

Just released v1.2 of Wudland, my free, open-source (GPLv3) cosy medieval village app for iPhone, and wanted to share how the SwiftUI + HealthKit layer is put together alongside the full source code.

How it's structured in SwiftUI

  • SwiftUI chrome & sheets (WudlandApp.swift, OnboardingView.swift, SettingsView.swift, PairSheet.swift): Onboarding, per-connector permission toggles, QR pairing, and the new Step Tree goal slider (5,000–15,000 steps) are pure SwiftUI views styled with a warm dark-wood palette (Theme.swift) layered over a full-bleed UIViewRepresentable local canvas (VillageWebView.swift).
  • Deterministic HealthKit Step Tree (StepTree.swift): Uses an @MainActor final class StepTreeStore: ObservableObject wrapping HKStatisticsCollectionQuery (anchored at startOfDay, 1 day interval, .cumulativeSum). Instead of persisting brittle streak counters in UserDefaults, Swift fetches daily bucket totals since planting day and passes {planted, goalHistory, days, todaySteps} across the bridge so the village deterministically replays the tree's exact vigour and growth stage (8 states x 5 sizes).
  • Live per-connector toggles (Connectors.swift): Added @Published enable/disable switches and OS-permission state recovery for EventKit Calendar, Reminders, Open-Meteo Weather, MediaPlayer, and HealthKit Steps.

Links

Happy to answer any questions about bridging SwiftUI state updates cleanly into an embedded canvas without dropped frames!


r/SwiftUI • • 23h ago

Promotion (must include link to source code) We built a macOS launcher where any script can draw native SwiftUI views by printing text

4 Upvotes

Hi! I'm Tony, one of the creators of Openspot, a research project on using generative UI in day-to-day work.

The idea is simple: generate a tool (a "spot") for your current task using a coding agent, and keep it if you like it or remove it after use if you don't. Some spots we use daily:

  • Caffeinate, which keeps your Mac running with the lid closed
  • Local file and screenshot search in natural language using EmbeddingGemma 2
  • Drawing on screen during calls or before screenshots
  • AI agents monitoring
  • AirDrop, but over the network (using iroh)

We built it because of two things:

  1. Over the past year, we (and almost every designer and engineer we know) have started making small tools with coding agents. But the DX for macOS apps is very frustrating even for coders, and you have to pay for a developer account to share them.
  2. We kind of miss the days of custom Winamp skins and Twitter clients. That's why every part of Openspot is customizable, so anyone can give it their own look and feel.

How it works: a spot is just a script in any language that prints key=value lines, and Openspot turns them into native SwiftUI views, for example:

frame=
class=gap-part

box=head
class=flex-row items-center gap-2

icon=wifi
parent=head
value=wifi
class=text-accent

text=name
parent=head
title=Home
detail=82 Mb/s
class=grow

button=forget
parent=head
title=Forget
class=rounded-full
Result of the code above

For styling we use Tailwind class names, because coding agents already know them well. But there are no arbitrary values or raw colours, only theme tokens like bg-tile, font-title or text-warn. So whatever the agent generates follows your theme and still looks native. The same spot can live as a card, in the menu bar or in a window.

And if the built-in blocks aren't enough, a spot can ship its own SwiftUI view. Openspot compiles it at runtime and renders it as an AnyView, with no Xcode project needed.

This is a very early stage. The code is MIT-licensed, and the core will remain free forever. We're sticking to macOS 26+ for now (because of Liquid Glass).

Ask anything, or roast it. Any feedback is very appreciated!

Source code: https://github.com/celishq/openspot


r/SwiftUI • • 20h ago

I rewrote my Flutter music app natively in SwiftUI (iPhone + Mac), here's what I learned

Thumbnail
github.com
0 Upvotes

one codebase shared between iPhone and Mac, Live Activities for lyrics while listening together, crossfading between two AVQueuePlayers, and so on. Source: https://github.com/GoranSustekJr/pongo


r/SwiftUI • • 1d ago

StarPulse – native SwiftUI menu bar monitor for Starlink (free, open source, 2.2 MB)

0 Upvotes

Hi all. I'm the developer of StarPulse, a native macOS (Swift/SwiftUI) menu bar app for Starlink. It reads your dish and router over your local network.

It's inspired by and partly ported from Dishylink by DaveyHert (MIT), an Electron/React app for macOS, Windows and browsers: https://github.com/DaveyHert/dishylink. Credit to them for the protocol work. I rebuilt it fully in Swift (2.2 MB, no third-party dependencies) and added:

  • Content filtering like the Starlink app (No filtering / Malware / Malware and adult), switchable from the menu bar
  • 3D alignment view with "turn X° clockwise / tilt toward the sky" steps
  • Peak and average throughput for today, 7 days, this month, 30 days
  • Speed test that says whether it actually ran over Starlink, plus a bufferbloat grade
  • WAN IPv4/IPv6, device pause and resume, schedules and DNS rules, 3D obstruction dome with time-lapse, live satellites

Monitoring needs no account; pause, filters and rules need your Starlink sign-in. It's unofficial, not affiliated with SpaceX, and not notarized yet (the README explains how to open it). Feedback is welcome, especially from people with other kits:
https://github.com/paulo-amaral/starlink-macos-menubar


r/SwiftUI • • 1d ago

Promotion (must include link to source code) Relativity (Kaluza-Klein) Visualizer

3 Upvotes

Hey everyone,
I've been working on a paper for a few years that's a modified model of general relativity that uses an unwrapped Kaluza-Klein dimension to satisfy classical simultaneity. I just got paid AI for the first time after I quit my job to work on the paper full-time, so of course one of the first things I did was have it update this app I built a while ago.

The app is a visualizer for pretty much everything relativity, even if you're not very interested in the Kaluza-Klein model or the 4d interpretation. Unfortunately it's written in Swift, so it's MacOS only, and you'll have to go into settings and whitelist it... It's not worth sending it to Apple for notarization just for a demo app, but it really is an incredible tool I wish I would've had a year ago.

https://github.com/flusterIO/aog_explorer

Update

Sorry for the sort of low-effort post, I was in the middle of like 10 things at once. If anyone has any questions, feel free to reach out, and definitely, share it if you're intrigued. The model is entirely consistent with general relativity but accomplishes everything with no time dimension!


r/SwiftUI • • 2d ago

Made my workout behave like Music's mini player

8 Upvotes

In my fitness app, a workout in progress now sits above the tab bar like Apple Music's mini player. Scroll and it tucks in beside the tabs. Tap it and the workout zooms back open.

It's all built-in SwiftUI, mainly these:

.tabViewBottomAccessory { WorkoutBar() }
.tabBarMinimizeBehavior(.onScrollDown)
.navigationTransition(.zoom(sourceID: "workout", in: zoom))

Two tips if you try it:
- Clip the zoom source to a rounded shape, or the animation starts from a square.
- Block taps while the zoom is running. Tapping mid-animation crashed for me.

Thought I’d share because I don’t see many apps doing this behaviour, even though it’s now native API.


r/SwiftUI • • 2d ago

Question I want similar behavior in my app same as Contact app does. On iPhone Duo.

Thumbnail
gallery
5 Upvotes

Contact app when is open user details show right side of the screen and list left side of the screen which I can get using "arrangement View" but When iPhone Duo is closed at that time only userDetails is visible as show in 2nd ss.
I want to achieve 2nd SS on closed iPhone DUO? I'm getting listing view instead (which is left side as primary view).

Any help.


r/SwiftUI • • 2d ago

Promotion (must include link to source code) I built LocalSR, an open-source photo upscaler, in SwiftUI and brought it to Android with Skip

2 Upvotes

I'm working on LocalSR, a free app that upscales photos on your phone, offline. I built the phone version because if someone sends you a bad picture in a chat, or an old iPhone photo is still in your Photos app, you should be able to fix it on the phone with no hassle.

I wanted an implementation that is small, brings everything you need, has an easy UI, and is not two completely separate apps for iPhone and Android. So the whole UI is SwiftUI, and Skip turns it into Kotlin and Compose for Android.

What is shared: the screens, the app model, the tiling and the size rules. What is not: the engines. On the iPhone the engine is Core ML in Swift, and on Android it is LiteRT in hand-written Kotlin. The pixel code had to be real Kotlin, because the transpiled Swift works on boxed arrays and is far too slow for 48 MP. A unit test checks that the Kotlin and the Swift give the same result.

The before/after divider is a good example. On iOS the clip is a clipShape with a custom shape, and on Android a small Compose modifier through composeModifier:

The labels on iOS use Liquid Glass, and on Android they are a plain black capsule. In the end there are about 18k lines of Swift, 3k lines of Kotlin, and 248 #if SKIP or #if !SKIP blocks in 39 files.

It's MIT licensed, free on the App Store with no IAP, and the APK is on itch.io and GitHub. If you try it out, I would like constructive criticism on the SwiftUI side, especially on where you would avoid the #if SKIP blocks.

https://github.com/HerRei/local-upscale

App Store: https://apps.apple.com/app/id6837801876


r/SwiftUI • • 2d ago

Promotion (must include link to source code) Keeping a SwiftUI strip hovered when its NSPanel expands under the pointer

3 Upvotes

I built Lanes, a free, open-source Mac window organizer. I'm mainly looking for feedback on the implementation of its window switcher. Each lane has a SwiftUI strip in a borderless, non-activating NSPanel. The strip expands on hover so you can see the other windows in the stack while the app you're working in stays active.

The tricky part is that resizing the panel can send a mouseExited event for the old tracking rect even when the pointer is still over the strip. Lanes tracks hover in an NSHostingView subclass with an activeAlways tracking area. On exit, it checks the pointer's screen position against the panel's current frame before collapsing. A timer runs only while hovered to catch missed events, and it defers collapsing while the strip's menu is tracking.

If you've built an expanding SwiftUI control in a non-key AppKit panel, would you keep hover state in the hosting view like this or move it into the panel itself? I'm especially curious how you'd catch a genuine exit after a resize without polling.

Here's the tracking code: https://github.com/lanesmacapp/Lanes/blob/main/Sources/HoverScrollView.swift#L321-L427

https://github.com/lanesmacapp/Lanes


r/SwiftUI • • 1d ago

I completely rebuilt my open-source SwiftUI Mac app! LibreReplace v0.3 is out with five connected workflows

Thumbnail
gallery
0 Upvotes

I've been building LibreReplace, a native SwiftUI Mac app that helps people find free and open-source alternatives to expensive software.

After a ton of great feedback, I spent the last two weeks completely transforming it.

LibreReplace v0.3 is officially out, and this is easily the biggest update I've made!

The biggest addition is FreeStack Composer, which can combine multiple free apps and built-in tools into a single replacement setup based on the user's requirements.

For example, instead of simply suggesting another screenshot app as a replacement for CleanShot X, LibreReplace can combine a screenshot utility with its own on-device OCR.

Here's what I've built:

  • FreeStack Composer: Feature-based replacement combinations.
  • Built-in OCR/PDF tools: Local image and document processing.
  • My Setups: Persistent, customizable replacement configurations.
  • Guided Switching: Installation review, workflow verification, and supported recovery.
  • Community Recipes: Reusable replacement setups.
  • My Mac: Native app detection and potential software savings.

I also redesigned the entire SwiftUI interface around five connected sections: Discover, My Setups, Tools, Community, and My Mac.

One part I'm particularly happy with is the navigation between workflows. You can discover a setup, open the relevant built-in tool, complete a task, and return to the exact same setup.

The catalog currently covers 45 paid Mac apps and 70 free-alternative comparisons.

100% free and open source under Apache 2.0, with the full SwiftUI source available.

GitHub + screenshots + source:
https://github.com/maliroq/librereplace

Download v0.3:
https://github.com/maliroq/librereplace/releases/tag/v0.3.0-preview.1

I've spent a ton of time refining both the functionality and the interface, and I'm really excited about how far it's come.

I'd love feedback from other SwiftUI developers, especially on the UI and navigation!


r/SwiftUI • • 2d ago

Built a menu bar app, notch island, floating 3D globe and Control Center widgets in SwiftUI for my Mac firewall. Some things I learned

0 Upvotes

hey all, i'm the solo dev behind Outbound, a network firewall for mac (disclosure: it's my app). the networking side is a Network Extension, but most of my time actually went into the UI, so i figured this sub would get more out of that part

the pieces

  • menu bar panel with status, mode switching, today's numbers and recent blocks with an allow button next to each
  • notch island: when an app reaches a new country, a capsule grows out of the notch and draws the route. getting this to sit right on notched and non-notched macs, and not reopen every time the pointer passed near the notch, took way more tries than i'd like to admit
  • floating globe that stays on your desktop, resizable, draggable, 5 themes. you grab it, let go and it coasts
  • 3D globe in the main window using Apple Maps, with arcs from your mac to every place your apps connect
  • traffic charts with upload drawn above a center line and download below, each half on its own scale. hover to read values, drag across to select a time window, and the list + map filter to that window. they also work from the keyboard and with VoiceOver
  • Control Center widgets in small, wide and large sizes

things that bit me

  • live data at high frequency (connections update constantly) will tank a SwiftUI list if you're not careful. batching updates helped a lot
  • a window memory leak that grew the longer the window stayed open. firewall was fine, the UI wasn't
  • fitting the main window and settings onto smaller screens without it turning into a scroll fest
  • making charts accessible was more work than drawing them, but worth it

what i'm still not happy with

the mini monitor can still grow in memory while it's showing, so that's next on my list. if anyone's dealt with long-running SwiftUI views fed by a constant data stream, i'd love to hear how you kept memory flat

screenshots and a demo are on the site if you want to see how it turned out: https://outboundfirewall.com

happy to go into detail on any of it, especially the notch island


r/SwiftUI • • 1d ago

Question Mac users: what’s a tiny, annoying problem on macOS that STILL doesn't have a clean, native SwiftUI app without a $10/month subscription?

0 Upvotes

r/SwiftUI • • 3d ago

DustDissolve: a SwiftUI effect that turns any view into dust

49 Upvotes

I rebuilt this coupon-to-dust interaction as a SwiftUI Swift package, inspired by @AetherMaker work on X

Source: https://github.com/ismnoiet/repgem-catalog/tree/main/packages/ios/dust-dissolve-ios

iOS 17+, MIT.

Would love your feedback!


r/SwiftUI • • 3d ago

Promotion (must include link to source code) I made a SwiftUI menu bar app that lets you turn down the vocals, drums or bass of whatever your Mac is playing, in real time (open source)

57 Upvotes

Hi everyone! I'm a piano player, and whenever I heard a song I wanted to play along to, I had to download it, import it into my DAW and wait for a stem splitter. That's fine for a project, but way too slow when you just want to try something.

So I made Stelix, a menu bar app written in SwiftUI, with some AppKit for the panel and the sliders. While a song plays in Spotify, YouTube or any other app, Stelix splits it into vocals, drums, bass and other, and each one gets its own slider. You can take the vocals out and sing over the band, or turn the drums down and play them yourself.

There's also a Studio mode. It records a song or opens a file and gives you 6 stems in higher quality, which you can save as WAV. When you switch back to Original, Stelix stops processing and uses no CPU.

Everything runs on your Mac and you don't need an account. It needs Apple silicon and macOS 15 or later.

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

Website and download: https://getstelix.com

This is the first public release, so I'd like to hear what doesn't work for you and what you end up using it for. Thanks!


r/SwiftUI • • 2d ago

Using PreferenceKeys to drive AppKit hover tracking from SwiftUI: lessons from building a menu bar system monitor (open source)

Post image
4 Upvotes

I've been building **Sysbar**, an open-source (Apache-2.0) macOS menu bar system monitor, with the UI entirely in SwiftUI hosted in AppKit panels. A few patterns from it might be useful to others doing SwiftUI outside a normal window.

**Repo:** https://github.com/rodrigotrombeta/Sysbar

**1. Hover a section and a detail panel opens beside it**

The main panel is a SwiftUI stack of sections (CPU, GPU, memory, disk, network). Hovering a section opens a detail window aligned with it, and clicking pins that window open.

SwiftUI's `onHover` wasn't reliable in a non-key `NSPanel`, so the tracking happens in AppKit. Each section reports its frame through a `PreferenceKey`:

struct SectionFramesKey: PreferenceKey {

static var defaultValue: [SystemStatKind: CGRect] = [:]

static func reduce(value: inout [SystemStatKind: CGRect],

nextValue: () -> [SystemStatKind: CGRect]) {

value.merge(nextValue()) { $1 }

}

}

// on each section:

.background(GeometryReader { geo in

Color.clear.preference(key: SectionFramesKey.self,

value: [kind: geo.frame(in: .global)])

})

The root view forwards the result with `.onPreferenceChange` to the window controller. There, an `NSView` container rebuilds its `NSTrackingArea`s, and the frames also tell it where to place the detail window.

**2. A scroll view that sizes to its content up to a limit**

The panel should be exactly as tall as its content, but scroll once it hits the screen's height. To do that, a second `PreferenceKey` measures the content height inside the `ScrollView`, and the scroll view gets `.frame(height: min(contentHeight, maxHeight))`. Scroll indicators only show when the content actually overflows.

**3. First click on a non-key panel**

Buttons in an `NSHostingView` inside an `NSPanel` ignored the first click. Fixing it took a tiny subclass that overrides `acceptsFirstMouse(for:)` to return `true`.

**4. Sparklines as `Shape` instead of `Canvas`**

With redraws every second in a pinned panel, `Shape` paths used far less memory than `Canvas`. The whole app runs at about 25 MB.

**Where I'd like feedback**

- State lives in a single `ObservableObject` with `@Published` snapshots updated every tick. Is it worth migrating to `@Observable` for a view tree that updates this often?

- When the language or appearance changes, I force a full rebuild with `.id(model.revision)`. It works, but it feels like a hack. How do you handle a runtime language switch without restarting the app?

Credits: the stats panels started from [oMLX](https://github.com/jundot/omlx), and the menu bar icon is inspired by [Stats](https://github.com/exelban/stats).


r/SwiftUI • • 2d ago

I made a native animated mascot/avatar for AI assistant UIs (Jetpack Compose + SwiftUI, 17 moods, MIT)

Post image
0 Upvotes

r/SwiftUI • • 2d ago

Promotion (must include link to source code) How I built a native SwiftUI Mac app with a Python standard-library backend (source included)

Post image
1 Upvotes

Disclosure: I'm the developer, the app is free and open source (GPLv3), and I used AI to help draft this post. The source is at https://github.com/joexk1/JoeBro

JoeBro is a Mac workspace for coding agents (Claude Code, Codex, OpenCode) and local or cloud models. The UI is SwiftUI. The backend is a single Python process that uses only the standard library. I wanted to share how that split works, since it is not the usual way to build a Mac app.

How it is wired: the app starts the backend with Process() on 127.0.0.1, passing a fixed port, and keeps the output in a log file. It looks for the bundled script first, then for a python3 in the usual places (Command Line Tools, Xcode, Homebrew, /usr/bin). The backend is terminated from a willTerminateNotification observer, because orphaned children outlive their parent on macOS.

The SwiftUI side talks to it through a thin async API client over HTTP. Chats stream over server-sent events using URLSession.bytes(for:). I raised the per-host connection limit, because a long-running chat stream or a slow IMAP fetch would otherwise queue the quick data calls behind it.

Why Python for the backend: some of it (the Night Shift worker) is a standalone stdlib file that also runs on my other computers, and the iPhone companion app talks to the Mac over the same kind of API. State is a local SQLite file. No account, no server, no telemetry.

What I would do differently: shipping an interpreter dependency is awkward (you rely on a system python3), and I am still unsure whether to bundle one. If you have shipped a SwiftUI app with a helper process, I would like to hear how you handled it.

Install on macOS 26+: curl -fsSL https://joebro.pages.dev/install.sh | bash


r/SwiftUI • • 3d ago

Built VirtualNotch — a macOS notch overlay with synced media, Bluetooth stats, widgets, and privacy alerts

0 Upvotes

r/SwiftUI • • 4d ago

Question iOS 27 changed textfield behavior in toolbars, how can I extend its width?

Post image
5 Upvotes

In iOs 26, with the exact same code, the controls at the bottom automatically went edge to edge on the bottom of the screen, but on 27, the textfield only extends to the width of the placeholder text inside of it. I can't figure out for the life of me how to get it to extend its width again! Any help would be very appreciated.

Code:

ToolbarItemGroup(placement: .bottomBar) {

TextField("Add Player", text: $newPlayer)

.font(.body)

.frame(maxWidth: .infinity)

.focused($isFocused)

.onSubmit(addPlayer)

.padding(.horizontal)

Button ("Add", systemImage: "plus") {

addPlayer()

}

.disabled(newPlayer.isEmpty || nextGamePlayers.contains(newPlayer))

.sensoryFeedback(.selection, trigger: nextGamePlayers)

Button("Play", systemImage: "play.fill", role: .confirm) {

isFocused = false

withAnimation {

menuShowing = false

gameSetupShowing = false

}

onEndGame?()

onStartGame?()

}

.sensoryFeedback(.selection, trigger: gameActive)

.disabled(nextGamePlayers.count < 2)

}


r/SwiftUI • • 4d ago

The difference between List and ScrollView when it comes to loading elements?

6 Upvotes

It seems like ScrollView makes all of its child elements immediately visible while latter elements of list won't trigger .onAppear. Is there a way to make ScrollView behave like a List?