Delegate ํจํด์ ์ฌ์ฉํ๋ฉด์ Protocol ์ ๋ง๋ค์๋ค. ๊ทธ๋ฐ๋ฐ SwiftLint ์์ ๋ค์๊ณผ ๊ฐ์ด ๊ฒฝ๊ณ ๊ฐ ๋ฐ์ํ๋ค! delegate ๋ reference cycle ์ ํผํ๊ธฐ ์ํด์ weak(์ฝํ ์ฐธ์กฐ)๋ฅผ ์ฌ์ฉํด์ผ ํ๋ค. delegate protocol ์ weak(์ฝํ ์ฐธ์กฐ)๋ฅผ ์ํด์ ํด๋์ค ์ ์ฉ ์ด์ด์ผ ํ๋ค. Delegate ๋ฅผ weak ๋ก ์ ์ธํ์ ์ธ์คํด์คํ ํด์ ์ฐธ์กฐํ ๋ Retain ์ด ์๊ธด๋ค๊ณ ํด์. ๊ทธ๋ฐ๋ฐ protocol ์ ํด๋์ค๋ ๊ตฌ์กฐ์ฒด์ฒ๋ผ ์ธ์คํด์คํ ๋๋ ๊ฒ์ด ์๋๋ฐ ์ Retain cycle ์ด ์๊ธฐ๋๊ฑธ๊น์? ์๋ฅผ ๋ค์ด ํด๋์ค a์ b๊ฐ ์๋ก๋ฅผ protocol ๋ก ์ฐธ์กฐํ๊ฒ ๋๋ฉด ๊ฐํ ์ฐธ์กฐ๊ฐ ๋๋ฉด์ Retain Cycle ์ด ๋ฐ์ํ๋๊ฑฐ์ฃ ! ๊ทธ๋์ weak ๋ฅผ ์ ์ธํด์ refer..
- Swift
- OpenSourceLibrary
- projectsetting
- RxCocoa
- Objective-C
- Algorithm
- UserDefaults
- async/await
- Widget
- MVVM
- MOYA
- urlsession
- IOS
- Firebase
- YPImagePicker
- Notification
- containerBackground
- SwiftUI
- CloneCoding
- watchOS
- WWDC
- WWDC22
- configurable widget
- 2022 KAKAO TECH INTERNSHIP
- ์๋ฒํต์
- APNS
- github
- rxswift
- WidgetKit
- Protocol
์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
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 |
- Total
- Today
- Yesterday