41,799 questions
- Bountied 1
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
Advice
0
votes
1
replies
34
views
Can the appearance of VSplitView's divider be customized?
I'm trying out SwiftUI, and it's for the Mac. When I'm using VSplitView, the appearance is a thin line with a huge blue block as the control. Are there included view modifiers that can change the ...
0
votes
2
answers
52
views
Using SwiftUI MapReader to position Views over map
I'm trying to use SwiftUI to make a ZStack containing a Map (with a MapKit map view), and a Circle view that is placed on top of it. The Circle's pixel position should be to the pixel position on the ...
0
votes
1
answer
70
views
Can a TipKit tip be permanently dismissed / marked as displayed by tapping outside the tip?
I am using the TipKit in my iOS 16+ app to show usage hints to the user. Since TipKit is available from iOS 17+ I use the protocoal based wrapper shown below.
While displaying tips works fine in ...
1
vote
1
answer
75
views
Track the scroll position of List sections? Nothing is working
I'm trying to support iOS 17+.
Is it possible to track the scroll position of a List's sections? No matter what I try, nothing seems to work. Is .scrollPosition() not supported for Lists?
import ...
Best practices
0
votes
3
replies
51
views
If my SwiftUI View's sub-views based off constant Boolean values, can I fix them in advance?
Let's say my View has a bunch of sub-views, controlled by switches.
struct MyView: View {
var body: some View {
if A {
AView()
} else {
BView()
}
}
}
But A is a constant ...
0
votes
1
answer
82
views
Passing nullable struct into view in SwiftUI [duplicate]
Note that I do not agree that my question is a duplicate of the linked question, even though the title would appear to imply it is. The accepted answer to that question is to force unwrap Binding<...
0
votes
0
answers
60
views
is there an alternative to swiftui’s color literal shortcut for xcode 26? [closed]
i just started learning swiftui and im using a really amazing youtube course by swiftful thinking, only that it was made over 4 years ago as of today. im running on xcode version 26 and wondering if ...
0
votes
0
answers
69
views
scrollPosition does not update anything
I don't understand why in the following code the scrollPosition seems to not fill correctly $scrollPosition and why onChange(of: scrollPosition) is never triggered. What do I've missed?
@Model
final ...
3
votes
1
answer
240
views
+100
Smooth horizontal autoscroll while dragging near edges (keep item under finger)
I have a SwiftUI horizontal editor (multiple "canvases" laid out side‐by‐side in a ScrollView). When the user drags a selected object and reaches the left/right edge of the visible area, I want the ...
-1
votes
0
answers
56
views
How is the smooth carousel + focus interaction in the Apple TV+ app implemented on tvOS 26? [closed]
It’s a bit hard to explain in text, so I made a gif to illustrate the layout and interaction.
My question is:
How does Apple handle left navigation when focus is on the leftmost overlay button?
...
1
vote
0
answers
83
views
Why does NSEvent.addGlobalMonitorForEvents still work in a Sandboxed macOS app
I am building a macOS utility using SwiftUI and Swift that records and displays keyboard shortcuts (like Cmd+C, Cmd+V) in the UI. To achieve this, I am using NSEvent.addGlobalMonitorForEvents(matching:...
-3
votes
1
answer
84
views
How to apply a background outside a rounded view’s corner radius? [closed]
I’m learning how to build a Toast notification for an iOS app using SwiftUI.
I can’t figure out how to draw a background outside the rounded view — specifically, I need a colored sidebar behind the ...
0
votes
0
answers
48
views
Why does a Button affect the propagation of a PreferenceKey?
I’m developing a new MacOS project in SwiftUI, and in one scene I’m trying to have a parent view obtain the relative frame of a child view. However, I’ve found that there are many seemingly random ...
-1
votes
0
answers
44
views
Trouble understanding ImageOrientation in Swift [closed]
I am fairly new to swift (SwiftUI) and making a simple face and card detection app using Vision. Basically it’s just a camera preview layer and upon face/card detection, it crops the image and ...
0
votes
1
answer
119
views
How to animate Image to another Image
I am looking to see how I can replace an Image with another Image within SwiftUI, I am looking to see if I can sort of replace the Image dynamically and have it move onto the next one - not sure if ...