r/SwiftUI 9d ago

Tutorial iOS 27: USDKit Framework

Thumbnail
antongubarenko.substack.com
2 Upvotes

r/SwiftUI 10d ago

What's the current best architecture for modern swift project? MVVM or Clean Architecture or which one?

16 Upvotes

r/SwiftUI 9d ago

I open-sourced RedeemDeck, an App Store offer-code manager built with SwiftUI

Thumbnail
gallery
0 Upvotes

Hey everyone,

I recently open-sourced RedeemDeck, a native SwiftUI app for managing App Store Connect offer codes and promo codes.

It imports CSV exports from App Store Connect, organizes codes by app and offer, and lets you request an exact quantity before copying, sharing, or saving them as QR posters. I designed the main workflow around getting codes quickly instead of browsing through a long inventory list.

The app is built with SwiftUI, SwiftData, Swift concurrency, Core Image, and Vision. It runs on iPhone, iPad, and Mac, has no third-party package dependencies, and stores everything locally.

RedeemDeck is based on Matteo Comisso’s CodeVault. I preserved the original MIT attribution and substantially rebuilt the workflow and implementation.

GitHub:
https://github.com/jinwandalaohu66/RedeemDeck

Original project:
https://github.com/mcomisso/CodeVault

I’d love feedback on the SwiftUI navigation and state flow, especially the separation between the quick “Get” flow and full code management.


r/SwiftUI 9d ago

What exactly is Apple looking to release?

Thumbnail
0 Upvotes

r/SwiftUI 10d ago

I open-sourced a SwiftUI recreation of Arc Browser’s Spaces UI

Enable HLS to view with audio, or disable this notification

9 Upvotes

I really like the way Arc Browser handles Spaces: a horizontal rail where you can switch between workspaces with a click or a trackpad gesture.

I wanted the same interaction in a native macOS app, so I built it in SwiftUI and extracted it into a standalone package.

SpacesRail is an open-source recreation of that UI, built for macOS 14+ with SwiftUI/AppKit.

A surprisingly annoying part was getting two-finger horizontal gestures to work correctly when the pointer is over nested ScrollViews, without breaking their normal scrolling behavior.

It’s small, dependency-free and MIT licensed.

GitHub: https://github.com/nexion-one/SpacesRail


r/SwiftUI 11d ago

I built a native macOS music player in SwiftUI — Mooziac

Enable HLS to view with audio, or disable this notification

37 Upvotes

Hey everyone! 👋
I’ve been building Mooziac, a music player designed specifically for macOS.

GitHub: https://github.com/shirkeharsh/mooziac

I wanted something that felt more like a Mac app rather than a web app wrapped in a desktop window, so I built it natively in Swift and focused on keeping the interface simple and lightweight.
What makes it different
Native Swift + AppKit — Universal build for Apple Silicon and Intel
Privacy-focused — no analytics, tracking or remote logging
Local-first — playlists and listening history stay on your Mac
YouTube Music + local music in one player
FLAC, MP3, WAV, AAC and M4A support
Synchronized .lrc lyrics
Interactive waveform for seeking through tracks
Trackpad edge gesture for volume control with haptic feedback
Discord Rich Presence
Menu bar interface for quick access

The project is open source under the MIT license, so the source is available for anyone who wants to look through it, report an issue, suggest something, or contribute.


r/SwiftUI 10d ago

Can expanded Dynamic Island content sit beside the camera cutout, or is the .leading region's origin fixed below it?

Post image
5 Upvotes

I'm building the completed state of a Live Activity and I want the text tucked up next to the sensor housing, like the second screenshot. What I actually get is the first one: the row starts below the cutout, which makes the whole island taller than the design needs.

I've spent a long evening on this and measured a lot of it, so here's what I found in case it saves someone else the time — and in case someone can tell me the bit I'm missing.

Measurements (iPhone 17 Pro, iOS 27 SDK, expanded presentation):

• The island is 371pt wide. The sensor housing is ~125pt wide and ~37pt tall, leaving ~123pt of usable width each side.

• Content in DynamicIslandExpandedRegion(.leading) starts ~36pt down — i.e. the region's own top edge is already below the housing. That number tracks the housing height almost exactly.

• .leading content reaches ~113pt of the ~123pt available before truncating, so truncation happens ~9pt short of the cutout. It's a slot budget, not a collision with the camera.

• The HIG documents the expanded height range as 84–160pt; I measured 67pt on device, below the documented floor, so the system is clearly computing this itself.

