Jiseob Kim

iOS Developer

Xcode - Carthage ์„œ๋ก 

26 Dec 2018 » Xcode

๊ฒŒ์œผ๋ฆ„ ๋•Œ๋ฌธ์— ์˜ค๋žœ๋งŒ์— ๊ธ€์„ ์“ฐ๋Š” ๊ธฐ๋ถ„!

๊ทธ ๋™์•ˆ ๊ท€์ฐจ๋‹ˆ์ฆ˜์— ๋น ์ ธ ๋‚˜๋งŒ์˜ ์‹œ๊ฐ„์„ ๊ฐ€์กŒ๋˜๊ฒƒ ๊ฐ™๋‹ค! ๋‹ค์‹œ ์—ด์‹ฌํžˆ!

์šฐ์„  ๊ธฐ์กด์—๋Š” ๋„ˆ๋ฌด ์‹œ๊ฐ„์ด ๋งŽ์ด ์†Œ์š”๊ฐ€๋˜์–ด์„œ ํ‰์ผ์— ์“ฐ๊ธฐ๊ฐ€ ๋”์šฑ ํž˜๋“ค์—ˆ๋˜๊ฑฐ ๊ฐ™๊ธฐ์—

๋ถ„๋Ÿ‰์„ ์กฐ๊ธˆ ์ค„์ด๋ฉด์„œ ๋„์ „!

(์„ธ๋ฒŒ์‹ ๋„์ „์ค‘)

์˜ค๋Š˜ ์“ฐ๋ ค๋Š” ์ฃผ์ œ๋Š” Carthage์— ๊ด€ํ•œ๊ฒƒ์ด๋ฉฐ,

๊ธฐ์กด ์•ฑ์— ์ ์šฉํ•˜๋‹ค ์ถฉ๋Œ์„ ์ผ์œผ์ผœ ์ด๋ฅผ ํ•ด๊ฒฐํ•˜๋ฉด์„œ ๊ต‰์žฅํžˆ ์ด์ƒํ–ˆ๋˜์ ๋„ ์žˆ์—ˆ๋˜๊ฑฐ ๊ฐ™๋‹ค.

์˜ค๋Š˜์€ ์„œ๋ก ์ •๋„๋งŒ!


Swift Package Manager๋ž€?


์šฐ์„  ์ฃผ์ œ์ธ Carthage ๋ผ๋Š”๊ฒƒ์€ Swift Package Manager์˜ ์ผ์ข…์ด๋‹ค.


Swift Package Manager? ์–ด๋ ต๋‹ค.


์ด์— ์†ํ•˜๋Š”๊ฒƒ์€ CocoaPods! ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋“ค์„ ์ข€ ๋” ์‰ฝ๊ฒŒ ๊ด€๋ฆฌํ•˜๋Š” ๊ฒƒ!

์ž์„ธํ•œ ๋‚ด์šฉ๋“ค์€ ๋‚˜์ค‘์—๋ณด๋Š”๊ฒƒ์œผ๋กœ ํ•˜๊ณ ,


๊ฐœ์ธ์ ์œผ๋กœ CocoaPods์ด ํŽธํ•œ ์ด์œ 

  1. ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ๊ด€๋ฆฌ ๋ฐ ์ƒˆ๋กœ ์ถ”๊ฐ€๊ฐ€ ์‰ฝ๋‹ค.
  2. ๊ตฌ๊ธ€๋“ฑ ํฐ ํšŒ์‚ฌ์—์„œ Cocoapods์œผ๋กœ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ์ œ๊ณตํ•˜๋Š”๊ฒƒ์ด ๋งŽ๋‹ค.


์•„๋งˆ 1์˜ ์ด์œ  ๋•Œ๋ฌธ์— 2๊ฐ€ ์ƒ๊ธด๊ฒŒ ์•„๋‹๊นŒ?

์ด๋ฒˆ์— ํšŒ์‚ฌ์—์„œ ์ถ”๊ฐ€ํ•œ Google CloudSpeechAPI๋„ Cocoapods์œผ๋กœ ์ œ๊ณตํ•ด์„œ ์‰ฝ๊ฒŒ ์„ค์น˜๊ฐ€ ๊ฐ€๋Šฅํ–ˆ๋‹ค.

์„ค์น˜๋Š” ์‰ฌ์› ์œผ๋‚˜ ๋‹ด๋‹นํ•˜๋˜ ์•ฑ ์…‹ํŒ…์ด ๊ผฌ์ผ๋•Œ๋กœ ๊ผฌ์—ฌ์„œ Cocoapods ์ ์šฉ์ž์ฒด ํ•˜๋Š”๋ฐ 5์ผ ๊ฑธ๋ ธ๋‹ค, 5์ผ ๋™์•ˆ ์ •์‹ ๋ณ‘ ๊ฑธ๋ฆฌ๋Š”์ค„โ€ฆ ์„ฑ๊ณตํ•˜๊ณ  ์†Œ๋ฆฌ์ง€๋ฅผ๋ป”..


์•„๋ฌดํŠผ! ๊ทธ๋Ÿฐ๋ฐ ๋‹จ์ ์ด ์žˆ์œผ๋‹ˆ ์ด ๊ธ€์„ ํฌ์ŠคํŒ…ํ•˜๊ฒŒ ๋˜์—ˆ๋‹ค.


๋‚ด๊ฐ€ ์ƒ๊ฐํ•˜๋Š” ๋‹จ์ 

  1. ๋นŒ๋“œ๋ฅผ ํ• ๋•Œ ํ”„๋ ˆ์ž„์›Œํฌ๋„ ๋นŒ๋“œ๋ฅผ ํ•œ๋‹ค.


