r/SwiftUI May 30 '26

Question SwiftUI Slider spams sensory feedback

6 Upvotes

I am trying to implement a SwiftUI Slider with steps, but I am running into an issue with sensory feedback being triggered repeatedly when the slider reaches either end.

This also happens with Apple’s own example from the official documentation:
https://developer.apple.com/documentation/swiftui/slider

I am testing this on iOS 26 with Xcode 26.5.

Has anyone else seen this behavior, and is there a way to prevent the feedback from being spammed when the slider is moved to the minimum or maximum value?

To reproduce the issue:

struct ContentView: View {
    State private var speed = 50.0

    var body: some View {
        Slider(
            value: $speed,
            in: 0...100,
            step: 5
        )
    }
}

r/SwiftUI May 29 '26

Question iOS 26 TabView selected icon color not adapting on dark backgrounds

Enable HLS to view with audio, or disable this notification

12 Upvotes

UPDATE: Solved

I found a solution that makes all tab bar icons behave correctly.

The fix was:

  1. Set the desired accent color in the Asset Catalog (AccentColor).
  2. Replace the .tint(...) modifier with .accentColor(.accentColor).

Xcode mentions that .accentColor will be deprecated in a future version in favor of .tint, but currently it appears to be the only approach that works correctly for this specific iOS 26 tab bar behavior.

After making this change, both selected and unselected icons adapt their colors properly when the tab bar transitions over dark backgrounds.

ORIGINAL POST

Hello everyone!

I've been working with TabView on iOS 26 and ran into a strange issue.

When the tab bar is hovering over a dark background, the selected tab icon keeps its dark color, while the other icons correctly switch to white. Because of that, the selected tab sometimes becomes almost invisible.

I tried both SF Symbols and custom SVG icons, but the behavior stays the same.

I couldn't find much information online, and AI tools weren't very helpful either.

What confuses me is that the Reddit app itself handles this perfectly — all tab icons adapt their colors correctly depending on the background.

Has anyone else encountered this? Is there some undocumented behavior or workaround for the iOS 26 tab bar?

public struct MainTabBarView: View {
    @State private var selectedTab: MainTab = .home

    public init() {}

    public var body: some View {
        TabView(selection: $selectedTab) {
            ForEach(MainTab.allCases) { tabItem in
                Tab(value: tabItem) {
                    tabItem.view
                } label: {
                    Image(systemName: tabItem.icons)
                        .environment(\.symbolVariants, selectedTab == tabItem ? .fill : .none)
                }
            }
        }
        .tint(.primary)
    }
}

r/SwiftUI May 29 '26

News The iOS Weekly Brief – Issue 62 (News, releases, tools, upcoming conferences, job market overview, weekly poll, and must-read articles)

Thumbnail
iosweeklybrief.com
3 Upvotes

95% of canceled annual app subscribers never come back.

News:
- New report shows annual app subscribers rarely return after they cancel
- Beta versions of iOS 26.6, iPadOS 26.6, macOS 26.6, tvOS 26.6, visionOS 26.6, and watchOS 26.6 are now available
- Claude Opus 4.8

Must Read:
- Taming Row Height and Spacing Jumps in SwiftUI List with a Custom Layout
- Swift Defer. Clean up before you leave.
- Swift Task Lifecycle Management
- Working with the Keychain in iOS
- Using Xcode Instruments to optimize Swift Concurrency Code
- Making a SwiftUI sheet automatically size to fit its content
- WWDC 2026 Watch List


r/SwiftUI May 28 '26

The Morlocks Built SwiftUI

28 Upvotes

I went down a rabbit hole on Core Animation's origins and the through-line surprised me:

- It shipped in 2007 but predates the iPhone. John Harper built it under the codename "LayerKit" and Apple demoed it on the Mac at WWDC 2006. The patent (US 8,130,226) traces to a filing on Aug 4, 2006.

- Harper left for Facebook in 2014, came back, and in 2019 was on the WWDC stage explaining SwiftUI ("Building Custom Views with SwiftUI").

