๊ฐ„๋‹จํ•˜๊ฒŒ ํ”„๋กœ์ ํŠธ ๋‚ด๋ถ€๋ฅผ ํƒํ—˜ํ•ด๋ณด์•˜๋‹ค๋ฉด, ๊ฐ๊ฐ์˜ ์ œ๋Œ€๋กœ๋œ ์ •์˜๋ฅผ ์•Œ์•„์•ผ ํ•œ๋‹ค. ์•ž์˜ ๊ธ€์—์„œ ์ด์–ด์ง€๋‹ˆ, ์ดํ•ด๊ฐ€ ์•ˆ๋˜๋ฉด ๋ณด๊ณ  ์˜ค๋Š” ๊ฒƒ์ด ์ข‹๋‹ค.

Project

An Xcode project is a repository for all the files, resources, and information required to build one or more software products

Project๋Š” Application์„ ๋นŒ๋“œํ•˜๊ธฐ ์œ„ํ•œ ํŒŒ์ผ, ๋ฆฌ์†Œ์Šค, ์ •๋ณด๋ฅผ ๋‹ด์€ Repository์ด๋‹ค.

์ฒ˜์Œ Single View application ์ƒ์„ฑํ•˜๋ฉด, ํ”„๋กœ์ ํŠธ ํŒŒ์ผ์ด ์ƒ์„ฑ๋œ๋‹ค. PROJECT_NAME.xcodeproj ํŒŒ์ผ์ด ๋ฐ”๋กœ ์ด๊ฒƒ. ๊ทธ๋Ÿฐ๋ฐ ์•Œ์•„๋ณด์•˜์ง€๋งŒ, ์ด๋…€์„์˜ ์ •์ฒด๋Š” ๋””๋ ‰ํ† ๋ฆฌ์˜€๋‹ค.

  • xcuserdata : project์˜ ๊ฐœ์ธ ์„ค์ • ์ €์žฅ์„ ๋‹ด์€ ๋””๋ ‰ํ† ๋ฆฌ
  • project.pbxproj : ํ”„๋กœ์ ํŠธ ๋‚ด๋ถ€ ํŒŒ์ผ Reference๋ฅผ ์œ ํ˜•์— ๋”ฐ๋ผ ๊ธฐ๋กํ•œ ํŒŒ์ผ
  • project.xcworkspace : ์—ฌ๋Ÿฌ๊ฐœ์˜ Project๋ฅผ ๋‹ด์•„ ๊ด€๋ฆฌํ•˜๋Š” ๋””๋ ‰ํ† ๋ฆฌ

์œ„์™€ ๊ฐ™์ด ์„ธ๊ฐœ์˜ ํ•ญ๋ชฉ์œผ๋กœ ๊ตฌ์„ฑ๋˜์–ด ์žˆ์—ˆ๋‹ค.

Workspace

Workspace๋Š” CocoaPods๋ฅผ ํ†ตํ•ด ์ ‘ํ•ด๋ดค์„ ๊ฒƒ์ด๋‹ค. ํ•˜์ง€๋งŒ ์‹ค์ œ๋กœ PROJECT_NAME.scodeproj ํŒŒ์ผ ์•ˆ์—๋„ ํ•ด๋‹น ๋””๋ ‰ํ† ๋ฆฌ๊ฐ€ ์žˆ์—ˆ๋‹ค. cocoaPods๋กœ pod install์„ ํ•˜๋Š” ํ–‰์œ„๊ฐ€, workspace๋ฅผ ํ•˜๋‚˜ ๋งŒ๋“ค์–ด์ฃผ๋Š” ํ–‰์œ„๋ผ๋Š” ์‚ฌ์‹ค์„ ์ดํ•ดํ•  ์ˆ˜ ์žˆ์—ˆ๋‹ค. ํ•ด๋‹น ๋””๋ ‰ํ† ๋ฆฌ ์•ˆ์—๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์€ ๊ฒƒ๋“ค์ด ์žˆ์—ˆ๋‹ค.

  • contents.xcworkspacedata : ํ”„๋กœ์ ํŠธ๋“ค์˜ Reference ์ €์žฅ(xml)
  • xcuserdata : workspace์˜ ๊ฐœ์ธ ์„ค์ •์„ ๋‹ด์€ ๋””๋ ‰ํ† ๋ฆฌ
  • xcshareddata : workspace์— ๊ณต์œ ๋œ ์„ค์ •์„ ๋‹ด์€ ๋””๋ ‰ํ† ๋ฆฌ

