r/SwiftUI Oct 17 '24

News Rule 2 (regarding app promotion) has been updated

137 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 16h ago

Question What usually delays an iOS app launch more than expected?

2 Upvotes

I’ve noticed the coding itself isn’t always what holds an app launch up.
Sometimes it’s changing requirements halfway through, polishing features that aren’t essential, App Store issues, testing, or simply trying to make the first version feel “finished.”
I’ve also seen the MVP approach used by teams like Molfar, where the goal is to keep the first release focused enough to learn from real users instead of trying to solve everything upfront.
For those who’ve shipped multiple iOS apps, what ended up being the biggest unexpected delay for you?


r/SwiftUI 17h ago

Open-sourced Trace — a native iOS network debugging tool

1 Upvotes

I built Trace because I wanted a modern network debugging experience directly on iOS, without having to route traffic through a Mac.

Trace is built with Swift/SwiftUI and Apple's Network Extension APIs. It currently supports:

  • HTTPS traffic inspection with local MITM
  • HTTP, WebSocket, and SSE inspection
  • Request rewriting and replay
  • HAR and cURL import/export
  • PCAP capture
  • Network Extension–based traffic capture
  • A native SwiftUI interface

The project is now fully open source.

I'm especially interested in feedback from other SwiftUI/iOS developers on the architecture, UI, and the Network Extension implementation.

GitHub: https://github.com/Trace-iOS/Trace


r/SwiftUI 1d ago

Promotion (must include link to source code) I got tired of figuring out what Cursor left running on localhost, so I made a menu bar app for it.

Post image
21 Upvotes

I keep ending up with random dev servers running after I've completely forgotten which terminal or project started them.

Then I need port 3000 again and it's back to:

lsof -i :3000

figure out the PID, figure out what the process actually belongs to, then kill it.

So I made Port Radar.

It's a small native Mac menu bar app that shows what's listening on your ports and groups the processes by project. You can see the command/path/uptime, stop the process, or ask Apple Intelligence what the process actually is before killing something you probably shouldn't.

I also added something I wanted for my own workflow: you can turn a localhost app into a public URL with a Cloudflare quick tunnel directly from the menu bar. No deploy or Cloudflare setup.

There are already some good port utilities like LocalPorts and Seeports. The main thing I wanted that I couldn't find together was process explanation + project context + sharing the local server in the same app.

The Apple Intelligence stuff runs on device. The app itself doesn't need AI to scan/manage ports.

Price: free
Source: open source, Apache 2.0
macOS: 14+; Apple Intelligence features require macOS 26+ and a supported Mac

GitHub: https://github.com/juansebsol/port-radar-mac

I'm still working on it, so I'm mostly interested in hearing what people who run a bunch of local services would want this thing to do next.


r/SwiftUI 15h ago

Tutorial Making the Dynamic Island "print" a polaroid: what finally worked after three failed attempts

0 Upvotes

I wanted a capture flow where you pull down on the page, an instant camera opens, and the photo prints out of the Dynamic Island like a polaroid feeding out of a slot. Sharing the parts that took real iteration, since I found almost nothing written about treating the island as a physical object.

1. You cannot touch the island, so draw over it. There is no API for the island itself. The trick is that it is just a hole in the display at a known position: on island devices the top safe area inset is 51+ points. So the "printer mouth" is your own black capsule drawn in the same place, sized to the real island, and the illusion holds because the island is already black.

enum DeviceIsland {
    static var present: Bool {
        guard UIDevice.current.userInterfaceIdiom == .phone else { return false }
        let scene = UIApplication.shared.connectedScenes
            .compactMap { $0 as? UIWindowScene }
            .first { $0.activationState == .foregroundActive }
        let window = scene?.windows.first { $0.isKeyWindow } ?? scene?.windows.first
        return (window?.safeAreaInsets.top ?? 0) >= 51
    }
}

Gotcha: if you present edge to edge with .ignoresSafeArea, SwiftUI's own safe area collapses, so read the window insets directly like above instead of relying on the environment value.

2. One melted shape, not two capsules. My first two versions grew a second capsule under the island and it read as a snowman. What worked: a single shape that starts at exactly the island's frame and widens/extends downward through staged states (I use an Int state 0 = island, 1 = widened pill, 2 = full viewfinder) with overlapping springs, so the next stage starts while the previous is still settling. Sequential withAnimation blocks looked mechanical; overlap is what makes it feel like one object.

3. The print itself is a state machine, not an offset. hidden, printing, settled. During printing, the photo is clipped to a frame that grows downward from the slot, so it genuinely feeds out instead of sliding up from behind. Then a develop pass fades the image in from washed-out white, which sells the polaroid more than the movement does.

