티스토리 뷰
CocoaPods 이란?
CocoaPods는 Swift 및 Objective-C Cocoa 프로젝트의 종속성 관리자. 91,000개 이상의 라이브러리가 있으며 300만 개 이상의 앱에서 사용된다. CocoaPods을 사용하면 프로젝트를 우아하게 확장할 수 있다.
CocoaPods Guides
CocoaPods is fully open-sourced, so it depends on community contributions to get better. If you're looking to start working on CocoaPods, this is the place to start.
guides.cocoapods.org
1. 설치
터미널에 다음 명령어를 입력
$ sudo gem install cocoapods
2. 터미널에서 프로젝트 폴더로 이동
3. Podfile 생성
$ pod init
4. Podfile 열기
xcode를 사용해 Podfile을 열어주자.
$ open Podfile -a Xcode
(vi, vim, nano로 진행해도 오케이)
앞으로 이 Podfile을 통해 프로젝트의 cocoapod 라이브러리를 관리할 것이다.
5. 라이브러리 추가 후 저장
사용하고 싶은 라이브러리를 Podfile에 추가해주자.
이번엔 CocoaPods 홈페이지에서 찾은 SwipeCellKit 추가.
pod 'SwipeCellKit'
라이브러리의 설치 방법이나 버전은 그 라이브러리의 Github을 참고하자.
나는 SwipeCellKit 라이브러리를 최신 버전으로 설치했다.
GitHub - SwipeCellKit/SwipeCellKit: Swipeable UITableViewCell/UICollectionViewCell based on the stock Mail.app, implemented in S
Swipeable UITableViewCell/UICollectionViewCell based on the stock Mail.app, implemented in Swift. - GitHub - SwipeCellKit/SwipeCellKit: Swipeable UITableViewCell/UICollectionViewCell based on the s...
github.com
6. 라이브러리 설치
$ pod install
iOS) pod install error 해결
M1 맥북을 초기화하고 cocoaPods을 설치하던 도중에 error를 발견했다. podfile에 pod을 추가하고 pod install을 했는데 루비 어쩌구 저쩌구 .. 다음의 사이트들을 참고해서 해결했다. Bug #18555: Running "bund..
ekko.tistory.com
7. 프로젝트명.xcworkspace 에서 작업
라이브러리를 사용하기 위해서는 새로 생성된 .xcworkspace에서 작업하자.
8. 라이브러리 import 후 사용
라이브러리 import
import SwipeCellKit
라이브러리의 깃헙을 참고해서 사용하면 끝..!
'iOS' 카테고리의 다른 글
iOS) UserDefaults 사용해 데이터 저장하기 (0) | 2022.08.25 |
---|---|
iOS) CocoaPods - pod install error 해결방법 (0) | 2022.08.23 |
iOS) UITabBarController Programmatically (0) | 2022.08.09 |
iOS) UIDatePicker - 2 / Count Down Timer 생성 (0) | 2022.07.26 |
iOS) UIDatePicker - 1 (0) | 2022.07.24 |
- Total
- Today
- Yesterday
- BOJ 1935
- github
- Custom Detent
- BOJ 17298
- 요시푸스
- BOJ 10866
- Stack
- UICollectionView Error
- ios
- NaverMaps
- swift
- BOJ 10809
- CAGradientLayer
- autolayout
- BOJ 10820
- 1406 에디터
- BOJ 17413
- Gradient View
- Carousel Effect
- BOJ 10808
- 2023 회고
- Algorithm
- git
- UICollectionView banner
- BOJ 10799
- sheetPresentationController
- crud
- Card CollectionVIew
- Sheet Height
- bottom sheet
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 | 31 |