Skip to content

Commit dbfe0bb

Browse files
이현서이현서
authored andcommitted
bug fix
1 parent a356acb commit dbfe0bb

File tree

4 files changed

+48
-1
lines changed

4 files changed

+48
-1
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "Trash 2.png",
5+
"idiom" : "universal",
6+
"scale" : "1x"
7+
},
8+
{
9+
"idiom" : "universal",
10+
"scale" : "2x"
11+
},
12+
{
13+
"idiom" : "universal",
14+
"scale" : "3x"
15+
}
16+
],
17+
"info" : {
18+
"author" : "xcode",
19+
"version" : 1
20+
}
21+
}
414 Bytes
Loading

NameStack/NameStack/FriendNameCard_edit.swift

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,20 @@ struct FriendNameCard_edit: View {
7272
.frame(width: 175, height: 35)
7373
.position(x: UIScreen.main.bounds.width / 2, y: 20);
7474

75+
Button(action: {
76+
if let cardToDelete = thisCard.first {
77+
modelContext.delete(cardToDelete) // 현재 편집 중인 새 카드를 삭제
78+
}
79+
withAnimation{path.removeLast()}
80+
}) {
81+
Image("delete")
82+
.padding(
83+
EdgeInsets(top: 7.50, leading: 3.75, bottom: 7.50, trailing: 3.75)
84+
)
85+
}
86+
.frame(width: 30, height: 30)
87+
.position(x: UIScreen.main.bounds.width-50, y: 20);
88+
7589
VStack(spacing: 20) {
7690

7791
Spacer()
@@ -189,7 +203,7 @@ struct FriendNameCard_edit: View {
189203
Button(action: {
190204
showSaveAlert=true
191205
saveData()
192-
withAnimation{path.removeLast()}
206+
//withAnimation{path.removeLast()}
193207

194208

195209
// Action for save button

NameStack/NameStack/ScannedNameCard_edit.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,18 @@ struct ScannedNameCard_edit: View {
6262
.frame(width: 175, height: 35)
6363
.position(x: UIScreen.main.bounds.width / 2, y: 20);
6464

65+
Button(action: {
66+
modelContext.delete(thisCard)
67+
withAnimation{path.removeLast()}
68+
}) {
69+
Image("delete")
70+
.padding(
71+
EdgeInsets(top: 7.50, leading: 3.75, bottom: 7.50, trailing: 3.75)
72+
)
73+
}
74+
.frame(width: 30, height: 30)
75+
.position(x: UIScreen.main.bounds.width-50, y: 20);
76+
6577
VStack(spacing: 20) {
6678

6779
Spacer()

0 commit comments

Comments
 (0)