Skip to content
Discussion options

You must be logged in to vote

If I'm understanding your issue, you would like the HUD to be animated even when you install this view into your hierarchy with viewStore.isShowing == true. This is purely a SwiftUI problem, and this is indeed slightly tricky. I would probably extract TCA from it and create a vanilla Indicator view:

struct Indicator<Content: View>: View {
  init(
    isVisible: Bool,
    @ViewBuilder content: () -> Content
  ) {
    self.isVisible = isVisible
    self.content = content()
  }
  let isVisible: Bool
  let content: Content
  
  @State var didAppear: Bool = false
  
  var body: some View {
    Group {
      // We don't want to show right away if `isVisible`, so
      // we wait for `didAppear`…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants