11.2 C
Canberra
Monday, April 28, 2025

ios – Exhibiting SwiftUI View in Medium Sheet


I’m going through a bizarre concern. I’ve the next code which shows a medium dimension sheet (half display screen). The case for inputLocation and chooseARide works nice and the views/screens are displayed in medium sheet.

For some purpose .locateDriver at all times shows in a full display screen. I’m not certain what’s the purpose.


.sheet(merchandise: $activeSheet, content material: { sheet in
        Group {
            change sheet {
                case .inputLocation:
                    VStack {
                        locationInputView
                        PlaceListView(locations: locations) { place in
                            change activeField {
                                case .pickup:
                                    print(place.handle)
                                    journey.pickup = place.handle
                                case .vacation spot:
                                    print(place.handle)
                                    journey.vacation spot = place.handle
                                    activeSheet = .chooseARide
                                default:
                                    break
                            }
                        }
                    }
                   
                case .chooseARide:
                    ChooseARideScreen(journey: journey) {
                        activeSheet = .locateDriver
                    }
                
                case .locateDriver:
                    LocateDriverScreen()
            }
        }
        .presentationDetents([.medium, .large])
        .presentationBackgroundInteraction(
            .enabled(upThrough: .medium)
        )
        .interactiveDismissDisabled()
        
    })

ChooseARideScreen has a button which fires a onRideSelected closure.


      Button(motion: {
                        
                        onRideSelected()
    }

This closure will ultimately be fired once I carry out some async operation however for now I’ve eliminated the async activity.

Any concepts why LocateDriverScreen is at all times displayed as a full display screen and never in a medium sheet.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

[td_block_social_counter facebook="tagdiv" twitter="tagdivofficial" youtube="tagdiv" style="style8 td-social-boxed td-social-font-icons" tdc_css="eyJhbGwiOnsibWFyZ2luLWJvdHRvbSI6IjM4IiwiZGlzcGxheSI6IiJ9LCJwb3J0cmFpdCI6eyJtYXJnaW4tYm90dG9tIjoiMzAiLCJkaXNwbGF5IjoiIn0sInBvcnRyYWl0X21heF93aWR0aCI6MTAxOCwicG9ydHJhaXRfbWluX3dpZHRoIjo3Njh9" custom_title="Stay Connected" block_template_id="td_block_template_8" f_header_font_family="712" f_header_font_transform="uppercase" f_header_font_weight="500" f_header_font_size="17" border_color="#dd3333"]
- Advertisement -spot_img

Latest Articles