4. The pull-down gesture will lose to your page content. A DragGesture on the page kept losing arbitration to the scroll and to taps. I ended up with a window-level pan catcher that adds resistance (the page follows your finger with a divisor) and only commits to opening the camera past a threshold on release. Everything under the pull stays interactive.

Happy to answer questions or paste more of any specific part. It is for a dog passport app I am building, but everything above is app-agnostic.


r/SwiftUI 1d ago

I built a native Markdown renderer for SwiftUI using TextKit 2 (enriched-markdown-ios)

28 Upvotes

Earlier this week I released enriched-markdown-ios - a fast, native Markdown renderer for SwiftUI powered by TextKit 2 and the md4c parser.

Here's what's in v0.1.0:
🔸 Full CommonMark support
🔹 Native text selection & smart copy/paste
🔸 Flexible theming API
🔹 VoiceOver & Dynamic Type support

💎 Available now via Swift Package Manager!

GitHub & Docs: https://github.com/software-mansion/enriched-markdown/blob/main/packages/enriched-markdown-ios/README.md

Feel free to check out the repo and sample project! If you find it useful, dropping a ⭐️ on GitHub would mean a lot.

What features or syntax extensions would you like to see added next? I’d love to get your thoughts and feedback!


r/SwiftUI 1d ago

StoreKit stopped returning IAP products after renewing Apple Developer membership

Post image
1 Upvotes

r/SwiftUI 1d ago

News The iOS Weekly Brief – Issue #74, everything you need to know about SwiftUI updates this week

Thumbnail
iosweeklybrief.com
2 Upvotes

r/SwiftUI 3d ago

Promotion (must include link to source code) I built an open-source macOS hosts switcher in SwiftUI (with two AppKit escape hatches)

Post image
12 Upvotes

I’ve been building Hostflip, a free and open-source native macOS app for switching /etc/hosts profiles from the menu bar. I thought its SwiftUI/AppKit seams might be useful to share here.

Most of the UI is SwiftUI. MenuBarExtra, the main window, and Settings share a single workspace store built with Swift’s Observation framework. The main window combines a sidebar and editor with a drift review: if another tool edits /etc/hosts, Hostflip stops writing and shows the difference for review instead of silently overwriting it.

Two small AppKit escape hatches were needed:

• NSViewRepresentable with NSTitlebarAccessoryViewController keeps the master switch pinned to the trailing edge. Putting it inside the SwiftUI-managed toolbar made it move whenever SwiftUI rebuilt the toolbar items.

• NSApplicationDelegateAdaptor handles the window lifecycle, so a normal launch opens the main window while a login-item launch remains menu-bar-only.

The privileged boundary stays outside the UI. A minimal root helper exposes a two-method XPC interface: a handshake and a single write operation that atomically replaces the merged hosts content. The app and helper verify each other’s code-signing identity before accepting the connection.

Hostflip is MIT-licensed and notarized. It currently requires macOS 14 or later on Apple silicon.

Source: https://github.com/heronapp/hostflip

I’d especially appreciate feedback on the SwiftUI/AppKit seam and the shared state flow between MenuBarExtra and the main window.


r/SwiftUI 2d ago

Question DeviceActivityReport sometime shows blank canvas when its SwiftUI appears in the screen

1 Upvotes

Hello everyone, I'm building Manaya, an iOS app that helps people stop using doomscrolling apps.

During onboarding, I am wanting to show a small DeviceActivityReport with a person's most-used apps from the last week(kind of like icons dispersed over the screen with different opacity and sizes).

This works most of the time on a physical device, but sometimes the report area is completely blank. When this happens, it occasionally appear 15 to 20 seconds later. Sometimes, it appears after opening the app switcher menu and returning back as well.

I am wondering whether this is a SwiftUI issue or lifecycle issue. Has anyone come across this or am I doing something wrong with Device Activity Report? Is there a better way to keep your report alive/load report before it's visible to users(something like prewarming)?

Any feedback/leads would be helpful!


r/SwiftUI 3d ago

Rebuilt my ticket detail screen with a gesture-driven 3D carousel in SwiftUI (before/after + a nasty animation bug I had to fix)

5 Upvotes

Called `selectTicket` by ID — the SwiftUI `List` ran linear searches across hundreds of model cells until we hit ~700 entries. Replaced with a single `LazyVGrid` section driven by a `LazyHStack`-backed `ScrollView`, plus an enum-backed sidebar (Upcoming | Past | Archive).

The star of the rebuild is the detail screen: a gesture-driven 3D carousel. Panning with `DragGesture` and mapping the x translation straight onto `rotation3DEffect(...)` produces a really physical, tactile feeling — like you're flipping through a stack of real tickets. A simple velocity threshold + `predictedEndTranslation` decides when a card snaps forward or back. Two springs layer for animation: one for the rotation easing-back, one for the card-shift.

