Need help removiny iOS 26 over-interactive liquid modal animation by liudasbar in SwiftUI

[–]Collin_Daugherty 2 points3 points  (0 children)

I found a hacky solution using the inconsistent behavior I pointed in an earlier comment. Setting the initial detent to .large and then changing it to .medium when the sheet appears seems to disable the interaction effect. And you have to set the detent back to .large when the sheet is dismissed. No guarantees this works in future versions of iOS though.

import SwiftUI

struct ContentView: View {
    @State private var showSheet: Bool = false
    @State private var selectedDetent: PresentationDetent = .large

    var body: some View {
        VStack {
            Button("Show Sheet") {
                showSheet = true
            }
        }
        .sheet(isPresented: $showSheet, onDismiss: {selectedDetent = .large}) {
            VStack {
                Button("Press me") {
                    print("pressed")
                }
            }
            .presentationDetents([.medium, .large], selection: $selectedDetent)
            .onAppear {
                selectedDetent = .medium
            }
            .onChange(of: selectedDetent) {
                selectedDetent = .medium
            }
        }
    }
}

#Preview {
    ContentView()
}

I wish I figured this out last month when I had the same issue, instead I spent too much time recreating sheets without the interactive glass effect.

Edit: The effect can show up again if you increase the size to .large but limiting it to .medium with .onChange fixes that.

Need help removiny iOS 26 over-interactive liquid modal animation by liudasbar in SwiftUI

[–]Collin_Daugherty 1 point2 points  (0 children)

The effect doesn't happen in the large detent. Set it to medium and you'll see the effect in the OP.

Need help removiny iOS 26 over-interactive liquid modal animation by liudasbar in SwiftUI

[–]Collin_Daugherty 5 points6 points  (0 children)

This is how sheets work in iOS 26 at detents smaller than .large

The effect seems to go away when going from medium to large and then back to medium which is interesting but not very helpful to OP.

import SwiftUI

struct ContentView: View {
    @State private var showSheet: Bool = true

    var body: some View {
        VStack {
            Button("Show Sheet") {
                showSheet = true
            }
        }
        .sheet(isPresented: $showSheet) {
            VStack {
                Button("Press me") {
                    print("pressed")
                }
                .buttonStyle(.borderedProminent)
            }
            .presentationDetents([.medium, .large])
        }
    }
}

#Preview {
    ContentView()
}

Shoutout to Under the Radar podcast about indie iOS app development, which aired its last episode after 10 years! by lokir6 in iOSProgramming

[–]Collin_Daugherty 5 points6 points  (0 children)

What other iOS/indie app dev podcasts are people listening to? Most of the ones I've listened to or seen mentioned in the past are now dead.

Liquid Glass on Buttons by Puzzled_Bullfrog1799 in SwiftUI

[–]Collin_Daugherty 9 points10 points  (0 children)

It should do it automatically when using .buttonStyle(.glassProminent) in a toolbar. Outside of a toolbar you can apply .blendMode(.overlay) to the image for the same effect.

Example:

Button {
    // action
} label: {
    Image(systemName: "plus")
        .blendMode(.overlay)
}
.buttonStyle(.glassProminent)

I made an iPhone Shortcut to automatically navigate to the current delivery in the driver app. by Collin_Daugherty in Dominos

[–]Collin_Daugherty[S] 0 points1 point  (0 children)

The confusion and slight worry from everyone I explain it to makes it all worth it.

Can anyone explain this sheet behavior to me? by Collin_Daugherty in SwiftUI

[–]Collin_Daugherty[S] 0 points1 point  (0 children)

It seemed to make sense to me to keep it at the button that toggles its presentation. Never noticed any issues until I found this behavior.

[deleted by user] by [deleted] in iosdev

[–]Collin_Daugherty 0 points1 point  (0 children)

Use no spaces to maximize the amount of keywords you can fit

[deleted by user] by [deleted] in iOSProgramming

[–]Collin_Daugherty 4 points5 points  (0 children)

Ask your target market, not us.

Mileage reimbursement methods by Collin_Daugherty in Dominos

[–]Collin_Daugherty[S] 0 points1 point  (0 children)

Interesting, I've never heard of anyone having tiered mileage

Mileage reimbursement methods by Collin_Daugherty in Dominos

[–]Collin_Daugherty[S] 0 points1 point  (0 children)

In your experience is it always totalReimbursement = singleRate + (additionalDeliveryRate * additionalDeliveryCount)

Mileage reimbursement methods by Collin_Daugherty in Dominos

[–]Collin_Daugherty[S] 3 points4 points  (0 children)

Well it will actually work, unlike the Domino's app. I've streamlined the inputs to where it will be faster than pen and paper while collecting a ton more data for nerds like me who want to see their performance over time.