M.Abbas
Feb 29, 2024

You can use Apple's Combine framework. You can use the Passthrought subject event and send that event from bottom sheet and then receive that event from ContentView.

Create Event:

class EventManager {

static let shared = EventManager()

let isPlayIntroVideo = PassthroughSubject<Bool, Never>()

}

Send Event:

EventManager.shared.isPlayIntroVideo.send(false)

Receive Event from ContentView:

struct ContentView: View {

var body: some View {

VStack {

}

.onReceive(EventManager.shared.isPlayIntroVideo, perform: { value in

// Receive event here

})

}

}

M.Abbas
M.Abbas

No responses yet