Swift๋Š” ๊ฐ์ฒด์˜ ๋Š๋‚Œ์œผ๋กœ ์‚ฌ์šฉํ•˜๋Š” 3๊ฐœ์˜ ๊ฐœ์ฒด๊ฐ€ ์žˆ๋‹ค. struct, class, enumeration์ด ๊ทธ๊ฒƒ์ด๋‹ค. struct๋Š” apple์—์„œ ๊ถŒ์žฅํ•˜๊ณ , ์‹ค์ œ๋กœ๋„ ๋Œ€์ฒดํ•˜๋Š” ๊ฒƒ์ด ์ข‹๋‹ค๊ณ  ์ƒ๊ฐ๋˜๋Š” ์ž๋ฃŒ๊ตฌ์กฐ์ด๊ณ , enum์˜ ๊ฒฝ์šฐ ๋‹ค๋ฅธ ์–ธ์–ด๋ณด๋‹ค ๊ธฐ๋Šฅ์ด ๋งŽ์ด ์ถ”๊ฐ€๋˜์—ˆ๋‹ค. property์™€ method ์ž‘์„ฑ๋„ ๊ฐ€๋Šฅํ•˜๋‹ค. ์‹ค์ œ๋กœ enum์˜ ๊ฒฝ์šฐ ๊ฐ’์„ ๊ด€๋ฆฌํ•˜๋Š” ๋ชฉ์ ์œผ๋กœ ๋งŽ์ด ์‚ฌ์šฉํ–ˆ์—ˆ๋‹ค. 3๊ฐœ์˜ ์ž๋ฃŒ๊ตฌ์กฐ์˜ ๊ณตํ†ต์ ๊ณผ ์ฐจ์ด์ ์— ์œ ์˜ํ•˜๋ฉฐ ์ฝ๋‹ค๋ณด๋ฉด ๊ธˆ๋ฐฉ ์ดํ•ด๊ฐ€ ๋  ๋“ฏํ•˜๋‹ค. ๊ทธ๋Ÿผ ์‹œ์ž‘ํ•ด๋ณด์ž.

Class

  • ์ „ํ†ต์ ์ธ OOP ๊ด€์ ์—์„œ์˜ ํด๋ž˜์Šค
  • ๋‹จ์ผ ์ƒ์†
  • ์ธ์Šคํ„ด์Šค/ํƒ€์ž… ๋ฉ”์„œ๋“œ
  • ์ธ์Šคํ„ด์Šค/ํƒ€์ž… ํ”„๋กœํผํ‹ฐ
  • ์ฐธ์กฐํƒ€์ž…
  • Apple ํ”„๋ ˆ์ž„์›Œํฌ์˜ ๋Œ€๋ถ€๋ถ„์˜ ํฐ ๋ผˆ๋Œ€๋Š” ๋ชจ๋‘ ํด๋ž˜์Šค
  • identity operator
    • reference type์˜ ๊ฒฝ์šฐ ๊ฐ™์€ instance์ธ์ง€ ํ™•์ธํ•  ๋ฐฉ๋ฒ•์ด ํ•„์š”ํ•จ
    • "===", "!=="