41,771 questions
0
votes
1
answer
23
views
.presentationDetents([.height(550)]) works on iOS 26 but becomes fullscreen on iOS 18.6
I'm trying to present a SwiftUI sheet with a fixed height of 550 points, and I expect it to remain 550 points tall on all iOS versions.
.sheet(isPresented: $showSheet) {
MySheetContent()
....
1
vote
1
answer
47
views
How do I remove the square white background behind the rounded corners of the keyboard in Xcode 26?
check the screen shot
As shown in the screenshot, I haven't added any extra definitions or styling. The white background behind the rounded corners appears in some places but not in others. Is there a ...
0
votes
0
answers
42
views
Adding @escaping to a view init param breaks the XCode Preview view selection highlighting
*EDIT 2: also seem to fix if I use a closure for the method instead of a bound method reference.
EDIT: added full example
All of a sudden I noticed the XCode Preview selection highlighting stopped ...
0
votes
1
answer
46
views
Animate a view's transition differently from its modifiers (in SwiftUI)
I'm writing a SwiftUI app in which I'd like to have objects animate slowly when they change location and quickly when they disappear. I can't figure out how to achieve that.
Take this example. There ...
1
vote
2
answers
54
views
How do I optimize a view that potentially contains thousands of views?
I have a grid/tile view implemented like below:
struct Grid: View {
let size: Int
var body: some View {
LazyVStack(spacing: 0) {
ForEach(0..<size) { _ in row }
}...
-4
votes
0
answers
33
views
Files shared on iOS via Files, Mail or Messages don't show custom icon [closed]
Spent hours with multiple AIs. I export/import JSON, use ShareLink - all works. Except the icons.
Tried single res 1024x1024. Three diff res for @2x and @3x. Nothing works - get generic icon, ...
-4
votes
0
answers
50
views
How to completely remove the horizontal “ghost lines” inside List with Section and custom rows?
I’m working on a screen that uses a single SwiftUI List composed of:
a top block (statistics, month picker, year selector, total, Entrata/Uscita picker).
a list of transactions grouped by day, each ...
0
votes
0
answers
62
views
How can I show a movable webcam preview above all windows in macOS without activating the app
I'm building a macOS app using SwiftUI, and I want to create a draggable floating webcam preview window
Right now, I have something like this:
import SwiftUI
import AVFoundation
struct ...
0
votes
0
answers
72
views
iOS 26.1: In TabView, NavigationStack animation breaks when intercepting tab selection to show fullScreenCover [closed]
I'm trying to show a fullScreenCover when the user taps the third tab instead of actually switching to that tab. The issue is that resetting selectedTab = oldValue in onChange breaks the ...
0
votes
0
answers
59
views
Using @Environment inside a ViewModifier causes a deep SwiftUI crash — is my theme setup fundamentally wrong? [closed]
I use a custom AppTheme type and inject it via a custom EnvironmentKey. Views can access the theme using @Environment(\.appTheme) or override it explicitly.
While this work fine in most cases it ...
0
votes
1
answer
76
views
Custom bottom sheet shows brief flicker/fade of underlying view when expanding/collapsing (iOS 15)
I’m building a reusable custom bottom sheet component in SwiftUI because my app supports iOS 15, so I can’t use .sheet with detents yet. Functionally everything works the sheet opens and closes but I’...
1
vote
1
answer
64
views
Custom strokeStyle lineCap with corner radius [duplicate]
I want to be able to give these ends a corner radius of 5 instead of sharp square ends.
lineCap only supports .round, .butt and .square
How can I create a custom corner radius for the lineCap?
Here is ...
Advice
0
votes
2
replies
52
views
CloudKit data initial share sheet in Swift UI and iOS 26
Let's use a basic todo app as an example - sharing a todo list. I have a share button (square with up arrow) that when the user taps I want the initial share sheet to appear. If I have to create and ...
3
votes
2
answers
71
views
Using .presentationBackground(_: Style), but default sheet background is still visible
I wanted to try out the new .presentationBackground modifier from iOS 16.4+ for a clear background in a Sheet. Stack Overflow posts like this suggest it's possible.
But the presentationBackground just ...
1
vote
1
answer
111
views
List view bottom edges not being clipped ios 26
before updating to iOS 26 my list was looking fine but now it has abnormal paddings and because I am using fixed height, I had to increase the height from 40 to 60 to fit the text.
There are currently ...