iOS/RxSwift

iOS(RxSwift) Install RxSwift using CocoaPods

crazydeer 2022. 8. 28. 09:00
반응형

지난 글에 이어서 RxSwift를 Install 해본다.

 

iOS(Swift) Reactive Programming (RxSwift) 란?

iOS(Swift) Functional Programming(함수형 프로그램) 이란? Mastering RxSwift for iOS Reactive Programming for Developers Reactive Programming Using Swift Programming Language www.udemy.com 새로운 Udem..

crazydeer.tistory.com

 

CocoaPods ❓

 

CocoaPods.org

CocoaPods is built with Ruby and is installable with the default Ruby available on macOS. We recommend you use the default ruby. Using the default Ruby install can require you to use sudo when installing gems. Further installation instructions are in the g

cocoapods.org

dependency manager for Swift and Objective-C

iOS 앱 개발하는데 3rd part package(외부 라이브러리)나 Extension 들을 손쉽게 통합해주는 도구이다.

CocoaPods는 위 홈페이지에 설치 방법에 따라 알아서 설치해보자. 어렵지 않다.

 

Intall RxSwift

1️⃣ 빈 Xcode 프로젝트를 생성한다.

install 1 create xcode project

 

2️⃣ CocoaPods.org 에서 RxSwift 검색

install 2 rxswift in cocoapods

 

3️⃣ Xcode 종료 → 터미널에서 pod init

이때 HelloRxSwift.xcodeproj 파일이 있는 경로로 들어가줘야 한다

💡 HelloRxSwift HelloRxSwift.xcodeproj

ls 명령어를 쳤을때 위와 비슷하게 나와야 한다.

 

pod init 를 입력해주면 Podfile이 생긴다.

install 3 podfile folder

 

4️⃣ Podfile을 열고 파일을 아래와 같이 수정해준다.

install 4 edit podfile

 

5️⃣ 터미널로 돌아와서 pod install 입력

Analyzing dependencies
Downloading dependencies
Installing RxSwift (4.5.0)
Generating Pods project
Integrating client project

[!] Please close any current Xcode sessions and use `HelloRxSwift.xcworkspace` for this project from now on.
Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.

[!] Automatically assigning platform `iOS` with version `13.0` on target `HelloRxSwift` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.

설치 성공

[ ! ] 은 천천히 읽어보면 다 이해된다. Podfile에서 iOS 버전을 따로 명시하지 않았기 때문에 프로젝트에서 설정한 13.0 으로 설치됐다는 말이다.

 

6️⃣ HelloRxSwift.xcworkspace 파일을 열어 프로젝트를 시작한다.

install 5 open .xcworkspace file

 

열고 그대로 command + b 로 빌드해보면 정상적으로 빌드가 잘 된다.

이제 설치는 완료되었다.

 

반응형