Relative Content

Tag Archive for iosswiftui

SwiftUI sheet size becomes 0 when changing theme (iOS 16 bug?)

I’m stuck with a weird SwiftUI bug. I have a sheet that’s supposed to size itself based on its content (using PreferenceKey + GeometryReader). Everything works fine until I try to change the user interface style using overrideUserInterfaceStyle.

How to get double tap gesture in ios15

I would like to add Douletap gesture in my image and finding tapped location using SpatialTapGeasture, but it’s allowing only ios 16+ versions.
So how to check below versions also to find tapped location.

How to get double tap gesture in ios15

I would like to add Douletap gesture in my image and finding tapped location using SpatialTapGeasture, but it’s allowing only ios 16+ versions.
So how to check below versions also to find tapped location.

EditMode state is not changed (still .inactive)

@Environment(.editMode) var editMode var body: some View { NavigationStack { List(viewModel.videos, id: .id, selection: $selectedVideos) { record in … } .navigationTitle(“Videos”) .toolbar { ToolbarItem(placement: .navigationBarLeading) { if editMode?.wrappedValue == .active { // is never active Button(action: { // }) { Text(“Delete Selected”) } } else { EditButton() // doesn’t make editMode active? } } } […]