actionSheet failing to appear

I created a view (headerView) that contains an 'info' button, this view sits at the top of the screen and various views are shown beneath it. When pressed an actionSheet should appear, everything was working fine but suddenly the actionSheet refuses to appear, when pressed, the button is changing the state variable to true as expected and even the phone vibrate triggers, the only thing not working is the actionSheet appearing. Swapping actionSheets for an alert gives the same issue. Here's the code to generate the view and the actionSheet:

Code Block
    struct headerView: View {
        @State var showInfo : Bool = true
        var body: some View {
            HStack(alignment: .bottom){
                Image(systemName: "info.circle")
                    .padding(.trailing)
                    .font(.title)
                    .foregroundColor(.blue)
                    .foregroundColor(.blue)
                    .frame(width: 35.0, height: 35.0)
                    .hidden()                
                Spacer()
                Image("Icon")
                    .resizable()
                    .frame(width: 45, height: 45)
                    .cornerRadius(5.0)
                Image("TextHeader_light")
                    .resizable()
                    .frame(width: 107.0, height: 39.0)
                Spacer()
// info button
                Button(action: {
                    showInfo = true
                AudioServicesPlaySystemSound(kSystemSoundID_Vibrate)
                    print (showInfo)
                }) {
                    Image(systemName: "info.circle")
                        .resizable()
                        .padding([.bottom, .trailing])
                        .font(.title)
                        .foregroundColor(.blue)
                        .frame(width: 35.0, height: 35.0)
                }
            }
            .actionSheet(isPresented: $showInfo)  {
                ActionSheet(title: Text("Title Text"),
                            message: Text("My text goes here"),buttons: [.cancel {showInfo = false; print(showInfo)}])
            }
        }
    }

Accepted Answer
You have an extra closing curly brace line 38.

Hence, .actionsheet is applied to HStack and not Button as it should.

Move ths curly brace line 46.

If OK, don't forget to mark correct answer to close the thread.
Good continuation.
Aargh! Thanks. I swear curly braces will be the end of me one day!
Thanks for feedback.

That's why it is so important to have correct indentation (select all code and type ctrl-I).

You will immediately notice if you have a curly brace unbalance or missing parenthesis…
In your case, you could see that .actionSheet(isPresented: $showInfo) was aligned with HStack.
actionSheet failing to appear
 
 
Q