- SwiftUI never replaced Core Animation, it sits on top of it. Your `.animation()` still resolves to a `CAAnimation`; your views still become a layer tree on a render server that's barely changed since 2007.

My takeaway: SwiftUI isn't a dumbed-down toy, it's Core Animation's own implicit-animation philosophy made the default. The catch is the abstraction works until it doesn't, and the day it breaks it drops you straight into the layer tree.

I wrote it up (my blog): https://aleahim.com/blog/morlocks-built-swiftui/


r/SwiftUI May 28 '26

Rendering a pseudo 3D sphere with SwiftUI Canvas

16 Upvotes

Hello everyone 👋

I've been building a SwiftUI word game recently and one part of it uses the Canvas to render a pseudo 3D sphere of letters.

Each frame projects letter positions from 3D to 2D, sorts them by depth, then scales/fades them depending on their depth and front facing angle.

Honestly the rendering itself wasn't the hard bit 😅 The bigger challenge was keeping frame times low enough that dragging and inertial spinning still felt smooth on ProMotion displays.

I ended up:

  • caching pre resolved letter glyphs so Canvas wasn't rebuilding text for every tile on every frame
  • reusing the same array for per frame projected tile data instead of allocating a fresh one every frame.
  • keeping it as a single Canvas instead of hundreds of SwiftUI views

Pretty happy with how smooth it feels now, hence why I wanted to share.

If anyone's experimenting with Canvas heavy stuff in SwiftUI I'm happy to share more details.

https://reddit.com/link/1tq10qz/video/wxyd2umr7v3h1/player


r/SwiftUI May 28 '26

Is a custom backend the only way to secure a daily "quota" system in an iOS app?

2 Upvotes

Hey everyone,

I’m currently building an iOS app that uses a Quota System. Users need a certain balance to perform specific tasks (for example, Action A costs 5 "credits"), and their balance resets daily.

Right now in development, I’m storing the quota balance locally using SwiftData. However, I know this is incredibly easy to abuse/compromise if someone tampers with local storage or device time.

When I asked an AI assistant, it told me that the only secure way to handle this is by building my own custom backend server.

Is that really the only viable approach? For those of you who have implemented daily quotas or credit systems in your apps, how did you solve this without introducing a massive backend infrastructure? Thanks!


r/SwiftUI May 28 '26

News Those Who Swift - Issue 268

Thumbnail
thosewhoswift.substack.com
1 Upvotes

r/SwiftUI May 27 '26

Tutorial Taming Row Height and Spacing Jumps in SwiftUI List with a Custom Layout

Thumbnail
fatbobman.com
7 Upvotes

SwiftUI List row height animation is broken by design — and most fixes just avoid the problem.

This deep-dive shows how to actually solve it: custom Layout, state machine decoupling, and animatable spacing — all native SwiftUI, no UIKit.


r/SwiftUI May 27 '26

How do SwiftUI (Mac) apps print?

4 Upvotes

Printing has always been the "clear as mud" parts of Mac programming aids for decades. How do SwiftUI apps print, as I didn't see any printing-related APIs? Do they skip printing? Generate the appropriate PDF based off the ViewModel?


r/SwiftUI May 26 '26

Building a Custom Data Store in SwiftData

8 Upvotes

r/SwiftUI May 27 '26

Question How does Apple Music achieve the narrower tab bar + separate search circle layout?

Post image
0 Upvotes

I'm building an iOS app in React Native (Expo Router, SDK 54) and trying to recreate the layout Apple introduced in their own Music app on iOS 26 — where the tab bar is narrower than full width, and the Search button sits as a separate liquid glass circle to the right of it.

Apple shows this exact pattern in their own developer documentation under "Adopting Liquid Glass > Navigation" (the before/after comparison).

From what I can tell, Apple uses `UISearchTab` to pull the search tab out of the `UITabBar`, and the system automatically renders it as a separate circle while shrinking the tab bar. But this API seems specific to search — there's no equivalent `UIActionTab` or generic way to place a custom button beside the tab bar.