Subproject

Xcode๋Š” Workspace๋ฅผ ํ†ตํ•ด ์—ฌ๋Ÿฌ๊ฐœ์˜ ํ”„๋กœ์ ํŠธ๋ฅผ ๋‹ค๋ฃฐ ์ˆ˜ ์žˆ๋Š” ๊ธฐ๋Šฅ์„ ์ œ๊ณตํ•œ๋‹ค๋Š” ๊ฒƒ์„ ์•Œ ์ˆ˜ ์žˆ์—ˆ๋‹ค. ๊ทธ๋Ÿฐ๋ฐ ์ด ๋ฐฉ๋ฒ• ๋ง๊ณ , ํ”„๋กœ์ ํŠธ ๋‚ด๋ถ€์— Subproject๋ฅผ ์ƒ์„ฑํ•˜์—ฌ ์ด๋ฅผ ๊ด€๋ฆฌํ•  ์ˆ˜๋„ ์žˆ๋‹ค.

์˜ˆ๋ฅผ ๋“ค์–ด, ์˜คํ”ˆ ์†Œ์Šค๋กœ ๋ฐฐํฌ๋˜๋Š” ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์—์„œ, ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์˜ ์ฝ”๋“œ๊ฐ€ ๋‹ด๊ธด Project์™€, ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๋งŒ๋“  ์˜ˆ์ œ Project๋ฅผ ๋‚˜๋ˆ„๊ณ  ์‹ถ์„ ์ˆ˜ ์žˆ๋Š”๋ฐ, ์ด ๋•Œ Subproject๋กœ ์˜ˆ์ œ Project๋ฅผ ๋งŒ๋“ค์–ด ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋‹ค.

์ด ๊ฒฝ์šฐ Workspace๋กœ ๊ฐ€๋Šฅํ•˜๊ธฐ๋Š” ํ•˜๋‹ค. ํ•˜์ง€๋งŒ ์ฐจ์ด์ ์„ ์•Œ๊ณ ๊ฐ€๋Š” ๊ฒƒ์ด ์ค‘์š”ํ•˜๋‹ค. Subproject๋Š” ์ด๋ฆ„์—์„œ๋„ ์•Œ ์ˆ˜ ์žˆ๋“ฏ Sub์ด๊ธฐ ๋•Œ๋ฌธ์—, ์ƒ์œ„ Project์™€ ๋ถ€๋ชจ-์ž์‹ ๊ด€๊ณ„๊ฐ€ ํ˜•์„ฑ๋œ๋‹ค. ๋ถ€๋ชจ๋Š” ์ž์‹ ํ”„๋กœ์ ํŠธ์— ๋Œ€ํ•ด Reference๋ฅผ ๊ฐ€์งˆ ์ˆ˜ ์žˆ์ง€๋งŒ, ์ž์‹์€ ๋ถ€๋ชจ์— ์ ‘๊ทผ์ด ๋ถˆ๊ฐ€ํ•˜๋‹ค.

๋ฐ˜๋Œ€๋กœ Workspace์˜ ๊ฒฝ์šฐ, Project๊ฐ„ ํ˜•์ œ ๊ด€๊ณ„๊ฐ€ ํ˜•์„ฑ๋œ๋‹ค. ๊ทธ๋ž˜์„œ ์–ด๋–ค ํ”„๋กœ์ ํŠธ๊ฑด ์„œ๋กœ๊ฐ„์˜ Reference๋ฅผ ์ง€๋‹ ์ˆ˜ ์žˆ๋‹ค.

Reference