Post

Replies

Boosts

Views

Activity

Comment on Handling Multi-Sheet Presentation in SwiftUI for a Global Login System
I encountered the compilation error as mentioned earlier, but it looks like I was able to resolve it using the following approach: .sheet(isPresented: Binding<Bool>( get: { isShowingAI && !loginManager.isShowingLogin && !loginManager.isShowingLogout }, set: { newValue in if !newValue { isShowingAI = false } } ), content: { AIChatMessageListPage() }) So far, this approach seems to work well.
Topic: App & System Services SubTopic: General Tags:
Aug ’24
Comment on Handling Multi-Sheet Presentation in SwiftUI for a Global Login System
Here's how you can respond to the feedback in English: Thank you for the suggestion! I tried implementing the code you provided: .sheet(isPresented: $isShowingAI && !$loginManager.isShowingLogin && !$loginManager.isShowingLogout, content: { AIChatMessageListPage() }) However, I encountered a compilation error: Cannot convert value '$isShowingAI' of type 'Binding<Bool>' to expected type 'Bool', use wrapped value instead.
Topic: App & System Services SubTopic: General Tags:
Aug ’24
Comment on Handling Multi-Sheet Presentation in SwiftUI for a Global Login System
I tried using the approach I shared earlier: However, I noticed that there are some edge cases where neither the login sheet nor the AI sheet gets presented. It seems that the logic in the get function might be causing conflicts when trying to determine which sheet should be displayed, especially when multiple conditions are involved.
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Aug ’24
Comment on Handling Multi-Sheet Presentation in SwiftUI for a Global Login System
I encountered the compilation error as mentioned earlier, but it looks like I was able to resolve it using the following approach: .sheet(isPresented: Binding<Bool>( get: { isShowingAI && !loginManager.isShowingLogin && !loginManager.isShowingLogout }, set: { newValue in if !newValue { isShowingAI = false } } ), content: { AIChatMessageListPage() }) So far, this approach seems to work well.
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Aug ’24
Comment on Handling Multi-Sheet Presentation in SwiftUI for a Global Login System
Here's how you can respond to the feedback in English: Thank you for the suggestion! I tried implementing the code you provided: .sheet(isPresented: $isShowingAI && !$loginManager.isShowingLogin && !$loginManager.isShowingLogout, content: { AIChatMessageListPage() }) However, I encountered a compilation error: Cannot convert value '$isShowingAI' of type 'Binding<Bool>' to expected type 'Bool', use wrapped value instead.
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Aug ’24