VesselWheel

[SwiftUI] cocoapods 설치 및 사용 본문

Xcode Study

[SwiftUI] cocoapods 설치 및 사용

JasonYang 2023. 4. 29. 10:09

[CocoaPods 사용법과 터미널 내용]


[터미널창에서 실행함] 

1) 기본 프로젝트 닫음
2) 파인더에서 프로젝트폴더 오른쪽 클릭하고 현재 폴더에서 새로운 터미널 열기
3) Cocoa Pod 유틸 설치하기
a. sudo gem install cocoapods 입력하고 엔터
   안 되면
   sudo gem install cocoapods -v 1.8.4 입력하고 엔터
b. Cocoa Pod 업데이트하기
   pod repo update 입력하고 엔터
4) 프로젝트 초기화하기 : pod init
5) 라이브러리 설치하기 : pod install
6) 프로젝트 열기
workspace 열기 : open ex12.xcworkspace
7) Xcode 에서 pod 파일 편집
pod 'AlertToast'
pod 'SDWebImageSwiftUI’
 ㄴ  이 두 줄을 입력함
8) 터미널에서 pod install 다시 함
     ㄴ pod install 입력하고 엔터     


- 터미널 명령어 -
pwd : 현재 디렉토리 위치 확인하기
ls : 파일목록 보기
ls -all : 파일목록 상세 보기
open : 파일 열기



[터미널 내용]

tjoeun02@tjoeunui-iMac-7 ex12 % sudo gem install cocoapods
Password: mac 비밀번호(********)를 입력하고 엔터하기 - 아무것도 나오지 않는 것이 정상임
Fetching cocoapods-core-1.12.1.gem
Fetching cocoapods-1.12.1.gem
Successfully installed cocoapods-core-1.12.1
Successfully installed cocoapods-1.12.1
Parsing documentation for cocoapods-core-1.12.1
Installing ri documentation for cocoapods-core-1.12.1
Parsing documentation for cocoapods-1.12.1
Installing ri documentation for cocoapods-1.12.1
Done installing documentation for cocoapods-core, cocoapods after 3 seconds
2 gems installed
tjoeun02@tjoeunui-iMac-7 ex12 % pod repo update
Updating spec repo `trunk`
tjoeun02@tjoeunui-iMac-7 ex12 % pod init
tjoeun02@tjoeunui-iMac-7 ex12 % ls
Podfile        ex12        ex12.xcodeproj
tjoeun02@tjoeunui-iMac-7 ex12 % pod install
Analyzing dependencies
Downloading dependencies
Generating Pods project
Integrating client project
tjoeun02@tjoeunui-iMac-7 ex12 % ls
Podfile            ex12
Podfile.lock        ex12.xcodeproj
Pods            ex12.xcworkspace
tjoeun02@tjoeunui-iMac-7 ex12 % open ex12.xcworkspace
tjoeun02@tjoeunui-iMac-7 ex12 % pod install
Analyzing dependencies
Downloading dependencies
Installing AlertToast (1.3.9)
Installing SDWebImage (5.15.5)
Installing SDWebImageSwiftUI (2.2.2)
Generating Pods project
Integrating client project
Pod installation complete! There are 2 dependencies from the Podfile and 3 total pods installed.
tjoeun02@tjoeunui-iMac-7 ex12 %

 

 

[cocoapods 활용 관련 사이트]

1. AlertToast

https://morioh.com/p/af6346c76627

 

Alerttoast: Create Apple-like Alerts & Toasts using SwiftUI

In today's post we will learn about AlertToast: Create Apple-like alerts & toasts using SwiftUI. AlertToast-SwiftUI. Present Apple-like alert & toast in SwiftUI

morioh.com

 

2. SDWebImageSwiftUI

https://cocoapods.org/pods/SDWebImageSwiftUI

 

SDWebImageSwiftUI

SwiftUI Image loading and Animation framework powered by SDWebImage

cocoapods.org