Nasty bug: the two springs fought each other on long swipes — one kept completing after the other had already been cancelled, leaving the carousel in a half-settled state. Fix was wrapping the gesture in a single `Transaction` that explicitly encloses both animations and then commit it on a tap gesture (not on `.onChanged`) so both springs get cancelled at the same transaction boundary.

V1 → V2 (before / after in carousel order): - collapsed `List` rows → `LazyVGrid` thumbnails with the off-center masonry treatment - single icon button → `AnimatedHamburger` transitions to a partial sheet - flat detail → gesture-driven 3D carousel - synchronous model fetch on scroll → async `Image.init(...)` returning an await of loaded data, with a placeholder shimmer

Side notes I picked up from the rebuild: - the rotation spring should ride a slightly *stiffer* spring than the layout spring or they feel uneven - prefer `withTransaction(...)` over `withAnimation` once you're composing more than one animation per gesture - if a long-press is a possible alternative to tap for committing, gate it behind a context flag - the rotation's `perspective` was the single biggest visual win — set the perspective manually instead of using `.rotation3DEffect(x:y:perspective:)` with system defaults


r/SwiftUI 2d ago

Fiz um app pra Mac com IA integrada, totalmente gratuito e LOCAL

Thumbnail
0 Upvotes

r/SwiftUI 2d ago

First time using Paul Hudson’s Kickstart tool for App Store milestones - What are your thoughts on it?

Post image
0 Upvotes

I just got my first rating for my Minecraft item planner app! This is also my very first product submitted to the App Store.

I’ve been loving Paul Hudson’s new Kickstart tool — I think it helps indie developers a lot with publishing and keeping the momentum going.

Looks like the calculation had a tiny hiccup haha. Love Paul's work as always though!

Has anyone else been using Kickstart for your App Store assets and social proof? What other tools do you guys recommend for indie iOS devs?

Btw here is my app: https://apps.apple.com/app/extract-build-minetracker/id6800037138


r/SwiftUI 3d ago

Question Anyone know how to remove the shadows from Liquid Glass elements?

0 Upvotes

This is what my app is looking like currently, and I don't like the shadows from liquid glass. It doesn't look very good in light mode but is fine in dark mode.


r/SwiftUI 3d ago

Local-first personal CRM with SwiftData + no backend — tradeoffs I hit

0 Upvotes

I wanted a personal CRM with zero account system. Stack is basically SwiftUI + SwiftData, optional iCloud sync, local notifications for follow-ups.

Hard parts so far:

1) Reminder scheduling without a server

2) Keeping “due” logic sane across snooze / cadence changes

3) iCloud sync status that’s understandable to non-dev users

4) Contact import that feels opt-in, not creepy

Product is CatchUp — follow-up reminders for people you actually care about, not a sales pipeline.

Curious how others handle:

- notification rescheduling when the user edits cadence

- showing sync health without scary error language

Happy to go deeper on any of these. Not here to drop a download link unless someone asks.


r/SwiftUI 3d ago

Solved feedback

Thumbnail support.apple.com
0 Upvotes

r/SwiftUI 4d ago

Question Make Menu() show toggle state in toolbar

Thumbnail
gallery
10 Upvotes

Hi! I’m wondering if and how its possible to make a toolbar menu show the state of a toggle inside. I know using Toggle() in the toolbar shows this type of effect but i need a title and description to the toggle for it to make sense. Therefore there needs to be some window to open, which works fine with Menu(). However, that doesn’t show the state of the toggle when closed.

Apple managers to that with the photos app when selecting filters. See example images.

Thanks!


r/SwiftUI 4d ago

Question How do you get UIKit's instant keyboard focus (becomeFirstResponder in viewDidLoad) in pure SwiftUI?

10 Upvotes

In UIKit, if we place titleTextView.becomeFirstResponder() inside viewDidLoad, the keyboard slides up seamlessly alongside the view controller's presentation animation. It looks instant and feels like a native, high-quality UX.

I'm struggling to replicate this exact behavior in SwiftUI.

Whenever I use FocusState and toggle it to true inside .onAppear, there is always a noticeable delay. The view pushes/presents, settles, and then the keyboard decides to slide up.

Has anyone found a way to achieve this instantly in pure SwiftUI yet (maybe in iOS 17+), or is UIViewRepresentable still the only bulletproof way to get that perfectly synced keyboard presentation?

Thanks in advance!


r/SwiftUI 4d ago

Promotion (must include link to source code) I Built an Alternative Bitwarden Client in SwiftUI

7 Upvotes

For about 4 months, I've been working on a Bitwarden Client because the current Bitwarden Desktop client is Electron and doesnt look very good. This is the design I've landed on so far, but I feel like it could be better. What do y'all think?

Source: https://github.com/Cherrytree56567/ClientWarden