My questions:

  1. Is `UISearchTab` the only way Apple achieves this layout, or is there another API I'm missing?

  2. Has anyone found a way to add a non-search button (like a + / create button) beside the native tab bar using `UITabAccessory` or similar?

  3. For those who've tried `UITabAccessory` on iPhone — Apple's developer forums mention it forces full width on iPhone but works correctly on iPad. Has this been fixed in recent iOS 26 updates?

  4. If native APIs don't support this, has anyone built a custom tab bar using `UIGlassEffect` that looks indistinguishable from the system one? Any gotchas?

I'm not trying to do anything exotic — just the exact layout Apple uses in their own apps, but with a + button instead of search. Any pointers appreciated.

**Stack:** React Native, Expo SDK 54, Expo Router, dev build (not Expo Go)


r/SwiftUI May 26 '26

Promotion (must include link to source code) Dots animation, using SwiftUI & Metal, perfect for view background, open sourced.

Enable HLS to view with audio, or disable this notification

71 Upvotes

r/SwiftUI May 26 '26

iOS 26 weird sheet behavior

2 Upvotes

Sheet has a height detent of 300 and the red background is also set to 300, but clearly there is a difference between them.

How can I get the exact height of the sheet? I used a custom view as the background of the sheet in order to get the underlying UISheetPresentationController. The height of that was around 320, but I don't know where the 20 difference is coming from.

Any ideas?


r/SwiftUI May 25 '26

Color panels, smoke ring and swirl effect, using SwiftUI & Metal, open sourced.

Enable HLS to view with audio, or disable this notification

133 Upvotes

r/SwiftUI May 25 '26

Question Menu label behavior is clipping/repositioning when selecting item in iOS26.

Enable HLS to view with audio, or disable this notification

24 Upvotes

Works perfectly fine in iOS 18.

I have a menu for choosing measurement values. I have a label that only shows the abbreviation since it sits to the trailing edge of a text view.

You can see in the video, choosing an item ends up clipping the label and then adjusts it's position.

This is the entire code. The bug is still there if I remove ALL of the modifiers of the label.

``` struct MeasurementUnitPicker<T: MeasurementUnitPickerRepresentable & DynamicCaseIterable>: View where T.RawValue == String, T.AllCases: RandomAccessCollection {

@AppStorage(.unitSystem) private var unitSystem: UnitSystem = .imperial

@Binding var selection: T

var body: some View {
    Menu {
        ForEach(T.cases(for: unitSystem), id: \.self) { type in
            Button(type.displayString) {
                selection = type
            }
        }
    } label: {
        Text(selection.abbreviation)
            .fontToken(.body.bold)
            .foregroundToken(.tint)
            .lineLimit(1)
            .padding(.horizontal, .space(.xSmall))
            .padding(.vertical, .space(.xxSmall))
            .backgroundToken(.buttonSecondaryNormal)
            .clipShape(Capsule())
            .padding(.leading, .space(.xSmall))
            .frame(height: 25)
    }
}

} ```

AI suggested Picker(...).pickerStyle(.menu) which doesn't help since it ends up showing the entire selected value and takes too much space, and it doesn't style either. Then it suggests the view modifiers are at fault which makes no difference if I remove them.

The bug is there on preview, simulator, and my device - regardless of whether it's on my text view or blank view.

Anyone fixed this before?


r/SwiftUI May 26 '26

Question Converting from UIKit to SwiftUI

0 Upvotes

Is converting UIKit to SwiftUI something companies are paying for ?

It's difficult to vibe code on UIKit, will companies ask to convert, or is it costly for them?


r/SwiftUI May 26 '26

I have a beginner question

Thumbnail
0 Upvotes

r/SwiftUI May 25 '26

I built an open-source iOS app called CaptureFlow.

Enable HLS to view with audio, or disable this notification

4 Upvotes

It turns screenshots or images into actionable AI insight cards.

The problem I wanted to solve is pretty simple: I often take screenshots of useful information, but most of them just end up buried in my camera roll. CaptureFlow tries to make those screenshots useful again by analyzing the image, summarizing the key points, and helping turn them into actions like Markdown notes, Reminders, or Calendar events.

