diff --git a/README.md b/README.md
index fe527d61b..d87fff162 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,5 @@
# ๐ ์ผ๊ธฐ์ฅ
-ํ๋ก์ ํธ ๊ธฐ๊ฐ: 2023.8.28 ~
+ํ๋ก์ ํธ ๊ธฐ๊ฐ: 2023.8.28 ~ 2023.9.15
## ๐ ๋ชฉ์ฐจ
1. [๐ ์๊ฐ](#1.)
@@ -38,7 +38,10 @@
|2023.09.01| `CoreData`: `Create` ๊ตฌํ|
|2023.09.05| `CoreData`: `UpDate`, `Delete` ๊ตฌํ
`Swipe` `share`, `delete` ๊ตฌํ
`AlertController` ์์ฑ |
|2023.09.06| `CoreData`: `fetchDiary` ๊ตฌํ |
-|2023.09.07| ๊ฐ์ธ ํ์ต ๋ฐ README ์์ฑ |
+|2023.09.07| ๊ฐ์ธ ํ์ต ๋ฐ `README` ์์ฑ |
+|2023.09.10| `CoreDataError` ์์ฑ, ์์ธ์ฒ๋ฆฌ ์ถ๊ฐ
`AlertVC`๋ก์ง์์ , `Namespace`์์ฑ |
+|2023.09.13| `WeatherAPI`ํต์ ์งํ
`WeatherIcon Cache` ๊ตฌํ
`CoreLocation` ์์ฑ
`Migration-DiaryV2` ๊ตฌํ |
+
@@ -48,22 +51,33 @@
โโโ Diary
โย ย โโโ Protocol
โย ย โย ย โโโ AlertDisplayble.swift
- โย ย โย ย โโโ ShareDiary.swift
- โย ย โโโ DataManager
- โย ย โย ย โโโ CoreDataManager.swift
+ โย ย โย ย โโโ ShareDisplayable.swift
โย ย โโโ Extension
โย ย โย ย โโโ DateFormatter+.swift
- โย ย โโโ Model
- โย ย โย ย โโโ Diary+CoreDataClass.swift
- โย ย โย ย โโโ Diary+CoreDataProperties.swift
- โย ย โย ย โโโ DecodingManager.swift
- โย ย โย ย โโโ DiaryEntity.swift
โย ย โโโ Error
+ โย ย โย ย โโโ APIError.swift
+ โย ย โย ย โโโ CoreDataError.swift
โย ย โย ย โโโ DecodingError.swift
+ โย ย โโโ Model
+ โย ย โย ย โโโ CoreData
+ โย ย โย ย โย ย โโโ CoreDataManager.swift
+ โย ย โย ย โย ย โโโ Diary+CoreDataClass.swift
+ โย ย โย ย โย ย โโโ Diary+CoreDataProperties.swift
+ โย ย โย ย โโโ DTO
+ โย ย โย ย โย ย โโโ DecodingManager.swift
+ โย ย โย ย โย ย โโโ WeatherResult.swift
+ โย ย โย ย โโโ ImageCache
+ โย ย โย ย โย ย โโโ ImageCachingManager.swift
+ โย ย โย ย โโโ Namespace
+ โย ย โย ย โโโ AlertNamespace.swift
+ โย ย โย ย โโโ ButtonNamespace.swift
+ โย ย โโโ Network
+ โย ย โย ย โโโ NetworkConfiguration.swift
+ โย ย โย ย โโโ NetworkManager.swift
โย ย โโโ Controller
- โย ย โย ย โโโ CreateDiaryViewController.swift
+ โย ย โย ย โโโ DiaryDetailViewController.swift
โย ย โย ย โโโ DiaryListViewController.swift
- โย ย โโโ View
+ โย ย โโโ View
โย ย โ โโโ DiaryListTableViewCell.swift
โย ย โโโ App
โย ย โย ย โโโ AppDelegate.swift
@@ -71,16 +85,17 @@
โย ย โโโ Assets.xcassets
โย ย โโโ Info.plist
โย ย โโโ Diary.xcdatamodeld
- โโโ Diary.xcodeproj
+ โโโ Diary.xcodeproj
+ โโโ README.md
## ๐ป ์คํ ํ๋ฉด
-|์๋ ํ๋ฉด|
+| ์๋ํ๋ฉด |
|:--:|
-|
|
+|
|
@@ -88,6 +103,8 @@
## ๐ช ํต์ฌ ๊ฒฝํ
#### ๐ CoreData๋ฅผ ํ์ฉํ ๋ฐ์ดํฐ ์ ์ฅ
์ผ๊ธฐ ๋ฐ์ดํฐ๋ฅผ ์ํ ์ ์ฅ์๋ก CoreData๋ฅผ ํ์ฉํ์์ต๋๋ค.
+#### ๐ MappingModel ํ์ผ์ ํ์ฉํ CoreData Migration ์งํ
+CoreData์ ๋ฒ์ ์ ๋ณด๋ฅผ ์ถ๊ฐํ๊ณ ์ด๋ฅผ MappingModel๋ก ์ฐ๊ฒฐํ์ฌ DB ๋ณ๊ฒฝ์ฌํญ์ ๋ํ Migration์ ์งํํ์์ต๋๋ค.
#### ๐ Singleton ํจํด์ ํ์ฉํ CoreDataManager ๊ตฌํ
๋ฐ์ดํฐ ์ฒ๋ฆฌ๋ฅผ ์ํ ๋ก์ง ์ ๋ฐ์ Singleton ํจํด์ผ๋ก ๊ตฌํํ์ฌ ์ฑ ์ ์ญ์์ ํ์ฉ ๊ฐ๋ฅํ๋๋ก ํ์์ต๋๋ค.
#### ๐ NotificationCenter๋ฅผ ํ์ฉํ ํค๋ณด๋ ์ธ์
@@ -96,6 +113,8 @@
์ํฉ์ ๋ฐ๋ผ ViewController์์ ๋ค๋ฅธ ๋ฐ์ดํฐ๋ฅผ ํ์ํด์ผ ํ๋ ๊ฒฝ์ฐ์ ๋๋นํด ์์ฑ์๋ฅผ ํ์ฉํ์์ต๋๋ค.
#### ๐ Protocol๊ณผ Extension์ ํ์ฉํ ์ฝ๋ ๋ถ๋ฆฌ
Alert, Swipe ๋ฑ ๋ณ๊ฐ์ ์์
์ผ๋ก ๋ถ๋ฆฌํ ์ ์๋ ๋ด์ฉ๋ค์ Protocol๊ณผ Extension์ ํตํด ๋ถ๋ฆฌํ์์ต๋๋ค.
+#### ๐ URLSessionDataTask๋ฅผ ํ์ฉํ NetworkManager ๊ตฌํ
+ํ๋์ NetworkManager ํ์
์ ๊ตฌํํ์ฌ ๋ ์จ API ๋ฐ์ดํฐ ํต์ ๊ณผ ์์ด์ฝ ์ด๋ฏธ์ง ๊ด๋ จ ํต์ ์ ๋ชจ๋ ํ์ฉํ์์ต๋๋ค.
@@ -212,16 +231,87 @@ fetchํด ์จ ์ผ๊ธฐ๋ค ์ค์ title์ด ๋น์ด์๋ ๊ฑด์ ๊ฑธ๋ฌ๋ผ ์ ์๋
}
}
```
+
+
+### 4๏ธโฃ **์์ด์ฝ ์ด๋ฏธ์ง ํต์ **
+๐ **๋ฌธ์ ์ **
+์ผ๊ธฐ์ฅ ์ฑ์ ๋ชจ๋ ์
์ด ์๋ฒํต์ ์ ํตํด ์์ด์ฝ์ ๊ฐ์ง๊ณ ์ค๋๋ก ๊ตฌํ๋์ด ์์ต๋๋ค. ํ์ง๋ง ๋ ์จ ์์ด์ฝ์ ๋ช ๊ฐ์ ์ ํด์ง ์์ด์ฝ์ ๋ฐ๋ณตํ์ฌ ํ์ฉํฉ๋๋ค. ๋ฐ๋ผ์ ๋์ผํ ์ด๋ฏธ์ง๋ฅผ ๋งค๋ฒ ํต์ ์ ํตํด ๊ฐ์ ธ์ค๋ ๊ฒ์ ๋นํจ์จ์ ์ด๋ผ๊ณ ์๊ฐ๋์์ต๋๋ค.
+
+
+๐ **ํด๊ฒฐ๋ฐฉ๋ฒ**
+ํ ๋ฒ ํ์ฉ๋ ์ด๋ฏธ์ง๋ `NSCache`๋ฅผ ํตํด ์บ์ฑ ์ฒ๋ฆฌํ์ฌ ๋ฐ๋ก ๋ณด์ฌ์ค ์ ์๋๋ก ๊ตฌํํ์์ต๋๋ค.
+
+```swift
+class ImageCachingManager {
+ static let shared = NSCache()
+ ...
+}
+```
+
+```swift
+guard let image = UIImage(data: data) else { return }
+DispatchQueue.main.async {
+ ImageCachingManager.shared.setObject(image, forKey: NSString(string: icon))
+ self?.weatherIconImageView.image = image
+}
+```
+
+
+### 5๏ธโฃ **CoreLocation**
+๐ **๋ฌธ์ ์ (1) - CoreLocation์ ํตํด ์ ๋ณด๋ฅผ ๋ฐ์์ค๋ ์์น**
+
+์ค์ง์ ์ผ๋ก Location ์ ๋ณด๊ฐ ํ์ํ ๊ฒ์ `DiaryDetailViewController`์์ ๋ ์จ API๋ฅผ ํธ์ถํ ๋์
๋๋ค. ๋๋ฌธ์ ์ฒ์์๋ `DiaryDetailViewController`์์ ํ์ฉ ๋์๋ฅผ ๋ฐ๊ณ ์์น ์ ๋ณด๋ฅผ ์
๋ฐ์ดํธํ๋๋ก ๊ตฌํํ๋ ค ํ์์ต๋๋ค. ํ์ง๋ง ์ด๋ ๊ฒ ํ๋ฉด ์ฑ์ ์คํํ ๋ค ์ผ๊ธฐ์ฅ ์์ฑ ํ๋ฉด์ ๋์ด๊ฐ์์ผ ์์น์ ๋ณด ํ์ฉ ๋์ ์ฐฝ์ด ํ์ฑํ๋์ด ํ๋ฆ์ ์ด์ํด์ง๊ณ , ๋ ์์น ์ ๋ณด๊ฐ ์ ๋ ์
๋ฐ์ดํธ๋์ง ์์ API ํธ์ถ์ด ์ด๋ฃจ์ด์ง์ง ์๋ ๋ฑ ๋ค์ํ ๋ฌธ์ ๊ฐ ๋ฐ์ํ์ต๋๋ค.
+
+
+๐ **ํด๊ฒฐ๋ฐฉ๋ฒ (1)**
+์์น ์ ๋ณด ์
๋ฐ์ดํธ ์์ฒด๋ ์ฒซ ํ๋ฉด์ธ `DiaryListViewController`์์ ์งํํ๊ณ , `DiaryDetailViewController`์์๋ API ํต์ ์ ํ์ํ ์๋, ๊ฒฝ๋ ๋ฐ์ดํฐ๋ง ๋๊ฒจ๋ฐ์ ์ ์๋๋ก ๊ตฌํํ์์ต๋๋ค.
+```swift
+let createDiaryView = DiaryDetailViewController(latitude: self.latitude, longitude: self.longitude)
+self.navigationController?.pushViewController(createDiaryView, animated: true)
+```
+
+๋ํ ์์น์ ๋ณด ํ์ฉ์ ๋์ํ์ง ์์ ๊ฒฝ์ฐ์๋ ์ผ๊ธฐ ์์ฒด๋ ์์ฑ ๊ฐ๋ฅํ๋๋ก ๊ตฌํํ๊ธฐ ์ํด(๋ ์จ ์ด๋ชจํฐ์ฝ๋ง ์ ์ธ) ์๋, ๊ฒฝ๋ ๋ฐ์ดํฐ๋ nil๋ก๋ ์ ๋ฌ๋ ์ ์๋๋ก ํ์์ต๋๋ค.
+
+```swift
+init(latitude: Double?, longitude: Double?) {
+ self.diary = CoreDataManager.shared.createDiary()
+ self.isNew = true
+ self.latitude = latitude
+ self.longitude = longitude
+
+ super.init(nibName: nil, bundle: nil)
+ fetchWeather()
+}
+```
+
+
+๐ **๋ฌธ์ ์ (2) - ์๋ฎฌ๋ ์ดํฐ์ ์์น ์ ๋ณด ์ค์ **
+
+์๋ฎฌ๋ ์ดํฐ๋ก `CoreLocation` ๊ธฐ๋ฅ์ ํ
์คํธํ๋ฉด ์๋ฎฌ๋ ์ดํฐ ์์ฒด์ ์ค์ ๋ Location ์ ๋ณด์ ๋ฐ๋ผ ์์น๋ฅผ ํ์ํ๊ฒ ๋ฉ๋๋ค. ๋ฐ๋ผ์ ์ด ์ค์ ์ด None์ผ๋ก ๋์ด์์ ๊ฒฝ์ฐ์๋ ์์น๊ฐ ์ ์์ ์ผ๋ก ๋ถ๋ฌ์์ง์ง ์์ต๋๋ค. ์ด ์ฌ์ค์ ๊ฐ๊ณผํ์ฌ ํ
์คํธ ๊ณผ์ ์์ ๋ง์ ์ํ์ฐฉ์ค๋ฅผ ๊ฑฐ์ณค์ต๋๋ค.
+
+
+๐ **ํด๊ฒฐ๋ฐฉ๋ฒ (2)**
+
+Custom Location์ ํ์ฉํ์ฌ ์ ์์ ์ผ๋ก ํ
์คํธ๋ฅผ ์งํํ ์ ์์์ต๋๋ค.
+
+
## ๐ ์ฐธ๊ณ ๋งํฌ
-- [Apple Developer Documentation: Adaptivity and Layout](https://developer.apple.com/design/human-interface-guidelines/layout)
-- [Apple Developer Documentation: DateFormatter](https://developer.apple.com/documentation/foundation/dateformatter)
-- [Apple Developer Documentation: UITextView](https://developer.apple.com/documentation/uikit/uitextview)
-- [Apple Developer Documentation: Core Data](https://developer.apple.com/documentation/coredata)
-- [Apple Developer Documentation: Making Apps with Core Data](https://developer.apple.com/videos/play/wwdc2019/230/)
-- [Apple Developer Documentation: NSFetchedResultsController](https://developer.apple.com/documentation/coredata/nsfetchedresultscontroller)
-- [Apple Developer Documentation: UITextViewDelegate](https://developer.apple.com/documentation/uikit/uitextviewdelegate)
-- [Apple Developer Documentation: UISwipeActionsConfiguration](https://developer.apple.com/documentation/uikit/uiswipeactionsconfiguration)
+
+- [Apple Docs: Adaptivity and Layout](https://developer.apple.com/design/human-interface-guidelines/layout)
+- [Apple Docs: DateFormatter](https://developer.apple.com/documentation/foundation/dateformatter)
+- [Apple Docs: UITextView](https://developer.apple.com/documentation/uikit/uitextview)
+- [Apple Docs: Core Data](https://developer.apple.com/documentation/coredata)
+- [Apple Docs: Making Apps with Core Data](https://developer.apple.com/videos/play/wwdc2019/230/)
+- [Apple Docs: NSFetchedResultsController](https://developer.apple.com/documentation/coredata/nsfetchedresultscontroller)
+- [Apple Docs: UITextViewDelegate](https://developer.apple.com/documentation/uikit/uitextviewdelegate)
+- [Apple Docs: UISwipeActionsConfiguration](https://developer.apple.com/documentation/uikit/uiswipeactionsconfiguration)
+- [Apple Docs: CoreLocation](https://developer.apple.com/documentation/corelocation)
+- [Apple Docs: Migrating your data model automatically](https://developer.apple.com/documentation/coredata/migrating_your_data_model_automatically)
+- [Apple Docs: NSCache](https://openweathermap.org/current)
+- [Open Weather API](https://openweathermap.org/current)
+
+