-
Cocoapods versionsSwift/Tips & Tricks 2022. 4. 15. 10:18
Swift 에서 다른 Dependency 를 이용할 때 CocoaPods 를 사용할 수 있다.
Version 을 정하지 않고 Podfile 에 아래와 같이 쓸 수도 있겠지만,
pod 'FBSDKLoginKit'
pod 'FBSDKShareKit'잘 되던 Project 가 어느순간 Package 의 업데이트로 코드가 달라지면 내 소중한 프로젝트가 망가질 수가 있다.
이때, Version 을 정해두면 안심하고 사용할 수 있다. (Swift Package Manager 에서도 가능)
특정 버전으로 정하기
pod 'AFNetworking', '1.2.0'
특정 버전 이상 또는 이하 등 Logical Operator 을 이용하는 경우
- '> 0.1' Any version higher than 0.1
- '>= 0.1' Version 0.1 and any higher version
- '< 0.1' Any version lower than 0.1
- '<= 0.1' Version 0.1 and any lower version
특정 버전 '전' 까지만 이용을 원하는 경우
- '~> 0.1.2' Version 0.1.2 and the versions up to 0.2, not including 0.2 and higher
- '~> 0.1' Version 0.1 and the versions up to 1.0, not including 1.0 and higher
- '~> 0' Version 0 and the versions up to 1.0, not including 1.0 and higher
Version 이 보통 앞 자리가 올라갈 때 큰 업데이트가 이루어지므로 '~>' 를 이용해서 하는 것을 권장.
'Swift > Tips & Tricks' 카테고리의 다른 글
Swift Adding/Removing ChildViewController (0) 2022.05.03 Date Format (0) 2022.04.15 FlatMap, CompactMap (0) 2022.04.08 Swift 개발 / 배포 코드 다르게 하기 (if DEBUG) (0) 2022.04.08 Rx Swift Cocoa pods 로 설치하기, playground 연습 환경 구축 (0) 2022.03.23