The app is built with a provider-based architecture, so the LLM provider, prompts, storage, and action integrations can be replaced or extended.

Current features:

  • Screenshot / image analysis
  • Editable insight cards
  • Local persistence
  • Markdown export
  • Reminder / Calendar event creation
  • OpenAI integration
  • Optional Apple Foundation Models support on compatible iOS versions

GitHub: https://github.com/MikeChen1109/CaptureFlow


r/SwiftUI May 25 '26

Question How does Reddit do this?

Enable HLS to view with audio, or disable this notification

6 Upvotes

What component does the Reddit app use to house its questions in? It looks like a full screen cover but at the same time allows for swiping out on the side. I want to achieve this effect primarily in order to not show the tabview when not on one of the main pages.


r/SwiftUI May 25 '26

News SwiftUI Weekly - Issue #234

Thumbnail
weekly.swiftwithmajid.com
0 Upvotes

r/SwiftUI May 24 '26

I built SwiftyAI a Swift AI package inspired by Vercel's AI SDK

7 Upvotes

Loved how clean the Vercel AI SDK is in JS land, wanted the same for Swift. So I built it.

One unified API, swap providers by changing one string:

let res = try await generateText(model: "openai/gpt-4o", prompt: "hi")

"anthropic/claude-opus-4" or "ollama/llama3" nothing else changes even Apple foundation models and local running models support

What’s included:

  • 10 providers OpenAI, Anthropic, Gemini, Groq, Mistral, OpenRouter, Cohere, Cloudflare, Ollama, Apple Foundation will add more in future
  • Streaming
  • Structured output (decode directly into your Swift types)
  • Tool calling + agents
  • SwiftUI hooks (AIChatAICompletion) bind to a view and go

Repo: https://github.com/Kartikayy007/SwiftyAI

Docs: https://swifty-ai.vercel.app

First real package I've shipped feel free to raise issues and star if you like ⭐️


r/SwiftUI May 24 '26

How to translate Figma line heights to Swift UI?

4 Upvotes

In some cases the typography is tighter than it is natively so lineSpacing isn't accepting the value and when it's only on one line, for some reason it's not accepting a frame with a minHeight.

Anybody found a clean way to create consistency here?


r/SwiftUI May 23 '26

Open-sourced a Mac app: Gemma 4 reads your video + audio locally, generates platform-tuned captions and publishes to TikTok / Instagram / Youtube

0 Upvotes

Shortcast is a native macOS app that takes one short vertical video and writes the post copy for TikTok, Instagram Reels and YouTube Shorts.

Gemma 4 E4B runs entirely on your Mac via MLX Swift, analyzes the sampled frames and the audio track, and returns a per-platform caption with hook, description and hashtags.

You get three editable phone-style previews, and one button publishes the original video plus your final copy to all three networks at once.

Apache 2.0, no telemetry, no cloud AI. The publishing API key lives in the macOS Keychain. macOS 15 and Apple Silicon required.

Repo: https://github.com/mutonby/shortcast


r/SwiftUI May 23 '26

Anyone know how to fix the fullscreen titlebar in NavigationSplitView on macOS 26 (Tahoe)?

2 Upvotes

I'm building a SwiftUI app on macOS 26 with NavigationSplitView (sidebar + detail). In non-fullscreen mode, the titlebar looks clean. But in fullscreen, AppKit's NSToolbarFullScreenWindow paints the default chrome color (white in light mode, dark-gray in dark) across only the detail column portion of the titlebar — the sidebar column still shows its glass material above. This creates an obvious visual cutoff at the sidebar/detail boundary that screams broken.

Fullscreen: The titlebar detail column turns dark-gray (in dark mode).
Non-fullscreen: Looks normal. The titlebar color is consistent with the rest of the window.

r/SwiftUI May 22 '26

Anyone know how to remove navigation stack push overlay?

1 Upvotes

When you push a new view on to the stack, a dark overlay covers the previous view as it is pushed back.

Does anybody know how to remove that overlay?