-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path05_06_2021.swift
56 lines (50 loc) · 1.46 KB
/
05_06_2021.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
//
// 05_06_2021.swift
// SwiftUI Miami Challenges
//
// Created by Ivan Corchado Ruiz on 5/6/21.
//
import SwiftUI
struct ContextualMenu: View {
var body: some View {
// iOS 14 +
Menu("Show Me The Menu") {
Section {
Button(action: {},
label: {
Label("Copy", systemImage: "doc.on.doc")
})
Button(action: {},
label: {
Label("Swift me baby", systemImage: "swift")
})
}
Menu("Delete") {
Button(action: {},
label: {
Label("Delete for real", systemImage: "trash")
})
}
}
// iOS 13 +
// Text("Show me the menu, bitch")
// .contextMenu {
// Button {
// print("Change country setting")
// } label: {
// Label("Choose Country", systemImage: "globe")
// }
//
// Button {
// print("Enable geolocation")
// } label: {
// Label("Detect Location", systemImage: "location.circle")
// }
// }
}
}
struct ContextualMenu_Previews: PreviewProvider {
static var previews: some View {
ContextualMenu()
}
}