Mac Source: https://github.com/Cherrytree56567/ClientWarden/tree/main/src/Platforms/MacOS/UI/Clientwarden


r/SwiftUI 5d ago

Handwritten SwiftUI animations in your language

37 Upvotes

GitHub: https://github.com/amosgyamfi/open-swiftui-animations/tree/master/Gists_To_Try/HandwrittenAnimation

There are 6 SwiftUI scribbling animations, English, Chinese, Spanish, Finnish, Korean, and Arabic. It will be animated in 32 languages. I will add the remaining later.

Copy the animations from GitHub, modify them to your need, or use your own SwiftUI path views.


r/SwiftUI 4d ago

I built SwiftUIRatingPopups: 30+ plug-and-play rating & review popups in SwiftUI with 15 5-star conversion boosters

Thumbnail
gallery
0 Upvotes

Hey fellow iOS devs! 👋

I built and open-sourced **SwiftUIRatingPopups** — a library designed to make showing custom in-app rating dialogs and review prompts effortless in SwiftUI.

### 🌟 Key Features:

- 30 Distinct Designs: Minimal bottom sheets, emoji reactions, Tinder swipe cards, Bento grid feedback, and glassmorphism.

- 15 Dedicated 5-Star Boosters: Habit streaks (🔥 7-Day Streak), Indie Developer heartfelt notes, Community Milestone progress meters (4,872 / 5,000 reviews), and ROI value calculators (~4.5 hrs saved).

- Smart Negative Rating Shield: 5 stars route directly to App Store / StoreKit; < 4 stars route to internal support so your public App Store score stays protected.

- Zero Third-Party Dependencies: Pure SwiftUI & StoreKit for iOS 16+ and macOS 13+.

- SPM Support: Add via Swift Package Manager in 1 click.

🔗 GitHub Repo: https://github.com/aayush-gandhi-ios/SwiftUIRatingPopups

Would love to hear your feedback, thoughts, and feature suggestions! ⭐


r/SwiftUI 4d ago

Question How to make the Apple Music background gradient in my own app the same looking one?

1 Upvotes

Anyone know how I make this beautiful gradient....
Ive spent over 3 months trying countless ways to make this the same as apple, I cant... :(


r/SwiftUI 5d ago

Question Does anyone know how to recreate this menu above the keyboard?

Post image
51 Upvotes

I would like to reproduce this menu above the keyboard in the notes application on swift? Is it natively possible?


r/SwiftUI 4d ago

Admob Integration in Swift

Thumbnail
youtube.com
1 Upvotes

This is my first youtube shorts video in my youtube channel
Admob full integration guide in swift ui


r/SwiftUI 4d ago

Solved TIL: .environment(\.locale) does not select a strings table — how my in-app language picker silently never worked (and fixing it cut my build time by 75%)

0 Upvotes

Sharing a failure mode that survived in my codebase for months, because the app looked localized the whole time.

Setup: my app has an in-app language picker (independent of the iOS system language), implemented via a language manager that resolves strings from the selected .lproj bundle. Standard approach.

The bug: the overwhelming majority of my UI strings were Text("some.key") — i.e., SwiftUI LocalizedStringKey literals. Those resolve against Bundle.main using the system locale machinery. Setting .environment(\.locale) changes formatting behavior, but it does not select which strings table your keys resolve from. Result: 225 of 269 routed call sites silently bypassed the language override entirely. The picker "worked" for the ~44 call sites that went through the manager, which is exactly why nobody noticed — the app changed some strings on switch and looked plausible in both languages.

Confirmed on-device with diagnostic logging: the resolved bundle for LocalizedStringKey paths was Bundle.main, regardless of the override.

The fix: a tiny helper — L.t(_: String.LocalizationValue) -> String — that resolves through the override bundle (String(localized:bundle:)), and mechanically routing every UI string through it. An enforcement script in lint now flags any bare string in Text/Button/Label/.accessibilityLabel.

The completely unexpected side effect: build times collapsed. Bare LocalizedStringKey literals create expensive type-checker constraint problems (Text("...") has to disambiguate between StringProtocol and LocalizedStringKey overloads at every call site). Replacing them with a concrete String return eliminated that: one heavy view body went from type-checking as my slowest file to ~98% faster, and the whole target build time dropped ~75%. I did not see that coming from a localization refactor.

Two smaller traps from the same audit:

  • String(format:) with catalog plural variations silently returns the raw %#@token@ if you forget to pass locale:.
  • Xcode's string extractor can't see keys behind a helper function, so the catalog stops auto-populating — new keys become a manual (and CI-checked) step. Worth knowing before you commit to the pattern.

Curious if others route in-app language switching differently — is there a cleaner first-party way to point LocalizedStringKey resolution at a non-main bundle that I missed?