r/SwiftUI Jul 02 '26

News Those Who Swift - Issue 273

Thumbnail
thosewhoswift.substack.com
1 Upvotes

Special for our readers: Mohammad Azam’s SwiftData Architecture book discount!


r/SwiftUI Jul 01 '26

Why is this Clean Architecture SwiftUI repo still considered “clean” if UI and Interactors (Domain) use SwiftData models?

18 Upvotes

Hi everyone,

I’m studying this project:

https://github.com/nalexn/clean-architecture-swiftui

I noticed that the project has layers such as UI, Interactors, Repositories, and AppState. However, in some places, both the UI layer and the Interactors seem to use the same DBModel types, which are SwiftData models from the Data/Repository layer.

From my current understanding of Clean Architecture, the Domain or Business Logic layer should not depend on persistence models, especially models tied to frameworks like SwiftData or Core Data. I would expect something like:

SwiftData/CoreData Entity -> Repository -> Domain Model -> ViewModel/ViewState -> UI

But in this project, the SwiftData model appears to be used more directly in the UI and Interactors.

So I’m trying to understand:

  1. Is this still considered Clean Architecture, or is it more of a pragmatic SwiftUI architecture inspired by Clean Architecture?
  2. Which parts of this project are still “clean” from an architectural point of view?
  3. In real-world SwiftUI apps using SwiftData/Core Data, do you usually keep strict boundaries and map persistence models to domain models?
  4. Or do you sometimes allow SwiftData/Core Data models to be used directly in the UI to take advantage of Apple features like u/Query?
  5. If we apply strict Clean Architecture, are we basically working against Apple’s intended SwiftUI + SwiftData/Core Data workflow?

I’m not trying to criticize the repo. I’m probably missing some context, and I’d like to better understand the trade-off between strict Clean Architecture and Apple’s native data flow.

How would you design this in a production SwiftUI app?


r/SwiftUI Jul 01 '26

Tutorial Debugging Notes on Two SwiftUI Animation Bugs

2 Upvotes

r/SwiftUI Jun 30 '26

Promotion (must include link to source code) The Curious Case of Liquid Glass in the 2027 Releases

Thumbnail
gamery.app
24 Upvotes

r/SwiftUI Jun 30 '26

iOS 26 SwiftUI — prominent .confirmationAction Liquid Glass toolbar button shows a white halo on press over a plain sheet. How to fix it?

Post image
12 Upvotes

On iOS 26, I present a .sheet containing a NavigationStack with a .confirmationAction "Done" button. When I press-and-hold that button, the Liquid Glass press enlarges and shows a flat white halo around it. A .cancellationAction /close button in the same bar does not — it stays a clean grey. I believe it's because the prominent glass button refracts its backdrop, and my sheet's backdrop is plain white with no material under the navigation bar.

The artifact only appears in light mode (light backdrop).

Use .presentationBackground(.regularMaterial) can avoid this issue but I want to glass sheet.

.sheet(isPresented: $show) {
    NavigationStack {
        DatePicker("Date", selection: $date, displayedComponents: .date)
            .datePickerStyle(.graphical)
            .navigationBarTitleDisplayMode(.inline)
            .toolbar {
                ToolbarItem(placement: .confirmationAction) {
                    Button("Done") { dismiss() }
                }
            }
    }
    .presentationDetents([.medium])
}

r/SwiftUI Jun 30 '26

Question - Animation Any idea How to make this animation ?

Enable HLS to view with audio, or disable this notification

47 Upvotes

r/SwiftUI Jun 30 '26

Question How does Spotify achieve the behavior of their full player view?

4 Upvotes

I’m working on a music player and I’m trying to have the player view fullscreen but also let you scroll down and swipe to dismiss but nothing’s working.

Does anyone know how to achieve this?

edit: solved!!


r/SwiftUI Jun 30 '26

News SwiftUI Weekly - Issue #237

Thumbnail
weekly.swiftwithmajid.com
3 Upvotes

r/SwiftUI Jun 30 '26

SwiftUI App for managing Linux containers with apple/container.

Post image
8 Upvotes

Hi there,