์ด๊ฒƒ์˜ ๊ฐ™์€ ๋ง์€ ํ”„๋ ˆ์ž„์›Œํฌ ์‚ฌ์ด์ฆˆ๊ฐ€ ์ซŒ ๋œ๋‹ค๋ฉด, ๋นŒ๋“œ์‹œ๊ฐ„์ด ๊ธธ์–ด์งˆํ…๋ฐ (gRPC ํ”„๋ ˆ์ž„์›Œํฌ๊ฐ€ ๋‚ด๊ฐ€ ๋ณธ๊ฒƒ์ค‘ ๊ฐ€์žฅ ์–ด๋งˆ๋ฌด์‹œ)

๊ทธ๋ ‡๋‹ค๋ฉด! ํ•˜๋ฃจ์—๋„ ์ˆ˜์‹ญ๋ฒˆ ๋นŒ๋“œ๋ฅผ ํ•˜๋Š”๋ฐ ์‹œ๊ฐ„ ๋‚ญ๋น„๊ฐ€ ๊ทธ๋งŒํผ ์‹ฌํ•ด์ง„๋‹ค๋Š”๊ฒƒ์ด๋‹ค!

๊ทธ๋Ÿฐ๋ฐ Carthage ๋ผ๋Š”๊ฑธ ์•Œ๊ฒŒ ๋˜์—ˆ๋Š”๋ฐ, ์ด ์ ์„ ์ปค๋ฒ„ํ•œ๋‹ค๊ณ  ํ•œ๋‹ค!


Carthage


(๋ฐœ์Œ: ์นด๋ฅดํƒ€๊ณ , ์˜์–ด ๋ฐœ์Œ์€ ์นด๋ฅดํƒ€์ง€)

CocoaPods์˜ ๋‹จ์ ์„ ์ปค๋ฒ„ํ•˜๋Š” ์ด์œ ๋Š” ๊ฐ„๋‹จํ•˜๋‹ค. ๋ฏธ๋ฆฌ ๋นŒ๋“œ๊ฐ€ ๋˜์–ด์žˆ๊ณ , ๋‹ค์‹œ ๋นŒ๋“œ๋ฅผ ์•ˆํ•œ๋‹ค๋Š”๊ฒƒ?

๊น”๋”ํ•˜๊ฒŒ ์ƒ์‡„ํ•œ๋‹ค. ์ด ์ ์ด ๊ต‰์žฅํžˆ ๋งค๋ ฅ์ ์ด์—ˆ๋‹ค.

์‹ค์ œ๋กœ ์Šคํ„ฐ๋””์—์„œ ๋งŒ๋“ค์—ˆ๋˜ MemCoo(ํ™๋ณด)๋ผ๋Š” ์•ฑ์— TesseractOCR ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์— ์ ์šฉ ํ•ด๋ดค๋”๋‹ˆ ๋นŒ๋“œํ• ๋•Œ 700 ๋ช‡๊ฐœ๋˜ ๊ฒƒ์ด 4~500๋Œ€๋กœ ๋–จ์–ด์กŒ๋˜๊ฒƒ ๊ฐ™์•˜๊ณ , RxSwift๋„ ๋นผ๋ดค๋”๋‹ˆ 100๋Œ€๋กœ ๋–จ์–ด์ง„๊ฑฐ ๊ฐ™๋‹ค. ๋งฅ๋ถ์ด ํšŒ์‚ฌ์— ์žˆ์–ด์„œ ์ •ํ™•ํ•œ ์ˆ˜์น˜๋Š” ๋‹ค์Œ๊ธ€์—!!


๋˜ ํ•˜๋‚˜์˜ ์žฅ์ ์ด ์žˆ๋‹ค.

Workspace๋ฅผ ์•ˆ์“ฐ๊ณ  ํ”„๋กœ์ ํŠธ ๋‹จ์œ„๋กœ๋งŒ ๊ฐ€๋Šฅํ•˜๋‹ค๋Š”๊ฒƒ?

Cocoapods์„ ์“ฐ๋ฉด ์ฒ˜์Œ ์ƒ์„ฑ๋˜๋Š” ํ”„๋กœ์ ํŠธ์— ๋“ค์–ด๊ฐˆ์ผ์ด ์—†์—ˆ๋‹ค. ์ฝ”์ฝ”์•„ํŒŸ์„ ์“ฐ๊ฒŒ๋˜๋ฉด Workspace๋ฅผ ์จ์•ผ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ์“ธ ์ˆ˜ ์žˆ์œผ๋‹ˆ๊น! ๊ทผ๋ฐ ์•ˆ์จ๋„ ๋œ๋‹ค๋‹ˆ ์ฐธ ์ข‹๊ตฐ!


๋‹ค๋ฅธ ์žฅ์ ๋“ค๋„ ์žˆ์ง€๋งŒ ๋‹จ์ ์„ ์–˜๊ธฐํ•˜์ž๋ฉด

CocoaPods๋ณด๋‹ค ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๊ฐ€ ์ ๋‹ค๋Š”๊ฒƒ? ํ•˜์ง€๋งŒ ๋‹ค๋ฅธ ๋ธ”๋กœ๊ทธ๋“ค์— ์˜ํ•˜๋ฉด ๋น ๋ฅด๊ฒŒ ๋Š˜์–ด๋‚˜๊ณ  ์žˆ๋‹ค๊ณ  ํ•œ๋‹ค!

๋‹ค์Œ ํŽธ์—์„  ๊ฐ„๋‹จํ•˜๊ฒŒ ์‚ฌ์šฉ๋ฒ•์— ๋Œ€ํ•˜์—ฌ ์ ์–ด๋ณด๋ คํ•œ๋‹ค!