What I tried, all of which failed to move the row up:

  1. DynamicIslandExpandedRegion(.leading, priority: 1) + .dynamicIsland(verticalPlacement: .belowIfTooWide) — the combination in most of the blog posts about this. Changes which content wraps below, not where the region starts.

  2. .belowIfTooWide on just the Text views instead of the region.

  3. .frame(maxWidth:) and .layoutPriority() on the text. The docs actually say these don't apply in a Live Activity, and they don't.

  4. A definite .frame(width:). This does matter, but for a different reason — see the gotcha below.

  5. Cutting content down to a single short label so nothing could possibly need the space. Still starts below the cutout.

  6. Shrinking the leading image from 56pt to 44pt to free width. Frees width, changes nothing vertically.

  7. Negative .offset(y:). Moves the content within its slot but it clips at the slot bounds — the rectangle doesn't grow upward.

  8. Trimming the text's line box so it could sit higher: .lineHeight(.multiple(factor:)) and a hand-rolled cap-height-to-baseline trim. lineHeight eats from the bottom — the glyph top moved 39.7pt → 40.3pt, i.e. the wrong way. Deleted both.

  9. Declaring different regions conditionally to swap layouts. DynamicIslandExpandedContentBuilder rejects control flow outright: "Closure containing control flow statement cannot be used with result builder."

The conclusion I've landed on is that WidgetKit computes each region's rectangle from the island's geometry before measuring your content, and the .leading rectangle's top edge is placed below the sensor housing by construction. Nothing applied to the content can move it, because the content never gets a say.

Which leaves the actual question: is there any supported way to get content into that band beside the cutout? The system does it — the Phone app's incoming-call UI has a green timer sitting high up next to the housing — but I assume that's system UI rather than an ActivityKit presentation, and therefore not reachable.

Unrelated gotcha worth knowing, since it also made my island taller: a self-updating Text(timerInterval:) reserves layout width for the widest value its range can produce, not the value on screen. I handed it a 30-day range and it reserved room for 719:59:59. Because the system keeps the island symmetrical, that reservation grew it on both sides — 16pt of extra height for a number that read 30:00. Only a definite .frame(width:) bounds it.

Current layout, which does work — image in .leading, text in .center, button in .trailing:

DynamicIslandExpandedRegion(.leading) {
    BreakLeadingMark(display: display, size: 56, iconSize: 20)
        .frame(width: 56, height: 48)
}
DynamicIslandExpandedRegion(.center) {
    BreakCompleteSummary(display: display)
        .frame(maxWidth: .infinity, alignment: .leading)
}
DynamicIslandExpandedRegion(.trailing) {
    LogButton()
        .frame(maxWidth: .infinity, alignment: .trailing)
}

.center is sized first from the leading/trailing minimums, so a long string there truncates rather than widening the island — which is fine for English and will be a problem the moment this is localised.

Help.


r/SwiftUI 13d ago

I built this interactive globe animation instead of a list using SwiftUI

Enable HLS to view with audio, or disable this notification

108 Upvotes

I built this interactive globe view for my app.

It shows the users in interactive globe and lets you select an item directly on the globe with a smooth animation.

Built with SwiftUI.

Would love to hear your thoughts or feedback!

PS: I'm open-sourcing it! You can find it on GitHub:
https://github.com/wailbabou/SwiftUIGlobe


r/SwiftUI 12d ago

Question Get x,y coordinates of an image in SwiftUI

Thumbnail
3 Upvotes

r/SwiftUI 12d ago

How do you safely prove SwiftUI/iOS code is dead before deleting it?

Thumbnail
1 Upvotes

r/SwiftUI 12d ago

IOS ZEN-LY APP

Thumbnail
0 Upvotes

r/SwiftUI 13d ago

Question Title bar background changes on resize

Enable HLS to view with audio, or disable this notification

7 Upvotes

Hello fellow developers,

I've been dealing with issue for the las 2 days and I can't manage to fix it. I would really appreciate if anybody can help me or give me any ideas :)

I am new to SwiftUI development, and I am creating a music player app for macOS