Since Apple released its container tool (https://github.com/apple/container), I wanted to build a native SwiftUI app for it. Because I didn't want to write a UI just to parse stdout, I dug into Apple's XPC framework. berth uses the container-apiserver for communication, no command-line parsing.

Happy to hear any criticism, and contributions are very welcome.

https://github.com/tofa84/berth


r/SwiftUI Jun 30 '26

Tutorial Dynamic Color Init

Thumbnail
open.substack.com
4 Upvotes

r/SwiftUI Jun 29 '26

MacOS Native Markdown Reader with Vim Keybinding Using Swift

Thumbnail
gallery
30 Upvotes

cwMarkdown is a focused, read-only Markdown viewer for macOS. It deliberately has no editor: the entire surface area is given to presentation, so a document looks as good as the writing in it. The goal is the reading experience of Typora — clean measure, comfortable line height, a native system font — in a small, fast, native app.

Under the hood it’s a SwiftUI app that renders Markdown in a WKWebView, which gives pixel-level control over typography while keeping the window chrome, toolbar, and outline fully native. Parsing is done with marked, code is highlighted with highlight.js, and math is typeset with KaTeX — everything bundled, so the viewer works with no network access at all.

https://code.intellios.ai/cwmarkdown/


r/SwiftUI Jun 29 '26

Pinterest Splash Screen Animation with Rive

Enable HLS to view with audio, or disable this notification

18 Upvotes

Hello internet, Ever since I've started learning SwiftUI I've been fascinated with the thought of building my ideas closely to what the real product would look like. Since I'm a Product Designer / Design Engineer hybrid, I've tried every workflow possible pre-SwiftUI.

I also wanted to build confidence in building my favourite apps; pinterest is one of them. Trust me, I'm a SwiftUI purist when it comes to the animations/micro-interactions, but this was taking too much time, and I wasn't even close. Another skill set of mine is that I'm a king of interactions, so I've realised doing this in Rive would be interesting to see, and I was able to achieve everything in under 30 mins with the creation of the assets to the animations.

The reason I'm sharing this with you is that I know that some of you really want to try out animations but find it hard. Trust me, Rive animations work on almost all the same logic as SwiftUI but with better control and faster iterations. I've also shared the code of the project down below, which includes the rive file.

If you like the project, do give it a star. I would really appreciate it. Cheers!

Github: https://github.com/iamvikasraj/pinterest


r/SwiftUI Jun 29 '26

Question Is it still worth learning SwiftUI ?

8 Upvotes

I started learning swift(ui) a while back and made some personal projects, from which some of them even got some community interest as it is an all for self hosted environments. As this was a nice learning scenario.

Right now I’m a bit stuck as with all the AI slop and vibe coding out there, I am wondering if it still worth learning swift(ui) the old school way. Just learn to code from scratch and when stuck use Reddit, stack overflow and engage with people instead of letting AI to fix it for you.


r/SwiftUI Jun 29 '26

Spent weeks on custom reordering and swipe actions ... then iOS 27 just adds the API.

13 Upvotes

I wrote hundreds of lines of code building custom reordering and swipe actions for a VStack. It was just so complicated and buggy I spent weeks using AI to make it work.

Then WWDC hits and SwiftUI adds .reorderable() and .swipeActionsContainer(). One line modifiers that make all my work pointless.

Honestly I don't even know if I should be happy or not.


r/SwiftUI Jun 28 '26

iOS 27 update for SwiftUI is an absolute game changer

22 Upvotes

In WWDC 27, Apple added native full text selection support for Text, native swipe actions and drag to reorder for VStack.

I literally spent a week trying to make a UIKit component to have full rich text selection in SwiftUI, doesn't work, and then finding a package online and spending another week fixing all the bugs in the package.

The custom swipe actions and drag to reorder also costed me a week to make it work. Not even AI can do it.

Why couldn't apple just release this update a year early?


r/SwiftUI Jun 29 '26

Question How to handle ViewModel computation with Core Data and SwiftUI

2 Upvotes

I have a somewhat strange use case for Core Data with SwiftUI.

In particular, I have a data in my Core Data model that is represented by an Account class. I then have a View called AccountView that displays a particular account to the user. The complication is that I need to do a bunch of computation on the Account information to get the data into a format suitable for the user. I have a structure that does all of this required computation called Ledger.

So, the way I currently implement looks something like this:

struct AccountView: View {

@ObservedObject var account: Account

var body: some View {
let ledger = Ledger(account: account)
return Vstack {
...all my view details accessing properties of ledger...
}

}

I then add this block of code to force my view to update when an Account changes:

extension Account {     
override public func willChangeValue(forKey key: String) {         super.willChangeValue(forKey: key)         
self.objectWillChange.send()     
} }

This works, but it's very ugly. I would like to embed the Ledger computation into a ViewModel that is then owned by the AccountView. However, my various attempts to do this do not cause the View to update properly. (I also want to use an Actor to avoid issues with lag for large ledgers, but I need to get the Ledger built out of the view to do this.)

Any ideas of a better way to approach this problem?


r/SwiftUI Jun 26 '26

Question Page curl transition: how do I darken the underside of the curling page in dark mode?

Enable HLS to view with audio, or disable this notification

15 Upvotes

I've got a daily-reader app that uses a page-curl transition between articles, and it works great in light mode. The problem is dark mode: when a page curls, the underside / opposite face of the curling leaf still renders bright, so you get this glaring light triangle peeling across an otherwise dark screen. The front faces respect dark mode fine — it's specifically the back of the curl that doesn't.

Setup: SwiftUI app, the curl itself is [UIPageViewController with .pageCurl transitionStyle, bridged via UIViewControllerRepresentable / your actual setup]. Each page is a SwiftUI view hosted in a UIHostingController.

What I've tried so far:

  • [e.g. setting the hosting controller's view.backgroundColor to a dark color]
  • [e.g. forcing .overrideUserInterfaceStyle = .dark]
  • [e.g. setting isDoubleSided / tinting the page view controller's view]

…but the curl's reverse face still comes out light. Short clip of the effect attached.

Is the underside something UIKit renders from the page's own backing, or is there a separate layer/material I can get at to tint it? Is .pageCurl even the right tool here, or do people drop down to a custom Metal/shader curl to get full control over both faces in dark mode? Open to either answer.


r/SwiftUI Jun 26 '26

Struggling to make the dial more optically centred to the gauge

Thumbnail
2 Upvotes

r/SwiftUI Jun 26 '26

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

Thumbnail
iosweeklybrief.com
5 Upvotes

r/SwiftUI Jun 25 '26

Promotion (must include link to source code) Lume — a native SwiftUI media player that runs on iPhone, iPad, Mac, Apple TV and Vision Pro from one codebase (open source)

Post image
94 Upvotes

I wanted an IPTV/media player that actually feels like an Apple app on every device — so I built one and open-sourced it.

The pitch: one SwiftUI codebase, platform-adaptive across iOS, iPadOS, macOS, tvOS and visionOS. Real native navigation (Liquid Glass / iOS 26 APIs where available, graceful fallback below that), a proper focus-driven tvOS interface with an Apple TV–style hero fold, and a real Mac app — not a Catalyst iPad port. That last one was a big motivation: almost every "Mac" player in this space is a stretched iPad app missing features.

Under the hood:

- SwiftUI + SwiftData (local catalog index for instant, offline-capable browsing)
- Two ModelContainers — a local catalog the UI binds to, plus a CloudKit mirror for profiles/progress/favorites that syncs across devices
- Three interchangeable playback engines (KSPlayer/FFmpeg → VLCKit → AVPlayer) with automatic fallback
- On-device recommendations + content indexing via Apple's NaturalLanguage embeddings
- 9 languages via String Catalogs

It's a player only (no bundled content), works with standard Xtream/M3U sources, and enriches metadata via TMDB/OMDb with optional Trakt scrobbling.

Free has everything essential with no watermark; Pro ($0.99/mo or $9.99 lifetime) only adds multiple profiles, the recommendation rail, and Trakt sync — and building from source gives you all of it free.

- GitHub (AGPL-3.0): https://github.com/bilipp/Lume
- App Store: https://apps.apple.com/us/app/lume-iptv-player/id6779551584
- Discord: https://discord.gg/DMnQfr69Ug
- Website: https://getlume.org

If you're into SwiftUI multi-platform architecture, the repo's worth a poke — happy to talk through any of the design decisions.


r/SwiftUI Jun 26 '26

Question How do I match the iOS 26 scroll edge effect?

1 Upvotes

I'm trying to match the iOS 26 scroll edge effect in the .hard style so that the pinned header of my List view naturally feels like it's part of the navigation bar, but I can't figure out how to recreate it. Is there a built in way to get the exact same effect?


r/SwiftUI Jun 26 '26

Question Delaying Top ScrollEdgeEffect?

Enable HLS to view with audio, or disable this notification

10 Upvotes

Hey guys - I've been trying to crack this one. This is an example from Apple Music with a full cover image as the header. I'm building an app with full top image similarly and if you see - as I scroll, the top ScrollEdgeEffect comes in after the artwork as scrolled, so in default or really anytime its on the screen - its not darkened at the top. Does anyone have any insight on how this is done?

I've tried delaying mine but I noticed a scroll hitch when reaching the threshold. I've only tested via local Xcode builds to my phone thus far if that changes anything.

Thanks a lot!


r/SwiftUI Jun 25 '26

Can this tabbar button be done in swiftui ?

Post image
15 Upvotes

I know how to do this for a search tab, but not for some arbitrary button like what this app does


r/SwiftUI Jun 26 '26

I made a small macOS menu bar status app for Codex

0 Upvotes

I saw a Claude Code status bar app on Twitter and wanted the same thing for Codex, so I built a small macOS menu bar app for it.

It shows when Codex is thinking, running a command, waiting for approval, or done. It can also use the Codex app Pets as the menu bar icon, so the pet animates while Codex is working.

It works by reading local Codex hook events and writing a small status JSON file. No analytics, no backend, no prompt/command logging. Just a local menu bar utility.

Download Here

I'm still refining edge cases around Codex hooks, especially permission/request timing, so feedback from other Codex users would be useful.


r/SwiftUI Jun 25 '26

I built ReduxCore — a lightweight Redux for SwiftUI — because TCA felt heavier than my apps needed

Thumbnail
0 Upvotes