4
votes
Accepted
Using .presentationBackground(_: Style), but default sheet background is still visible
Liquid Glass gives sheets a translucent appearance when they are presented at partial height. When the sheet expands to the large detent, its background becomes fully opaque.
With ....
3
votes
Accepted
Remote notification tap not handled when app is killed
You can also try adding these two AppDelegate methods.
First one:
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication....
2
votes
How to reduce top padding of NavigationBar to match native Apple apps?
Here’s the working code that reduces the top padding and makes the navigation look like native Apple apps:
// NEW: fixed top padding
NavigationStack(path: $projectRouter.path) {
ProjectContentView(...
2
votes
How to add separators between the elements in a Picker?
I believe the best (and intended) way to implement this is using Section.
Picker("Pick an option", selection: $selection) {
Section {
Text("Option 1").tag(0)
}
...
1
vote
Increase height AND tappable area of TextField?
You could associate the TextField with a FocusState variable, then set focus when the background is tapped:
struct ContentView: View {
@State private var emailAddress = ""
@...
1
vote
Increase height AND tappable area of TextField?
The reason your TextField doesn’t become fully tappable is that SwiftUI only stretches the visual area with padding and frame, the actual tappable area of the underlying UIKit UITextField stays small. ...
Advice
1
vote
0
replies
0
views
SwiftUI onDelete() modifier
I see. Thank you. I guess now that you explained it I sort of knew that. Thank you again.
1
vote
How to present accurate star rating using SwiftUI?
Only one geometryReader is used, and it calculates the colorized start using .tint.
struct StarsStripView: View {
private let rating: Double
private let range: ClosedRange<Double>
...
1
vote
Changing the color of the starting screen
To successfully set the background color when using image as a launch screen:
create a Color Set in Assets.xcassets, name it, eg. splash-background-color
add in Info.plist "Launch Screen" &...
1
vote
How to create an image carousel that auto-sizes based on it's content?
I think I’ve found a possible way to approach the requirement. It’s inspired by this answer (https://stackoverflow.com/a/73672263/13050251
). Although it produces a warning when running, and I know ...
1
vote
Using .presentationBackground(_: Style), but default sheet background is still visible
Using .presentationBackground(.clear) does work for sheets when running with iOS versions before iOS 26. However, with iOS 26, the background is always opaque when the sheet is the default .large ...
Advice
1
vote
0
replies
0
views
CloudKit data initial share sheet in Swift UI and iOS 26
First, your question should be posted a regular question.
The solution is to use NSItemProvider registerCKShare(container:allowedSharingOptions:preparationHandler:) and then pass that to the ...
1
vote
Custom strokeStyle lineCap with corner radius
If you want to keep using Circle().stroke() but just want smoother corners, you can overlay small circles at the endpoints:
ZStack {
Circle()
.trim(from: CGFloat(start + offset), to: ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
swiftui × 41769swift × 23238
ios × 13063
xcode × 3751
macos × 1931
swiftui-list × 1313
core-data × 1302
swiftui-navigationlink × 1119
uikit × 944
combine × 906
firebase × 760
animation × 691
swiftui-navigationview × 602
arrays × 573
list × 544
scrollview × 504
textfield × 486
google-cloud-firestore × 468
swiftdata × 417
swift5 × 402
swiftui-tabview × 400
widgetkit × 398
picker × 395
button × 385
foreach × 384