cocoapods

CocoaPods: use static lib into a pod

时光怂恿深爱的人放手 提交于 2020-12-05 10:56:30
问题 I have a pod that depends on a static lib (precompiled, source code not available). In this pod project, i drag and drop the folder containing the ".a" file and some other C, Obj-c files. When i try to include this pod in an application, Cocoapods copy all that pod files but not the ".a" file. In the Podspec, im using this to include the precompiled library to my pod s.ios.vendored_frameworks = 'path/a_staticLib.a' The line above copy the file in frameworks (Pods folder), this is normal as it

How to fix @testable import failed to load module in xcode unit testing

风流意气都作罢 提交于 2020-12-05 08:29:04
问题 I had created an Xcode project without unit testing. I have added cocoa pods when I try to create a new unit testing and try to import @testable import 'ProjectName' it gives an error Failed to load module 'ProjectName'. can u please help me out to solve the problem @testable import 'ProjectName' Failed to load module 回答1: Update Podfile like this and check target 'App' do pod 'Alamofire' target 'Demo AppTests' do inherit! :search_paths end target 'Demo AppUITests' do inherit! :search_paths

How to fix @testable import failed to load module in xcode unit testing

安稳与你 提交于 2020-12-05 08:27:20
问题 I had created an Xcode project without unit testing. I have added cocoa pods when I try to create a new unit testing and try to import @testable import 'ProjectName' it gives an error Failed to load module 'ProjectName'. can u please help me out to solve the problem @testable import 'ProjectName' Failed to load module 回答1: Update Podfile like this and check target 'App' do pod 'Alamofire' target 'Demo AppTests' do inherit! :search_paths end target 'Demo AppUITests' do inherit! :search_paths

Swift universal framework depending on pod

纵饮孤独 提交于 2020-12-01 12:11:18
问题 I'm developing a small Swift framework that depends on Alamofire. I'm using it as an embedded framework of an app belonging to the same workspace and it works perfectly. The problem arises when I want to build an universal framework with an aggregate target. Then, when executing the script to generate the framework it fails with the message No such module 'Alamofire' , referring to an import Alamofire in one of my source files. This is my Podfile: platform :ios, '9.0' use_frameworks! inhibit

CocoaPods制作自己的podspec文件

房东的猫 提交于 2020-11-22 01:23:12
在使用cocoapods进行开发时,都是使用pod search 一些别人的类库,有时候自己在一个项目中封装了自己一些类库,碰到如下情况: 1、 在做其他项目中,发现可以使用之前封装的类库,但是需要进行扩展 2、之前封装的类库,有瑕疵,需要修改代码 以上两种情况,涉及到修改了代码后,怎么在所有的用了这个类库的项目中更新这个类库。其中一个方法时,直接把修改后的文件,复制、粘贴到需要替换的项目中,显然这样做的话,在涉及到的项目少的情况下可以,但是涉及到项目比较多的,影响范围比较广的情况下,可操作性就不强了;那么还有一种方法就是,使用cocoapods进行管理时,在podfile里面添加自己封装的类库,然后需要更新时,执行一个pod install就可以解决这个问题。那么下面介绍就是如何让执行pod search时,可以搜索到自己的代码。 一、在github中新建一个仓库,git clone将代码拉下来,然后添加本地需要操作的类库,并执行如下命令 git tag -a 0.0.1 -m "Tag release 0.0.1” git push -—tags pod spec create 你的podspec文件的文件名 这样就生成了podspec文件,接下来就是需要编辑podspec文件里面的内容,这个文件中有很多是注释,删除注释,填写一些必须的内容,可以参考 http://www

从零开始制作自己的podspec

大兔子大兔子 提交于 2020-11-18 04:21:13
前言:CocoaPods相关资料 Commands: + repo Manage spec-repositories + search Searches for pods + setup Setup the CocoaPods environment + spec Manage pod specs + trunk Interact with the CocoaPods API (e.g. publishing new specs) + try Try a Pod! + update Update outdated project dependencies and create new CocoaPods/Specs CocoaPods Guides $ pod + cache Manipulate the CocoaPods cache + init Generate a Podfile for the current directory. + install Install project dependencies to Podfile.lock versions + ipc Inter-process communication + lib Develop pods + list List pods + outdated Show outdated project