//
// ContentView.swift
// MenuDemo
//
// Created by WilliamJiamin on 2024/6/24.
//
import SwiftUI
struct ContentView: View {
var body: some View {
Menu {
// Menu content
ControlGroup {
Button(action: {
// The action to be executed when the button is clicked
print("You have Star This Article")
}) {
Text("Star")
Image(systemName: "star")
}
Button(action: {
print("You Like the Article!")
}) {
Text("Like It !")
Image(systemName: "hand.thumbsup")
}
Button(action: {
print("I Hate It!")
}) {
Text("Hate It!")
Image(systemName: "hand.thumbsdown")
}
}
} label: {
// Menu label
Label("Menu", systemImage: "ellipsis.circle")
}
}
}
#Preview {
ContentView()
}