Skip to content

Commit 9372387

Browse files
committed
SwiftData 팅기는 이슈 수정
1 parent 4270319 commit 9372387

File tree

10 files changed

+55
-77
lines changed

10 files changed

+55
-77
lines changed

App/Moda/Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
<key>CFBundlePackageType</key>
1212
<string>APPL</string>
1313
<key>CFBundleShortVersionString</key>
14-
<string>1.8.1</string>
14+
<string>1.8.2</string>
1515
<key>CFBundleVersion</key>
16-
<string>1.8.1.0</string>
16+
<string>1.8.2.1</string>
1717
<key>GoogleServiceFileName</key>
1818
<string>$(ENV_GOOGLE_INFO_PLIST)</string>
1919
<key>ITSAppUsesNonExemptEncryption</key>

App/Moda/Sources/Feature/Home/DailyMemo/HomeDailyMemoCore.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ struct HomeDailyMemoCore: Reducer {
102102
case let .deleteMemo(memo):
103103
state.memos = state.memos.filter { $0.id != memo.id }
104104
return .merge(
105-
.run { [dailyId = state.dailyId, memo] send in
105+
.run { [dailyId = state.dailyId] send in
106106
await dataManager.deleteDailyMemo(dailyId: dailyId, memo: memo)
107107
await dataManager.updateDailyMemoCategoryCount(categoryId: memo.category.id, isAdded: false)
108108
await toast.show(.init(icon: .icDelete, message: "삭제 완료!"))

App/ModaWidget/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<key>CFBundleName</key>
1414
<string>ModaWidget</string>
1515
<key>CFBundleVersion</key>
16-
<string>1.8.1.0</string>
16+
<string>1.8.2.1</string>
1717
<key>NSExtension</key>
1818
<dict>
1919
<key>NSExtensionPointIdentifier</key>

Core/ModaCore/Info.plist

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,17 @@
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
44
<dict>
5+
<key>CFBundleName</key>
6+
<string>$(PRODUCT_NAME)</string>
57
<key>CFBundleDevelopmentRegion</key>
68
<string>$(DEVELOPMENT_LANGUAGE)</string>
7-
<key>CFBundleDisplayName</key>
8-
<string>ModaData</string>
99
<key>CFBundleExecutable</key>
1010
<string>$(EXECUTABLE_NAME)</string>
1111
<key>CFBundleIdentifier</key>
1212
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
13-
<key>CFBundleName</key>
14-
<string>ModaData</string>
1513
<key>CFBundleShortVersionString</key>
16-
<string>1.0.3</string>
14+
<string>1.0</string>
1715
<key>CFBundleVersion</key>
18-
<string>1.0.3.0</string>
19-
<key>NSExtension</key>
20-
<dict>
21-
<key>NSExtensionPointIdentifier</key>
22-
<string>com.apple.widgetkit-extension</string>
23-
</dict>
16+
<string>1</string>
2417
</dict>
2518
</plist>

Core/ModaData/Info.plist

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,17 @@
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
44
<dict>
5+
<key>CFBundleName</key>
6+
<string>$(PRODUCT_NAME)</string>
57
<key>CFBundleDevelopmentRegion</key>
68
<string>$(DEVELOPMENT_LANGUAGE)</string>
7-
<key>CFBundleDisplayName</key>
8-
<string>ModaData</string>
99
<key>CFBundleExecutable</key>
1010
<string>$(EXECUTABLE_NAME)</string>
1111
<key>CFBundleIdentifier</key>
12-
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
13-
<key>CFBundleName</key>
14-
<string>ModaData</string>
12+
<string>com.pinto.moda.ModaData</string>
1513
<key>CFBundleShortVersionString</key>
16-
<string>1.0.3</string>
14+
<string>1.0</string>
1715
<key>CFBundleVersion</key>
18-
<string>1.0.3.0</string>
19-
<key>NSExtension</key>
20-
<dict>
21-
<key>NSExtensionPointIdentifier</key>
22-
<string>com.apple.widgetkit-extension</string>
23-
</dict>
16+
<string>1</string>
2417
</dict>
2518
</plist>

Core/ModaData/Sources/Storage/DataManager+Bookmark.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ public extension DataManager {
2626
if let bookmark = bookmarks.first(where: { bookmarkEntity.id == $0.id }) {
2727
bookmarkEntity.update(with: bookmark)
2828
} else {
29-
modelContext.delete(bookmarkEntity)
3029
yearlyBookmarkEntity.bookmarks = yearlyBookmarkEntity.bookmarks.filter { $0.id != bookmarkEntity.id }
30+
modelContext.delete(bookmarkEntity)
3131
}
3232
}
3333

@@ -44,7 +44,7 @@ public extension DataManager {
4444

4545
try modelContext.save()
4646
} catch {
47-
fatalError()
47+
fatalError("Failed to update bookmarks: \(error)")
4848
}
4949
}
5050

@@ -59,7 +59,7 @@ public extension DataManager {
5959
bookmarkEntity.update(with: bookmark)
6060
try modelContext.save()
6161
} catch {
62-
fatalError()
62+
fatalError("Failed to update bookmark: \(error)")
6363
}
6464
}
6565

@@ -70,15 +70,15 @@ public extension DataManager {
7070
)
7171

7272
guard let bookmarkEntity = try modelContext.fetch(fetchDesc).first else {
73-
fatalError()
73+
return
7474
}
7575

7676
bookmarkEntity.todos.forEach { todoEntity in
7777
if let todo = todos.first(where: { todoEntity.id == $0.id }) {
7878
todoEntity.update(with: todo)
7979
} else {
80-
modelContext.delete(todoEntity)
8180
bookmarkEntity.todos = bookmarkEntity.todos.filter { $0.id != todoEntity.id }
81+
modelContext.delete(todoEntity)
8282
}
8383
}
8484

Core/ModaData/Sources/Storage/DataManager+Memo.swift

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ public extension DataManager {
3333
if let memo = memos.first(where: { $0.id == memoEntity.id }) {
3434
memoEntity.update(with: memo)
3535
} else {
36-
modelContext.delete(memoEntity)
3736
memosEntity.memos = memosEntity.memos.filter { $0.id != memoEntity.id }
37+
modelContext.delete(memoEntity)
3838
}
3939
}
4040

@@ -51,7 +51,7 @@ public extension DataManager {
5151

5252
try modelContext.save()
5353
} catch {
54-
fatalError()
54+
fatalError("Failed to update memos: \(error)")
5555
}
5656
}
5757

@@ -63,13 +63,13 @@ public extension DataManager {
6363

6464
guard let memosEntity = try modelContext.fetch(fetchDesc).first,
6565
let memoEntity = memosEntity.memos.first (where: { $0.id == memo.id }) else {
66-
fatalError()
66+
return
6767
}
6868

6969
memoEntity.update(with: memo)
7070
try modelContext.save()
7171
} catch {
72-
fatalError()
72+
fatalError("Failed to update memo: \(error)")
7373
}
7474
}
7575

