Scope
1. Global Scope(์ ์ญ ๋ฒ์)
- "{}"์ ์ํ์ง ์๊ณ , ๋ชจ๋ Scope์์ ์ ๊ทผ ๊ฐ๋ฅํ Scope
2. Local Scope(์ง์ญ ๋ฒ์)
- "{}"๋ด์ ์ํ๋ Scope์ด๋ฉฐ, ํด๋น ๋ฒ์ ๋ด์์๋ง ์ ๊ทผ ๊ฐ๋ฅํจ
3. Scope ํน์ง
- ๊ฐ์ Scope ๋ด์์๋ ๋์ผํ ์ด๋ฆ์ ๋ณ์/์์๋ฅผ ์ฌ์ฉํ ์ ์์
- ์๋ก ๋ค๋ฅธ Scope์์๋ ๋์ผํ ์ด๋ฆ์ ๋ณ์/์์๋ฅผ ์ฌ์ฉํ ์๋ ์์
- Local Scope์์๋ ์์ Scope์ ์ ๊ทผํ ์ ์์. ๊ฐ๋ น, ํจ์ ๋ด์์ ์ ์ญ ๋ณ์์ ์ ๊ทผํ๋ ๊ฒฝ์ฐ
- ์์ Scope์์๋ ํ์ Scope์ ์ ๊ทผ ๋ถ๊ฐ๋ฅ
'iOS Study > Swift Study' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
Type Inference (ํ์ ์ถ๋ก ) (0) | 2022.05.04 |
---|---|
Data Type With Memory (0) | 2022.05.03 |
Variables and Constants (0) | 2022.04.29 |
Swift Source Code Build (0) | 2022.04.28 |
Swift์์์ Call By Value vs Call By Reference (0) | 2022.03.12 |