Reference / Value / Protocol Type ์ Extension ํ ๊ฒฝ์ฐ dispatch ๋ฐฉ๋ฒ์ด ๋ฌ๋ผ์ง๊ธฐ๋ ํฉ๋๋ค. ์์๋ด ์๋ค! value type ์ extension ์์ ๊ตฌํํ ๋ฉ์๋๋ ์์ ๊ฐ๋ฅ์ฑ์ด ์๊ธฐ ๋๋ฌธ์ static dispatch ๋ก ๋์. reference type ์ extension ์์ ๊ตฌํํ ๋ฉ์๋๋ ์๋ธ ํด๋์ค์์ ์ฌ์ ์๊ฐ ๋ถ๊ฐ๋ฅํ๋ค.(์ด๋ฅผ ์ํด์๋ @objc ๋ฅผ ํตํด ํด๊ฒฐํ ์ ์๋ค.) ๊ทธ๋์ extension ์ ๋ฉ์๋๊ฐ ํธ์ถ๋๋ ๊ฒ์ด ๋ณด์ฅ๋๊ธฐ ๋๋ฌธ์ static dispatch ๋ก ๋์. protocol ์ extension ์์ ๊ตฌํํ ๋ฉ์๋๋ ๋ ๊ฐ์ง๋ก ๋๋๋ค. 1.extension ์ default ๊ตฌํ์ ํด๋ ๊ฒฝ์ฐ๋ ํด๋น ๋ฉ์๋์ ๋ํ ๊ตฌํ์ด ํ์..
Method Dispatch method dispatch ๋ Swift ์์ ๋ฉ์๋๋ฅผ ํธ์ถํ ๋ ํ์ฌ ๋ฉ๋ชจ๋ฆฌ์์ ์ด๋ป๊ฒ ์ด๋ค ๋ฉ์๋๋ฅผ ์คํ์ํฌ์ง๋ฅผ ๊ฒฐ์ ํ ๋ ์ฌ์ฉํ๋ ๋ฐฉ๋ฒ์ ๋๋ค. ํด๋์ค์ dispatch ๊ณผ์ ์ ์์๋ฅผ ๋ค์ด๋ด ์๋ค. class Animal { func bark() { print("bark!") } } class Cow: Animal { func bark() { print("moo!") } } class Dog: Animal { } let animal: Animal = Animal() animal.bark() let cow: Animal = Cow() cow.bark() let dog: Animal = Dog() dog.bark() ์ธ์คํด์ค animal, cow, dog ๊ฐ bark() ๋ฉ์๋..
- UserDefaults
- Protocol
- MVVM
- 2022 KAKAO TECH INTERNSHIP
- OpenSourceLibrary
- rxswift
- Objective-C
- WWDC22
- containerBackground
- github
- RxCocoa
- CloneCoding
- async/await
- Swift
- watchOS
- Firebase
- APNS
- urlsession
- MOYA
- SwiftUI
- Algorithm
- Notification
- YPImagePicker
- WidgetKit
- Widget
- projectsetting
- IOS
- WWDC
- ์๋ฒํต์
- configurable widget
์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
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