-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAddNote.swift
67 lines (58 loc) · 1.57 KB
/
AddNote.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
//
// AddNote.swift
// Notes App
//
// Created by Rajveer Sodhi on 2024-07-10.
//
import SwiftUI
struct AddNote: View {
@State var title: String = "New Note"
@State var note: String = "Note"
var body: some View {
ZStack {
VStack(alignment: .center) {
TextField("Name", text: $title)
.padding()
.background(
Rectangle()
.cornerRadius(15)
.foregroundStyle(.white)
)
.padding()
TextEditor(text: $note)
.padding()
.background(
Rectangle()
.cornerRadius(15)
.foregroundStyle(.white)
)
.padding()
}
}
.background(
Rectangle()
.foregroundColor(Color(white: 0.95))
.ignoresSafeArea()
)
.toolbar {
ToolbarItem() {
Button {
} label: {
Text("Delete")
.foregroundStyle(.red)
}
}
ToolbarItem() {
Button {
} label: {
Text("Save")
}
}
}
.navigationTitle("Add Note")
.toolbarTitleDisplayMode(.inline)
}
}
#Preview {
AddNote()
}