iOS 에서 외부 라이브러리를 사용하기 위해서는 일단! 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
$ sudo gem install cocoapods
위의 코드로 cocoapods 를 설치 할 수 있다.
다음 라이브러리를 추가하고자 하는 프로젝트 파일에서 터미널을 연 다음!
> pod init
을 해주면 Podfile 이 생성되는 것을 확인 할 수 있다!
혹시 에러가 난 경우
> brew uninstall cocoapods
그 다음 추가하고자 하는 라이브러리를 검색 할 수 있는데
flutter 의 pub.dev 처럼
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
해당 페이지에서 검색 할 수 있다.
그 다음 Podfile 에
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'COVID19' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
pod 'Alamofire'
pod 'Charts'
# Pods for COVID19
end
이런식으로 추가해주면 된다!
그 다음
> pod install
해주면 라이브러리가 정상 설치되는 것을 확인할 수 있다.
기타
> brew list
> sudo gem list
에러 발생시 Podfile, Pods 폴더 제거 후 다시 pod init!
혹시 안되면!
https://github.com/CocoaPods/CocoaPods/issues/10220#issuecomment-730963835
Got error while trying pod install · Issue #10220 · CocoaPods/CocoaPods
Command /usr/local/bin/pod install Report What did you do? pod install What did you expect to happen? Installing my pod's What happened instead? Error. This is on my MacBook Pro with the new M1...
github.com
'# 02 > iOS' 카테고리의 다른 글
[iOS] Geofence (0) | 2023.09.22 |
---|---|
[iOS] Alamofire (0) | 2022.10.26 |
[iOS] URLSession (0) | 2022.10.26 |