How to customize SwiftUI’s Menu Buttons?

iMessage has this Menu if you tap on the More Button.

How to make something similar in SwiftUI? I tried using ControlGroups and Custom ControlGroup style but I just can’t make it work properly. Any help would be appreciated!

I’ve tried this:

struct CustomControlGroupStyle: ControlGroupStyle {
    func makeBody(configuration: Configuration) -> some View {
        HStack { configuration.content } 
        Divider()
    }
}

ControlGroup {
    Button {

    } label: {
        HStack {
            Image("ProfileImage")
            Text("Name")
        }
    }
}.controlGroupStyle(CustomControlGroupStyle())

Which results in:

Demo

I need to achieve something like this:
Menu

Leave a Comment