์๋ฌธ์ self
- ์ธ์คํด์ค ์์ฒด ์ ๊ทผ ์ ์ฌ์ฉ๋๋ ์ฐธ์กฐ๊ฐ
- self๋ ์ฐธ์กฐ ํ์
- value type์์์ self๋ stack์์ญ์ ์กด์ฌํ๋ instance๋ฅผ ๊ฐ๋ฆฌํค๋ ํํ
- reference type์์์ self๋ heap ์์ญ์ ์กด์ฌํ๋ instance๋ฅผ ๊ฐ๋ฆฌํค๋ ํํ
๋๋ฌธ์ Self
- Self๋ type๊ทธ ์์ฒด๋ฅผ ์๋ฏธ -> ํ์ ์ ์ ์ํ ๋ ์ฌ์ฉ
- Self.self๋ type object๋ฅผ ์๋ฏธ -> ํ์ ์ ๋๊ธธ๋ ์ฌ์ฉ
- protocol ๋ด๋ถ์์์ Self ์๋ฏธ: protocol ์์ ์ด ์๋, ์๊ธฐ ์์ ์ ์ฑํํ ํ์ ์ ์๋ฏธ
- Class์์์ Self ์๋ฏธ : ํด๋น ์ธ์คํด์ค์ ํ์ ์์ฒด๋ฅผ ํํ
์ฐธ๊ณ ์๋ฃ
'iOS ๐ > Swift' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
Swift) ์ฐ์ฐ์ == ์ === ์ ์ฐจ์ด (0) | 2022.09.24 |
---|---|
Property Wrapper (0) | 2022.04.28 |
RxSwift Operator : Map, FlatMap (0) | 2022.04.18 |
typealias, associatedtype (0) | 2022.04.15 |
Non-Escaping Closure ์ Escaping Closure (0) | 2021.12.28 |