-
Notifications
You must be signed in to change notification settings - Fork 0
/
ComposeCategory.swift
46 lines (38 loc) · 1.12 KB
/
ComposeCategory.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
//
// ComposeCategory.swift
// YFTP
//
// Created by Tjerk Dijkstra on 05/05/2021.
//
import SwiftUI
struct ComposeCategory: View {
@State var text = ""
@State var emoji = ""
@Binding var showModal: Bool
var collections = CollectionManager.standard
var body: some View {
VStack(){
Form(){
TextField("Name", text: $text)
TextField("Emoji", text: $emoji)
}
Button(action: {
collections.addToCoreData(title: text, emoji: emoji)
showModal = false
}){
Text("Save category")
.fontWeight(.bold)
.padding()
.overlay(
Capsule(style: .continuous).stroke(Color.blue, style: StrokeStyle(lineWidth: 3))
)
.foregroundColor(.blue).font(/*@START_MENU_TOKEN@*/.subheadline/*@END_MENU_TOKEN@*/)
}
}
}
}
//struct ComposeCategory_Previews: PreviewProvider {
// static var previews: some View {
// ComposeCategory( showModal: Binding false)
// }
//}