@@ -95,7 +95,7 @@ public extension DataManager {
9595

9696
try modelContext.save()
9797
} catch {
98-
fatalError()
98+
fatalError("Failed to update categories: \(error)")
9999
}
100100
}
101101

@@ -106,13 +106,13 @@ public extension DataManager {
106106
)
107107

108108
guard let categoryEntity = try modelContext.fetch(fetchDesc).first else {
109-
fatalError()
109+
return
110110
}
111111

112112
categoryEntity.usesCount = max(categoryEntity.usesCount + (isAdded ? 1 : -1), 0)
113113
try modelContext.save()
114114
} catch {
115-
fatalError()
115+
fatalError("Failed to update category count: \(error)")
116116
}
117117
}
118118

@@ -126,16 +126,17 @@ public extension DataManager {
126126

127127
guard let memosEntity = try modelContext.fetch(fetchDesc).first,
128128
let memoEntity = memosEntity.memos.first (where: { $0.id == memo.id }) else {
129-
fatalError()
129+
return
130130
}
131131

132+
memosEntity.memos = memosEntity.memos.filter { $0.id != memoEntity.id }
132133
modelContext.delete(memoEntity)
133134
if memosEntity.memos.isEmpty {
134135
modelContext.delete(memosEntity)
135136
}
136137
try modelContext.save()
137138
} catch {
138-
fatalError()
139+
fatalError("Failed to delete memo: \(error)")
139140
}
140141
}
141142
}

Core/ModaData/Sources/Storage/DataManager+Routine.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public extension DataManager {
3030
routineRecordEntity.routineIds.formUnion(routineIds)
3131
try modelContext.save()
3232
} catch {
33-
fatalError()
33+
fatalError("Failed to add routine records: \(error)")
3434
}
3535
}
3636

@@ -60,7 +60,7 @@ public extension DataManager {
6060

6161
try modelContext.save()
6262
} catch {
63-
fatalError()
63+
fatalError("Failed to update routines: \(error)")
6464
}
6565
}
6666

@@ -85,7 +85,7 @@ public extension DataManager {
8585

8686
try modelContext.save()
8787
} catch {
88-
fatalError()
88+
fatalError("Failed to update routine record: \(error)")
8989
}
9090
}
9191
}

0 commit comments

Comments
 (0)