cocoapods

CocoaPods安装和使用教程

痞子三分冷 提交于 2019-12-16 16:17:21
CocoaPods安装和使用教程 Code4App 原创文章。转载请注明出处: http://code4app.com/article/cocoapods-install-usage 目录 CocoaPods是什么? 如何下载和安装CocoaPods? 如何使用CocoaPods? 场景1:利用CocoaPods,在项目中导入AFNetworking类库 场景2:如何正确编译运行一个包含CocoPods类库的项目 CocoaPods是什么? 当你开发iOS应用时,会经常使用到很多第三方开源类库,比如JSONKit,AFNetWorking等等。可能某个类库又用到其他类库,所以要使用它,必须得另外下载其他类库,而其他类库又用到其他类库,“子子孙孙无穷尽也”,这也许是比较特殊的情况。总之小编的意思就是,手动一个个去下载所需类库十分麻烦。另外一种常见情况是,你项目中用到的类库有更新,你必须得重新下载新版本,重新加入到项目中,十分麻烦。如果能有什么工具能解决这些恼人的问题,那将“善莫大焉”。所以,你需要 CocoaPods。 CocoaPods应该是iOS最常用最有名的类库管理工具了,上述两个烦人的问题,通过cocoaPods,只需要一行命令就可以完全解决,当然前提是你必须正确设置它。重要的是,绝大部分有名的开源类库,都支持CocoaPods。所以,作为iOS程序员的我们

CocoaPods and Carthage

≡放荡痞女 提交于 2019-12-14 04:17:35
问题 I had a project with both Carthage and Cocoapods. They both have one common dependency (PureLayout, to be precise). Strange, but project compiles fine without any errors about class redeclaration, etc. So the question is: why it works and which version of dependency is actually used when I call PureLayout's methods – Carthage's or Cocoapods' one? 回答1: Carthage and CocoaPods are very different in terms of building the dependencies and integrating them in the project. CocoaPods is centralized

cocoapods Sync: ld: framework not found DATAFilter, linker command failed with exit code 1

此生再无相见时 提交于 2019-12-14 03:55:07
问题 I am trying to get Sync (https://github.com/hyperoslo/Sync) to work in my 'em' Xcode iOS Swift project. I have experience with Carthage for framework dependency so it is my cocoapods premiere. my Podfile use_frameworks! target "em" do pod 'Sync' end my Pods dir: Michal-MBP:em kolisko$ v Pods total 24 drwxr-xr-x 16 kolisko staff 544 14 čvc 10:27 ./ drwxr-xr-x 14 kolisko staff 476 14 čvc 09:21 ../ -rw-r--r--@ 1 kolisko staff 6148 14 čvc 10:27 .DS_Store drwxr-xr-x 5 kolisko staff 170 14 čvc 09

CocoaPods Linter: Cannot Find Interface Declaration

ぐ巨炮叔叔 提交于 2019-12-14 03:15:54
问题 I'm having an issue with CocoaPods and it finding interface files in my project. The root of the problem is: - ERROR | [xcodebuild] ios-etsy-sdk/ios-etsy-sdk/SOSEtsyShopResult.h:22:32: error: cannot find interface declaration for 'SOSEtsyResult', superclass of 'SOSEtsyShopResult' - NOTE | [xcodebuild] ios-etsy-sdk/ios-etsy-sdk/SOSEtsyShopResult.h:22:12: warning: class 'SOSEtsyShopResult' defined without specifying a base class [-Wobjc-root-class] - NOTE | [xcodebuild] ios-etsy-sdk/ios-etsy

Cocoapod pod only for a specified platform

微笑、不失礼 提交于 2019-12-14 01:12:42
问题 I have an Xcode project with multiple targets. One of those targets targets the tvOS platform. My other targets make use of the 'youtube-iso-player-helper' framework, which does not support tvOS. I want to have a Cocoapod Podfile that includes the player framework only on iOS. Here is my current Podfile: source 'https://github.com/CocoaPods/Specs.git' platform :ios, '8.0' platform :tvos, '9.0' use_frameworks! pod 'SVGgh' pod "youtube-ios-player-helper", "~> 0.1" xcodeproj 'MyProject.xcodeproj

Modified Pod not getting compiled

人走茶凉 提交于 2019-12-13 20:05:30
问题 The problem I am facing is: modified pod is not being compiled by Xcode. I learnt that you shouldn't modify the code in an installed Pod, instead fork the repository, modify the code and use that as a Pod. I did that and installed the Pod back with my commit version. I see the code changes that I made. But, the Pod is not being compiled by Xcode and new symbols are NOT being resolved. I am not sure what am I missing here. My impression was Xcode automatically compiles the .m files in pod and

Lint Fail for Cocoapods

大憨熊 提交于 2019-12-13 15:10:03
问题 I have an Objective-C Library and I am trying to update the podspec to cocoapods. When I do the "pod spec lint" command I get the following error: [!] The spec did not pass validation, due to 1 error. [!] The validator for Swift projects uses Swift 3.0 by default, if you are using a different version of swift you can use a `.swift-version` file to set the version for your Pod. For example to use Swift 2.3, run: `echo "2.3" > .swift-version`. Here is my podspec file: Pod::Spec.new do |s| s

iOS Unexpected platform condition (expected 'os', 'arch', or 'swift') - Reachability

喜欢而已 提交于 2019-12-13 12:32:10
问题 I just update my pods. after update Reachability causing an error Unexpected platform condition (expected 'os', 'arch', or 'swift') I tried to build and clean but it does not work. what's the solution? Please help me to fix this. Thanks in advance. 回答1: use this 1 #if (arch(i386) || arch(x86_64)) && os(iOS) #endif 回答2: You can try as Muhammad says. I suggest the following code which is very easy to maintain. Copy paste the following code to a file and try yourself. import Foundation import

Carthage and GoogleMap

别说谁变了你拦得住时间么 提交于 2019-12-13 12:06:37
问题 Is it possible to install GoogleMap SDK via Carthage? I only saw the tutorial for Cocoapods only. Or I only can install manually if I am using Carthage? 回答1: According to Carthage docs: The only supported origins right now are GitHub repositories (both GitHub.com and GitHub Enterprise) Carthage actually builds binary framework from the sources it checkouts from the specified repository. Developer needs to link this built binary frameworks to the project afterwards. Google already provides you

Show TODO comments as warnings excluding the Pods folder

。_饼干妹妹 提交于 2019-12-13 11:42:44
问题 I have a script to show all my //TODO: comments which looks like this: KEYWORDS="TODO:|FIXME:|\?\?\?:|\!\!\!:" find "${SRCROOT}" \( -name "*.h" -or -name "*.m" -or -name "*.swift" \) -print0 | xargs -0 egrep --with-filename --line-number --only-matching "($KEYWORDS).*\$" | perl -p -e "s/($KEYWORDS)/ warning: \$1/" I want to exclude my Pods folder, therefore I have added -not -path "./Pods/*" : find "${SRCROOT}" \( -name "*.h" -or -name "*.m" -or -name "*.swift" \) -not -path "./Pods/*"