Questions tagged [swiftui-sheet]
38 questions
0
votes
0 answers
SwiftUI - How to show Custom Alert in middle of Screen from a half sized sheet
I am adding an overlay[alert] to very first parent View of the application.
I need to show this overlay from a sheet, but this overlay got covered by the sheet.
@main
struct ToastApp: App {
@State var showAlert: Bool = false
var body: some…

Aaban Tariq Murtaza
- 1,155
- 14
- 16
0
votes
0 answers
SWIFTUI - I have to show two sheets But With Different Presentation Detents
I have to show two sheets But With Different Presentation Detents
Explanation:
I have a parent view showing a sheet with 0.7 detents.
Parent.Sheet { parentContent.presentationDetents([.fraction(0.70)]) }
Within the parentContent, I am showing…

Aaban Tariq Murtaza
- 1,155
- 14
- 16
0
votes
1 answer
iOS Sheet Detents (presentation detents) not working after updating from iOS 15 to iOS 16
I recently updated my SwiftUI project from iOS 15.3 to 16.4 (target iPhone only) and wanted to test the new feature of presentationDetents apple developer: presentation detents. It seems that this property is simply ignored. All sheets are shown in…

Kn3cht
- 135
- 9
0
votes
0 answers
Sheet does not appear when triggered while menu is open in SwiftUI (and thereafter)
I seem to be using (context) menus incorrectly in SwiftUI (or there is a serious bug):
When a menu is open and the user taps another button (⛭) in the background that is supposed to open a sheet, the menu closes automatically, but no sheet is…

Mischa
- 15,816
- 8
- 59
- 117
0
votes
0 answers
BottomSheet Animation Delay
I am working on a bottom sheet for my code using the built in functionality of .sheet. Is there a way for you to disable the initial animation where it comes from the bottom and just have appear on screen when you open up the view.
The video I have…
0
votes
1 answer
How can I get a floating wheel date picker with SwiftUI?
I am trying to replicate this form I've found on the Health app:
It is a regular sheet. Inside the sheet, there is a Form. Then I use an HStack with Text with the label of the field and another Text with the value, separated by a Spacer. I watch…

Apollo
- 1,913
- 2
- 19
- 26
0
votes
2 answers
Why can't I close a sheet view when in landscape?
When I create a .sheet view and turn the iPhone to landscape, I can't close it.
I tried swiping down from the top but the sheet is just stuck there.
Example code:
import SwiftUI
struct ContentView: View {
@State var sheet = false
var body:…
0
votes
1 answer
How to apply .presentationBackground modifier to a second view in a sheet with NavigationLink?
Been searching around online for a while and can't seem to find an answer to help me with this problem, since the .presentationBackground modifier is so new.
Problem:
When applying the .presentationBackground modifier to a presented sheet, the…

Hana Kim
- 1
0
votes
1 answer
SwiftUI: How to scroll a list inside a sheet without dragging the sheet to the top
I have prepared a simple example. If you tap on the button, a sheet will be presented containing the CustomSheetView. Do not behalf on the design itself it is more about the scrolling behaviour. If I want to scroll the list at first the sheet will…

Dgotin
- 38
- 8
0
votes
0 answers
How to make a sheet in swiftUI be the height of its content plus the keyboards height?
I am trying to build a sheet that has a textfield which (when focused) opens the keyboard and also has some further content as well. I want the presentationDetents from the sheet to be the height of the content inside the sheet and when the keyboard…

Konrad
- 1
- 1
0
votes
0 answers
SwiftUI: Sheet dismissing returns to previous View, not current View
When Sheet is dismissed, screen returns to wrong View.
I'm currently facing some weird behavior that i can't seem to solve by myself. I have hierarchical structure where user can select one specific workout and see list of exercises. Then, he can…
0
votes
1 answer
My SwiftUI app does not dynamically populate the content of a pop-up View when the first button is pressed
I have a grid of small images/icons as buttons and a pop-up modal View. The modal view is meant to display a larger version of the image that was the button, and some information about it. However, in practice, the first button pressed just brings…

McHobbes
- 331
- 3
- 11
0
votes
0 answers
How to make ScrollView fill only size of child?
I have the following situation: I need to display a sheet with the items user can pick. Since the amount of this items can be big, I added the ScrollView to display the items. Here's the way I implemented the sheet:
struct PickerModalView: View {
…

Sergei Mikhailovskii
- 2,100
- 2
- 21
- 43
0
votes
1 answer
SwiftUI: Using a Published attribute to displaying a sheet
Good evening!
I’m working on a simple project, where I have a view model, which has published boolean value. I would like to show a sheet when this value is set. However, the sheet function uses the Binding type, meanwhile I have the Published…

Kirill Rud
- 217
- 3
- 9
0
votes
1 answer
SwiftUI - open sheet from various views
So I have a sheet like this
.sheet(item: $logMyPractice, content: { item in
AssesmentRecorderView(
assessment: DrillModel(
questions: [
.init(prompt: "Question 1", resultValue: .integer),
…

breq
- 24,412
- 26
- 65
- 106