# โ๏ธ swift-p4-startbuckst ๐น
### iOS ํ๋ก์ ํธ#4 - ์คํ๋ฒ
์ค
## ๊ฐ๋ฐ์
|Name|Camper Number|
|:-:|:-:|
|๐จ๐ปโ๐ป ๊นํํ|S014|
|๐ฉ๐ปโ๐ป ์ด๋์ |S036|
<br>
## ๊ฐ๋ฐ์ผ์
<details>
<summary> 1๏ธโฃ 2021.10.11</summary>
- ์ด๊ธฐ ์ด๋ฒคํธ ํ๋ฉด
- ```UI``` : ๊ธฐ๋ณธ ์ด๋ฏธ์ง, label, button ์ถ๊ฐ
- ```Model + ViewModel``` : ์ด๊ธฐ ์ด๋ฒคํธ ํ๋ฉด ๋ฐ์ดํฐ ๋ถ๋ฌ์ค๊ธฐ
- ```๋คํธ์ํฌ``` <span style="color:orange">[๐ฉ๐ปโ๐ปPair Programming๐ง๐ปโ๐ป]</span>
- ๊ณตํต ๋คํธ์ํฌ ํด๋์ค ์์ฑ
- ์ด๋ฏธ์ง ๋ค์ด๋ก๋ (์บ์ ์ฒ๋ฆฌ)
- ```๊ธฐํ``` <span style="color:orange">[๐ฉ๐ปโ๐ป๐ง๐ปโ๐ป]</span> : ๋ค์๋ณด์ง ์๊ธฐ(Date ์ฌ์ฉ), ๋ซ๊ธฐ ๋ฒํผ ๊ธฐ๋ฅ ๊ตฌํ
- ํ ํ๋ฉด
- ```UI``` : Tabbar, Collection view(๊ธฐ๋ณธ์ ์ธ ํ ๊ตฌ์ฑ)
- ```View(custom cell)``` <span style="color:orange">[๐ฉ๐ปโ๐ป๐ง๐ปโ๐ป]</span> : ์ถ์ฒ/์ธ๊ธฐ ๋ฉ๋ด Cell(RoundImageCell), ๋ฉ์ธ ์ด๋ฒคํธ Cell(MainEventImageCell), ์ด๋ฒคํธ Cell(EventImageCell)
</details>
<details>
<summary> 2๏ธโฃ 2021.10.12</summary>
- ํํ๋ฉด
- ```UI``` : Collection View(4 section ๊ตฌํ)
- ```View Model+Model```
- Home ๊ณผ ๊ด๋ จ๋ ๋คํธ์ํน ๋ก์ง
- Home ๋ฐ์ดํฐ Decode ํ๋ Model ์์ฑ
- ```View```
- Delegate, DataSource ์ฒ๋ฆฌ
- Compositional layout ๋ฐ์ํ (๋ฉ์ธ ์ด๋ฒคํธ)
- ```๊ธฐํ``` : ~~Storyboard reference ์ฌ์ฉ~~ <span style="color:orange">[๐ฉ๐ปโ๐ป๐ง๐ปโ๐ป]</span>
</details>
<details>
<summary> 3๏ธโฃ 2021.10.13</summary>
- What's new ํ๋ฉด
- ```View Model+Model``` : What's new ํ๋ฉด์ ํ์ํ model, ๋น์ฆ๋์ค ๋ก์ง ๊ตฌํ <span style="color:orange">[๐ฉ๐ปโ๐ป๐ง๐ปโ๐ป]</span>
- ```View``` : Collcetion View, DataSource, Dalegate ์ฒ๋ฆฌ
- Order ํ๋ฉด
- ```View``` :
- Collection View (์๋จ Header ๊ณ ์ )
- ```View Model+Model``` : Order ํ๋ฉด์ ํ์ํ model, ๋น์ฆ๋์ค ๋ก์ง ๊ตฌํ
- View ์ ๋ชจ๋ธ, ๋ก์ง ํฉ์น๊ธฐ <span style="color:orange">[๐ฉ๐ปโ๐ป๐ง๐ปโ๐ป]</span>
</details>
<details>
<summary> 4๏ธโฃ 2021.10.14</summary>
- ์ ํ์์ธํ๋ฉด
- ```View```
- ํ๋ฉด ๊ตฌ์ฑ + Scroll View๋ก ๊ธฐ๋ณธ์ ์ธ UI ์์ฑ
- Scroll View์ ๋ค์ด๊ฐ๋ view ๊ตฌ์ฑ์์๋ค์ custom view๋ก ๋ง๋ค๊ธฐ
- navigation bar ํจ๊ณผ & ์ด๋ฏธ์ง ๋ฐ์ํ
- ```ViewModel+Model``` : ๊ด๋ จ๋ model ์ฒ๋ฆฌ ๋ฐ ๋น์ฆ๋์ค ๋ก์ง ์ฒ๋ฆฌํ๋ view model ์์ฑ
- Code refactoring
- View Model unitTest ๋ง๋ค๊ธฐ
</details>
<details>
<summary> 5๏ธโฃ 2021.10.18</summary>
- Code Data
- ์๊ตฌ ์ ์ฅ์ ๊ด๋ฆฌ ๊ฐ์ฒด
- Core Data Table ์์ฑ
- CURD ์์
์ ์ํํ๋ method ๊ตฌํ
- repository layer๋ฅผ ํตํด ์๊ตฌ ์ ์ฅ์ ๊ด๋ฆฌ๋ฅผ ๋ฐ๋ก ์ฒ๋ฆฌํจ
- ์ ํ ์์ธํ๋ฉด
- ํํธ ๋ฒํผ์ ๋ํ ์๊ตฌ์ ์ฅ์ ๊ฐ์ฒด ์ฐ๋, ์ญ์ ๊ตฌํ
- ๋๋ง์ ๋ฉ๋ด
- Collection View Cell(FavorCell)
- View Model + Use Case + Model
- ๊ด๋ จ๋ ๋น์ฆ๋์ค ๋ก์ง ๊ตฌํ
- ์๊ตฌ ์ ์ฅ์ ๊ตฌํ
- ๊ตฌ์กฐ์ ์ธ ๊ฐ์
- View - View Model - Use case - Layer(Network or persistent)์ ์์์ ์คํ๋ ๊ณผ์ ์ผ๋ก ํด๋ฆฐ ์ํคํ
์ฒ๋ฅผ ๋์
</details>
<details>
<summary> 6๏ธโฃ 2021.10.19</summary>
- Code Data
- ์๊ตฌ ์ ์ฅ์ ๊ด๋ฆฌ ๊ฐ์ฒด
- ๊ธฐ์กด์ ๊ด๋ฆฌ ๊ฐ์ฒด์์ entity์ ๋ชจ๋ ์ ์ฅ๋ ๊ฐ๋ค์ ์ญ์ ํ๋ `deleteAll` ๋งค์๋ ์ถ๊ฐ
- View
- Pay ํ๋ฉด ๊ตฌํ ๋ฐ Layout ๊ตฌ์ฑ
- Timer ์ฌ์ฉ ๋ฐ ๋ฐ์ฝ๋ ํ๋ฉด์ ๋ณด์ฌ์ฃผ๋ ๊ฒ ๊ตฌํ
- view model + usecase
- pay ํ๋ฉด์ ํ์ํ view model ๊ตฌํ
- ์๊ตฌ์ ์ฅ์์ ์ ๊ทผํ์ฌ ๋ฐ์ดํฐ๋ฅผ ๊ฐ์ ธ์ฌ usecase ๊ตฌํ
- Create ML
- ๊ฐ ๊ถ ์งํ(1000, 5000, 10000, 50000)์ ๋ํด ๊ฐ๋จํ ์ด๋ฏธ์ง ๋ถ๋ฅ๊ฐ ์ ๋๋์ง ์คํ
- 5000๊ณผ 50000๊ฐ ๊ตฌ๋ณ์ด ์ ๋์ง ์์ data set์ด ์ ์ด์ ๊ทธ๋ฐ ๊ฒ์ด๋ผ๊ณ ์ถ์ธก
</details>
<details>
<summary> 7๏ธโฃ 2021.10.20</summary>
- Pay ํ๋ฉด
- ๊ธ์ก ์ ๋ฆฝ์, ๋ณ ์์ด๋ ์ ๋๋ฉ์ด์
์ถ๊ฐ
- AVFoundation์ ํ์ฉํ image classification์ ์ ์ฉ
- ์งํ ์ข
๋ฅ์ ๋ฐ๋ผ core data์ ์ ์ฅ
- ์ฝ๋ ๋ฆฌํฉํ ๋ง
- View Model unitTest
- ๊ฐ์ ์ธ๋ํ ์์
- collection view data source ๋ถ๋ถ ์์
- view ๋ถ๋ถ ์์
- navigation bar ๋ถ๋ถ ์์
- ์๋ฌ ๋๋ ๋ถ๋ถ ์์ (Order ํ๋ฉด)
</details>
<details>
<summary> 8๏ธโฃ 2021.10.21</summary>
- ์ถฉ๋ ๋ ๋ถ๋ถ์ ์ฌ์์
</details>
<br>
## ์์ฑ ๊ฒฐ๊ณผ
|๋ฐ์น ์คํฌ๋ฆฐ|์ด๊ธฐ์ด๋ฒคํธ ํ๋ฉด UI|๋ค์๋ณด์ง ์๊ธฐ ๊ธฐ๋ฅ|
|:-:|:-:|:-:|
|<img src="https://i.imgur.com/WQOV6t8.png" width=200>|<img src="https://i.imgur.com/5ULOaiE.png" width=200>|<img src="https://i.imgur.com/u8TxJUT.gif" width=200>|
|Tab bar|ํ ํ๋ฉด UI|What's New|
|<img src="https://i.imgur.com/DBtelD9.gif" width=200>|<img src="https://i.imgur.com/ZGKd2kk.gif" width=200>|<img src="https://i.imgur.com/ke7rdHH.gif" width=200>|
|Orderํ๋ฉด|์ ํ์์ธํ๋ฉด|์ฃผ๋ฌธํ๊ธฐ ๊ธฐ๋ฅ|
|<img src="https://i.imgur.com/EyVkNSq.gif" width=200>|<img src="https://i.imgur.com/5PxRsBa.gif" width=200>|<img src="https://i.imgur.com/D5zqEvT.gif" width=200>|
|๋๋ง์ ๋ฉ๋ด ๋ฑ๋ก|๋๋ง์ ๋ฉ๋ด ํํธ/์ฃผ๋ฌธ ๊ธฐ๋ฅ|Payํ๋ฉด(10,000์)|
|<img src="https://i.imgur.com/NVlgpME.gif" width=200>|<img src="https://i.imgur.com/2vRXnfj.gif" width=200>|<img src="https://i.imgur.com/yVy4viB.gif" width=200>|
## PR ๋ฉ์ธ์ง
|Day|Link|
|-|-|
|1์ฃผ์ฐจ ํ์์ผ|[์ด๊ธฐ ์ด๋ฒคํธ ํ๋ฉด & ํ ํ๋ฉด](https://github.com/boostcampwm-2021/swift-p4-starbuckst/pull/55)|
|1์ฃผ์ฐจ ๋ชฉ์์ผ|[What's new, Order, ์ ํ ์์ธ ํ๋ฉด ](https://github.com/boostcampwm-2021/swift-p4-starbuckst/pull/94)|
|2์ฃผ์ฐจ ํ์์ผ|[์ฝ๋ ๋ฆฌํํ ๋ง + Core Data + ๋๋ง์ ๋ฉ๋ด + ์์ธ ์ฃผ๋ฌธ ํ๋ฉด + Create ML](https://github.com/boostcampwm-2021/swift-p4-starbuckst/pull/153)|
|2์ฃผ์ฐจ ๋ชฉ์์ผ|[Pay ํ๋ฉด + ์ ๋๋ฉ์ด์
ํจ๊ณผ + ์ฝ๋ ๋ฆฌํฉํ ๋ง](https://github.com/boostcampwm-2021/swift-p4-starbuckst/pull/169)|
<br>
## ์ง ํ๋ก๊ทธ๋๋ฐ
### ๐ ์ฌ์ฉํ ๋ผ์ด๋ธ๋ฌ๋ฆฌ
- Alamofire : ๋คํฌ์ํฌ ํต์ ์ ๊ฐ๋จํ ํ ์ ์๋ ์ฅ์
- SnapKit : Constraint ๋ฅผ ์ฝ๊ฒ ์ ์ฉํ ์ ์๋ ์ฅ์
- (KingFisher : ์ด๋ฏธ์ง ์บ์์ฒ๋ฆฌ)
<br>
### ๐ ์ฝ๋ ์ปจ๋ฒค์
1. Model์ ์ต๋ํ ์๊ฒ ๋๋๋๊ฒ ๊ธฐ์ค์ด๋ค.
2. UI์ ๊ณตํต์ผ๋ก ์ฌ๋ฌ๊ณณ์ ๋ค์ด๊ฐ๋ ๋ก์ง ๋ถ๋ถ์ ๋ฐ๋ก extension์ผ๋ก ๊ด๋ฆฌํด์ ํ ๊ณณ์ ์ง์ค์ํจ๋ค.
3. ๋คํธ์ํฌ ๋ถ๋ถ์ ํ๋์ layer๋ก ๋ถ๋ฆฌํด์ ๋๋๋ค(๋คํธ์ํฌ ํต์ - ๋ฐ์ดํฐ decode - model)(์ธ๋ถ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ํ์ฉํด๋ ๋ฌด๋ฐฉํจ)
4. ๋งค์๋๋ ํ๋์ ๊ธฐ๋ฅ๋ง์ ๋ด๋นํ๋ ๊ฒ์ผ๋ก ํ๋ค(ex: ํ๋์ UILabel์ text๋ฅผ ์๋ก๋ค๋ฅด๊ฒ ์์ฑ์ ์ ์ํ ๊ฒฝ์ฐ text๋ฅผ ๋ง๋๋ ๋งค์๋ ๋ฐ๋ก ๋ฃ๋ ๋งค์๋ ๋ฐ๋กํด์ ์กฐํฉํ๋ ํ์์ผ๋ก ๊ตฌ์ฑํ๋ค.)
5. struct, classs ์ค ๊ณ ๋ฏผ์ด ๋ ๊ฒฝ์ฐ ์ฐ์ struct๋ก ์๋ํ๋ ๊ฒ์ ์์น์ผ๋ก ํ๋ค.
6. protocol์ ์ ๊ทน์ ์ผ๋ก ํ์ฉํด์ ๊ฐ์ฒด๊ฐ ์๋ก ๊ฐํ๊ฒ ์ฐ๊ฒฐ๊ณ ๋ฆฌ๊ฐ ์ ์ง ๋์ง ์๋๋ก ํ๋ค(๋จ, presenter๋ฅผ ํ์ฉํ ๊ฒฝ์ฐ๋ ๊ฐ์ฒด๋ฅผ ์์ ํด๋ ๋ฌด๋ฐฉํ๋ค)
7. extension์ ํ๋์ protocol ๊ธฐ์ค, ๋๋ supperclass ๊ธฐ์ค์ผ๋ก ๋๋๋ค.
8. view๋ ์ต๋ํ custom View๋ก ๋๋์ด์ storyboard์์ ๋ค ์์
ํ์ง ์๋ ๊ฒ์ผ๋ก ํ๋ค.
9. test code๋ model์ ๋ํ ์ ์๊ฐ ๋ด๋ ค์ง๋ฉด ๋ฐ๋ก๋ฐ๋ก ์ ์ํ๋ค.
10. compositional layout ์ ํตํด UI ๋ฅผ ๊ตฌ์ฑํ๋ค.
11. ๋คํธ์ํฌ๋ ํ๋์ framework๋ก ๊ณตํต์ ์ผ๋ก ๊ด๋ฆฌํ๋ค.
12. usecase(view model), presenster ์ฌ์ฉํ๋ ๊ฒ์ ์์น์ผ๋ก ํ๋ค.
<br>
### ๐ ์ฐธ๊ณ ํ ๋งํฌ
- [Kingfisher Cheat Sheet](https://github.com/onevcat/Kingfisher/wiki/Cheat-Sheet#cache)
- [Swift5์ Result Type ์ฌ์ฉํ๊ธฐ](https://eunjin3786.tistory.com/47)
- [๊น๋ชจ์ง๋ฅผ ์ปค๋ฉ๋๋ผ์ธ์์ ๋ฐ๋ก ์ ์ฉํ์ฌ ์ฌ์ฉํด๋ณด์๐](https://tngusmiso.tistory.com/57)
- [Clean Architecture With MVVM on iOS(using SwiftUI, Combine, SPM)](https://tigi44.github.io/ios/iOS,-Swift-Clean-Architecture-with-MVVM-DesignPattern-on-iOS/)
- [ iOS Clean Architecture + MVVM ๊ฐ๋
๊ณผ ์์ ](https://eunjin3786.tistory.com/207)
- [iOS ์ฌ์ฉ์ฑ ์ต๋๋ก ์ฌ๋ ค๋ณด์! UICollectionView Custom Layout](https://hucet.tistory.com/23)
- [๋ก์ปฌ ํธ์ฌ ์๋ฆผ ๊ตฌํ ๋ฐฉ๋ฒ (Local Notification)](https://onelife2live.tistory.com/33)
- [Swift: Confetti Animation Effect](https://www.youtube.com/watch?v=YosPD7eFvcE)
- [CoreML: Real Time Camera Object Detection with Machine Learning ](https://www.youtube.com/watch?v=p6GA8ODlnX0)
- [Unit testing asynchronous Swift code](https://www.swiftbysundell.com/articles/unit-testing-asynchronous-swift-code/)