-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathControlGroupMenuView.swift
79 lines (64 loc) · 2.29 KB
/
ControlGroupMenuView.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
//
// ContentView.swift
// ControlGroupMenu
//
// Created by Ganesh on 15/06/23.
//
import SwiftUI
struct ControlGroupMenuView: View {
var body: some View {
VStack(spacing:50){
Menu {
ControlGroup{
Button(action: {}, label: {
Image(systemName: "scissors")
})
Button(action: {}, label: {
Image(systemName: "doc.on.doc")
})
Button(action: {}, label: {
Image(systemName: "doc.on.clipboard")
})
Button(action: {}, label: {
Image(systemName: "doc.text.magnifyingglass")
})
}.controlGroupStyle(.compactMenu)
Button(action: {}, label: {
Label("Translate", systemImage: "trash")
})
Button(action: {}, label: {
Label("share", systemImage: "square.and.arrow.up")
})
} label: {
Text("Menu 1")
}
Menu {
ControlGroup{
Button(action: {}, label: {
Label("Cut", systemImage: "scissors")
})
Button(action: {}, label: {
Label("Copy", systemImage: "doc.on.doc")
})
Button(action: {}, label: {
Label("Paste", systemImage: "doc.on.clipboard")
})
}.controlGroupStyle(.menu)
Button(action: {}, label: {
Label("Look Up", systemImage: "doc.text.magnifyingglass")
})
Button(action: {}, label: {
Label("Translate", systemImage: "text.bubble")
})
Button(action: {}, label: {
Label("Share", systemImage: "square.and.arrow.up")
})
} label: {
Text("Menu 2")
}
}
}
}
#Preview {
ControlGroupMenuView()
}