본문 바로가기
iOS

[Xcode] CocoaPods(코코아팟) 사용법

by 건복치 2020. 2. 11.
반응형

CocoaPods이란?

CocoaPods is an application level dependency manager for the Objective-CSwift and any other languages that run on the Objective-C runtime, such as RubyMotion, that provides a standard format for managing external libraries. (Wikipedia)

 

코코아팟은 RubyMotion과 같이 Objective-C, Swift 및 Objective-C 런타임에 실행되는 모든 언어의 애플리케이션 레벨 종속성 관리자로서, 외부 라이브러리 관리를 위한 표준 형식을 제공한다. (위키피디아)

 

1. 코코아팟 설치

Terminal(터미널)을 열고 아래 명령어 입력

 

sudo gem install cocoapods

 

2. 코코아팟을 프로젝트에 추가

원하는 프로젝트 폴더에서

아래 명령어 입력

 

pod init

Podfile 생성

4. Podfile을 Xcode로 실행

open -a Xcode Podfile

초기 Podfile

5. Podfile에 원하는 라이브러리 추가 후 저장

6. Podfile에 적은 라이브러리 설치

pod install

설치 완료

7. 끝! 앞으로는 .xcworkspace 파일 사용해 작업하기

 

반응형

댓글