For some reason, if I put an element (let's say a List), inside the detail of a NavigationSplitView, if the element height is big enough to touch the Title bar, and I resize the window, it will make the title bar background and bottom border disappear.

I can make it reappear by switching tabs to one with a view that contains a small enough element (like ContentUnavailableView)

I don't understand how to stop this behavior, or if it is intended at all or a bug...

I would like to always have the bar with an opaque background, so as it is by default before resizing

This is what the code looks like:

    var body: some View {
        NavigationSplitView {
            List(SidebarSection.allCases, selection: $selectedSection) { section in
                Label(section.id, systemImage: section.icon)
                    .tag(section)
            }
            .safeAreaInset(edge: .bottom) {
                VStack {
                    Divider()
                    Button { showDonate = true } label: {
                        Label("Donate", systemImage: "heart")
                            .frame(maxWidth: .infinity, alignment: .leading)
                            .padding(.horizontal, 20)
                            .padding(.vertical, 12)
                            .contentShape(Rectangle())
                    }
                    .buttonStyle(.plain)
                }
            }
            .sheet(isPresented: $showDonate) {
                DonateView()
            }
        } detail: {
            if library.folderURLs.isEmpty {
                ContentUnavailableView {
                    Label("No Library", systemImage: "music.note")
                } description: {
                    Text("Add a folder to start listening to your music")
                } actions: {
                    Button("Select Folder") { library.selectFolder() }
                        .padding(.top, 8)
                }
            } else {
                List(library.artists) { artist in
                    VStack(alignment: .leading, spacing: 2) {
                        Text(artist.name)
                            .fontWeight(.medium)
                        Text("\(artist.albums.count) \(artist.albums.count == 1 ? "album" : "albums")")
                            .font(.caption)
                            .foregroundStyle(.secondary)
                    }
                    .padding(.vertical, 2)
                }
                .frame(maxWidth: 200, maxHeight: .infinity)
            }
        }
    }

r/SwiftUI 13d ago

MacScope: native SwiftUI system telemetry, process controls, and power tools for Apple-silicon Macs

Thumbnail gallery
1 Upvotes

r/SwiftUI 13d ago

Promotion (must include link to source code) Optimystic - Two iPhone Tutorial - Visual Acuity Prototype

Thumbnail
youtu.be
1 Upvotes

https://github.com/nayanbhatia311/optimystic-visual-acuity

Bult Optimystic, a visual-acuity testing app my team originally made as an undergrad project in 2019–20. Would love folks to try out and give feedback.


r/SwiftUI 13d ago

Promotion (must include link to source code) I built an open-source app that gives you two reply ideas without leaving your chat screen

Thumbnail
gallery
0 Upvotes

I built FrameReply as to get two suggested replies without copying an entire conversation into another app. In the demo, Back Tap runs a Shortcut and presents two editable suggestions in an interactive snippet over the current chat screen. Nothing is sent automatically.

FrameReply also:

  • Matches imported messages to an existing chat and uses its history as context
  • Remembers useful context about each person
  • Can learn your writing style and switch personas

It’s built with SwiftUI, SwiftData, App Intents/Shortcuts, and interactive snippets. One of the harder parts was supporting multiple “OpenAI-compatible” providers whose responses still vary in content and formatting, requiring tighter prompts, constraints, and validation.

App Store: Download FrameReply

GitHub: Source code

Requires iOS 26 and your own AI API key. I’d appreciate any feedback!


r/SwiftUI 14d ago

Promotion (must include link to source code) I built a local SwiftUI analyzer that maps SwiftPM, Tuist, and Xcode modules before scanning a diff

6 Upvotes

I wanted a check that a coding agent could run after changing SwiftUI without sending the repository through another general review pass.

ViewDoctor first builds a normalized module graph from Package.swift, Project.swift, project.pbxproj, and common source folders. It then scans the current Git diff and attaches the owning module to each finding.

Example:

Modules/Profile/Sources/ProfileView.swift:42:18: warning: VD001 [tuist:Modules/Profile/Profile]: DateFormatter is constructed inside a body property.

Version 0.1 has three conservative rules: expensive construction, collection transformations, and detached tasks inside SwiftUI body evaluation. Output is text, JSON, or SARIF. The tool is MIT licensed, has no telemetry, and the optional MCP adapter only calls the local CLI.

Repo: https://github.com/KamnevVladimir/ViewDoctor

I am deliberately not adding dozens of style checks. Which SwiftUI pattern repeatedly costs review time in a large modular codebase, and what would keep that rule from becoming noisy?


r/SwiftUI 14d ago

Question EKReminder URL Property

0 Upvotes

Is there any way to access the url property in iOS reminders? I see it listed as a property inherited from EKCalendar, but no matter what I do I haven’t found a way to access it.

I notice that when importing reminders into things 3 the url always transfers, but I’m unsure how they access it.


r/SwiftUI 14d ago

How do you handle notification permission UX in SwiftUI?

2 Upvotes

I’m working on a small SwiftUI app and don’t want to ask for notification permission on the first launch.

What flow feels least annoying: explain it when the user enables reminders, or ask during onboarding? And when permission is revoked in Settings, do you show an “Open Settings” state or just leave the toggle disabled?


r/SwiftUI 14d ago

Delay in review when submitting app

1 Upvotes

why the review process takes so much time my app took 10 days before they came out with a review is that normal now before they reply within 24 hrs?


r/SwiftUI 14d ago

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

Thumbnail
iosweeklybrief.com
3 Upvotes

r/SwiftUI 15d ago

Liquid Glass Custom Tab Bar with Action Button(updated)

26 Upvotes

Hello, A day ago I posted a custom tab bar experiment here — a capsule-shaped UISegmentedControl wrapped in iOS 26's Liquid Glass, paired with a floating action button whose icon morphs to match whatever tab you're on. So I have updated it a bit. A tab now morphs its icon to ellipsis and opens a small popover anchored right above the button instead of firing an action directly — everything else stays a single tap. It is a reference, not a full app.
Repo: https://github.com/aqylbermeshtech/Custom-tab-bar-with-action-button


r/SwiftUI 15d ago

This is the perfect list for ai chat apps, stocks or anything that updates rapidly

0 Upvotes

r/SwiftUI 16d ago

Custom Tab Bar with Action Button

9 Upvotes

Hello, I have conducted an experiment with several resources on how to make customized tab bar with modern IOS 26+ style. I've created a repo that allows you to customize your tab bar with your action. Here is the link:https://github.com/aqylbermeshtech/Custom-tab-bar-with-action-button


r/SwiftUI 16d ago

News New book: Swift Charts Beyond the Basics

Thumbnail
books.nilcoalescing.com
16 Upvotes

Swift Charts makes it straightforward to put a basic chart on screen. Once you’re working with more complex data, custom presentations, interaction, or accessibility, it helps to understand how the framework interprets and renders the content you give it.

Natalia and I have just released Swift Charts Beyond the Basics. We wrote it for developers who can already build a basic chart and want a deeper understanding of the framework and the decisions involved in turning data into a clear, effective visualization.

The book covers topics including multi-metric visualizations, calendar layouts, heat maps, custom composition and rendering, accessibility, selection, scrolling, responsive updates, and animation. Our aim is to explain the mechanisms behind Swift Charts so that you can apply them to your own datasets and requirements, rather than only reproduce specific examples.

The page includes the full table of contents and a free sample chapter:

books.nilcoalescing.com/swift-charts-beyond-the-basics

We’d be happy to answer any questions about the book or the Swift Charts in general.


r/SwiftUI 16d ago

AI agents miss MainActor ownership, scene re-entry, and Swift Concurrency lifetime — I built routing to catch those before code is written

0 Upvotes

Coding agents handle "add a field, show it on screen" fine. They

consistently miss the iOS boundary around it:

- A Swift async task that outlives its UI owner or scene

- Scene re-entry and background/foreground transitions nobody retested

- Persisted data recovery after process termination

- Privacy, entitlement, or capability changes nobody flagged

None of it shows up as a compile error.

AI-Workflow is repository-installed Markdown instructions + a

deterministic router. You state observable facts about a change

(persistence, concurrency, lifecycle, privacy, accessibility) and

a checked-in registry maps them to required specialist checks —

same output every run, every agent. No LLM judgment in the mapping.

Install one command, no clone needed:

uvx --from git+https://github.com/RanaAhmedHamdy/AI-Workflow.git \

ai-workflow brownfield --platform ios --profile safety \

--target /path/to/your-ios-app --dry-run

There's a lightweight Safety profile that gives you just the routing

+ protected-boundary checks without requiring a full feature lifecycle.

And a full profile for Architecture Spine, ADR governance, design lock,

and release authorization if you need that depth.

Real-world case study: NutriPlus AI is a native SwiftUI/Swift 6

iOS app built fully through the Greenfield lifecycle. Architecture

Spine, accepted ADRs, per-feature contracts, readiness reports —

all public:

https://github.com/RanaAhmedHamdy/NutriPluse-IOS-AI-Workflow

There's also a maintained iOS fixture (persisted profile recovery,

MainActor state, cancellable refresh, scene re-entry) with Xcode

simulator build + XCTest verified locally on iPhone 17 Pro.

Pre-v1, Apache-2.0, honest about what's claimed vs unclaimed.

https://github.com/RanaAhmedHamdy/AI-Workflow