TipKit: Present popover tip after sheet gets dismissed

I have created a tip with a parameter (Bool) I have tried to set it to true in a sheet which is presented modally over the view which should present the popover tip. After the sheet gets dismissed the popover tip is never presented. If I restart the app, the popover tip appears. Is there any way to trigger the presentation of a popover tip manually?

I have created a little demo app to demonstrate my problem:

Setup TipKit on app start:

import SwiftUI
import TipKit

@main
struct TipKitDemoApp: App {
    var body: some Scene {
        WindowGroup {
            ContentView()
                .task {
                    try? Tips.configure()
                }
        }
    }
}

Simple tip:

import Foundation
import TipKit

struct DemoTip: Tip {
    @Parameter
    static var enabled: Bool = false

    var title: Text {
        Text("Demo Tip")
    }

    var rules: [Rule] {
        [
            #Rule(Self.$enabled) { $0 == true }
        ]
    }
}

Content view which includes the popover tip and displays the sheet where the tip can be enabled:

import SwiftUI

struct ContentView: View {
    @State private var presentDetail = false

    let demoTip = DemoTip()

    var body: some View {
        VStack {
            Image(systemName: "globe")
                .imageScale(.large)
                .foregroundStyle(.tint)
            Text("Hello, world!")
                .popoverTip(demoTip)
            Button("Present Details") {
                presentDetail.toggle()
            }
        }
        .padding()
        .sheet(isPresented: $presentDetail) {
            DetailView()
        }
    }
}

In the detail view the tip gets enabled, but if I dismiss this view, the tip only appears after I restart the app:

import SwiftUI

struct DetailView: View {
    @Environment(\.dismiss) private var dismiss

    var body: some View {
        Button("Enable demo tip") {
            DemoTip.enabled = true
        }

        Button("Dismiss") {
            dismiss()
        }
    }
}

I'm also running into this issue too. Does invalidating the Tip parameter recalculate whether the tip can display immediately?

I suppose this is a timing issue - the moment the rule becomes valid there's already/still presented a modal view (the sheet), which prevents the tip from appearing. After that, there's no trigger (state change re: the rules) to bring up the tip. This is re-evaluated during the next view update or the app is restarted (rule status is persisted as far as I know).

TipKit: Present popover tip after sheet gets dismissed
 
 
Q