r/SwiftUI • • Oct 17 '24

News Rule 2 (regarding app promotion) has been updated

139 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 • • 4h ago

Buttons in .confirmationDialog have a significant delay when triggered

2 Upvotes

When tapping a button in a .confirmationDialog (at least one tied to a .bottomBar ToolbarItem), a ridiculously long delay — about a full second after the dialog closes — occurs before the action triggers. This issue is present in some of Apple's apps, including Reminders, Shortcuts, and Notes, but notably not in the Photos app. It also occurs for .alert, though to a lesser degree. How can I eliminate this, preferably without dropping down to UIKit?

The problem has been present since iOS 26. I haven't checked whether it existed before then.

Example code:

struct ContentView: View {
     private var confirmationDialogPresented = false
     private var colorToggled = false
    
    var body: some View {
        NavigationStack {
            Color(colorToggled ? .blue : .red)
                .ignoresSafeArea()
                .toolbar {
                    ToolbarItem(placement: .bottomBar) {
                        Button("Placeholder", systemImage: "square") {
                            confirmationDialogPresented = true
                        }
                        .confirmationDialog("Placeholder", isPresented: $confirmationDialogPresented) {
                            Button("Placeholder") {
                                colorToggled.toggle()
                            }
                        }
                    }
                }
        }
    }
}

#Preview {
    ContentView()
}

r/SwiftUI • • 17h ago Bravo

A checklist I use when a SwiftUI List or ScrollView stutters

18 Upvotes

Most SwiftUI scroll jank I've debugged came from a short list of causes, not from SwiftUI being slow. Here's the order I check them in. Curious what others would add.

  1. Unstable identity. `ForEach(items, id: \.self)` on values that aren't unique, or ids created inside the view (`UUID()` in `body`), make SwiftUI treat rows as new on every update. Use a stable id from your model.
  2. Work inside `body`. Date formatters, sorting, filtering or image decoding in `body` run on every re-render. Move them into the model or cache the result.
  3. Observing too much. With `@Observable`, a view re-renders for the properties it reads. If every row reads half of a big shared model, one change can invalidate far more rows than you expect. Give each row only what it needs.
  4. Conditional modifiers that swap view types. An `if` that wraps a row in different modifiers changes its structural identity and resets its state. Prefer value-based modifiers, like `.opacity(isHidden ? 0 : 1)`.
  5. Images. Full-size images decoded on the main thread will drop frames. Downsample to the size you actually display.

Before changing anything, I profile on a real device with a release build, using Instruments (the SwiftUI template plus Time Profiler). `Self._printChanges()` in `body` is also handy for seeing why a view re-rendered. Debug builds and the simulator can point you at the wrong problem.

What's the most surprising cause of scroll jank you've run into?


r/SwiftUI • • 9h ago

We rewrote the entire Rust WGPU in Swift, and it looks fantastic. I call it SAGA

Thumbnail gallery
2 Upvotes

r/SwiftUI • • 6h ago

Real Ubuntu Linux in an iPad/iPhone code editor, now live on the App Store

Post image
1 Upvotes

I'm the solo dev of Pad Code AI. Version 3.3 runs real Ubuntu (arm64) right on the device, with no server and no account. You get bash, apt and about 60 tools (Python, C/C++, Node, Go, Rust, Java…) that you download once and use offline, plus a real debugger, LaTeX to PDF and live web previews.

The core is free.

https://apps.apple.com/app/id6774398897

Happy to answer any questions!


r/SwiftUI • • 8h ago

Recreated the Trip.com splash screen animation in SwiftUI

1 Upvotes

I really liked the Trip launch animation, so I recreated it. The logo's letters get swallowed by the orange dot, the dot stretches into a streak, and a circle sweeps in to reveal your first screen.

Source: https://repgem.com/trip-splash-ios

Would love your feedback!

Inspired by the Trip.com app. The code is original and not affiliated with them.


r/SwiftUI • • 12h ago

Promotion (must include link to source code) A SwiftUI answer balloon beside selected text in any Mac app (source included)

Post image
1 Upvotes

I make Glossbeam, an open-source macOS app that shows an explanation beside selected text. The screenshot shows the UI problem: the answer needs to sit close enough to the selection to make their relationship clear, while leaving room to keep reading. I’d be interested in how other Mac developers handle positioning near a display edge. The Mac and Shared source and Xcode build instructions are here: https://github.com/YasserShkeir/glossbeam-open.


r/SwiftUI • • 15h ago

Tutorial Rendering Mac App Store screenshots from my SwiftUI views: 4 gotchas

0 Upvotes

Added a debug flag that renders the store screenshots from the real views with sample data. What tripped me up:

  • Render inside a real offscreen NSWindow, or scroll views and text editors don't draw right.
  • Disable animations. There's no display link offscreen, so transitions never finish.
  • Blur vanishes offscreen. I swapped it for radial gradients.
  • cacheDisplay can't draw the sidebar material. I used CGWindowListCreateImage for that window.

That last one is deprecated though. Anyone found another way to capture vibrancy from your own window?


r/SwiftUI • • 18h ago

News The iOS Weekly Brief: Issue #88. macOS on iPad, iOS 27.3 beta 2, unknown enum cases, Xcode MCP vs xcodebuild, SwiftUI List internals, container values, drag and drop reordering in SwiftUI, iPhone Duo layouts, and Black Friday deals

Thumbnail
iosweeklybrief.com
1 Upvotes

r/SwiftUI • • 1d ago

FireworkFlourish - Fireworks for any SwiftUI view (inspired by iOS 27)

18 Upvotes

Inspired by the iOS 27 birthday fireworks, I built a SwiftUI package that puts fireworks over any view: a card, a button, a calendar cell or a whole screen.

It's handy for moments worth celebrating, for example:

  • Birthdays and anniversaries on a contact or reminder card
  • Achievements and level-ups in a game or fitness app
  • A goal scored on a scoreboard

iOS 17+, MIT licensed.

Source: https://repgem.com/firework-flourish-ios

Would love your feedback!


r/SwiftUI • • 2d ago

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

5 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 • • 2d 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 • • 2d ago

I am creating animated widgets.

Thumbnail gallery
0 Upvotes

Hello

I’m building Jubs, an app with animated iPhone widgets.
I sketch each scene by hand, then simulates how it moves so it feels alive.

For this snow globe, I simulated falling snow and how the curved glass bends the light.

Let me know what do you think.

Thank you,
Tiago


r/SwiftUI • • 2d ago

News SwiftUI Weekly - Issue #244

Thumbnail
weekly.swiftwithmajid.com
0 Upvotes

r/SwiftUI • • 2d 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
1 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 • • 3d ago

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

5 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 • • 3d 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 • • 3d 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 • • 4d 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 • • 4d ago

Made my workout behave like Music's mini player

11 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 • • 4d ago

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

Thumbnail
gallery
6 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 • • 4d 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

3 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 • • 4d 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 • • 4d 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!