-
Notifications
You must be signed in to change notification settings - Fork 111
Description
What are you trying to achieve?
I'm using a custom menu for attachments, like this:

I'd like to reuse the picker views from inside SC library but use my own menu view.
Here is the code of my menu
@EnvironmentObject private var composerViewModel: MessageComposerViewModel
VStack(alignment: .leading, spacing: 25) {
MenuItem(icon: "camera.circle.fill", text: "Camera") {
composerViewModel.pickerState = .camera
}
MenuItem(icon: "photo.circle.fill", text: "Photos & Videos") {
state.wrappedValue = .expanded(.media)
}
MenuItem(icon: "bolt.circle.fill", text: "Giphy") {
composerViewModel.composerCommand = .init(
id: "/giphy",
typingSuggestion: .init(text: "", locationRange: NSRange(location: 0, length: 0)),
displayInfo: CommandDisplayInfo(
displayName: "Giphy",
icon: UIImage(systemName: "circle")!,
format: "/giphy [text]",
isInstant: true
)
)
}
MenuItem(icon: "questionmark.circle.fill", text: "Poll") {
composerViewModel.pickerState = .polls
}
}
The problem: When I tap "polls" for the first time, it opens ok. When I close polls view, and tap "polls" again - nothing happens. It fixes itself if I open camera, and then the polls works again, but only once.
Could you maybe make CreatePollView public so I can control it myself making sure it works correctly? Or maybe could you change smth inside the lib to make composerViewModel.pickerState = .polls work stably?
If possible, how can you achieve this currently?
What would be the better way?
GetStream Environment
GetStream Chat version: 4.67.0
GetStream Chat frameworks: StreamChat, StreamChatUI
iOS version: 18.0
Swift version: 6.0
Xcode version: 16.0
Device: sim iPhone 16 pro max