Tag: CocoaPods

  • Some useful features of a CocoaPods podfile

    You can specify build settings for all pods or only for one pod. Here is an example:

    
    post_install do | installer |
        installer.pods_project.targets.each do |target|
            target.build_configurations.each do |config|
                config.build_settings['DEBUG_INFORMATION_FORMAT'] = 'dwarf'
                config.build_settings['ENABLE_BITCODE'] = 'YES'
                
                if target.name == 'GPUImage2'
                    target.build_configurations.each do |config|
                        config.build_settings['SWIFT_VERSION'] = '3.0'
                    end
                end
            end
        end
    end
    
    

    You can create a podspec for a git repo, that is not a pod. Add this podspec to you project root and make a link for an added pod to specify a podspec. This is a better way to create pods for projects that do not have a pod, than creating a fork with a podspec, since you get latest updates more easily.

    pod 'GPUImage2', :podspec => './GPUImage2.podspec'
    
  • How to use a new model of CocoaPods PodSpec updates

    Recently CocoaPods started to use web service to load new PodSpecs.

    I will skip a moment, where you need to register your projects to yourself. Basicly, guys that manage CocoaPods have created a web service, that knows, which computer has permissions to which Pod.

    But when you have done this, you have to know, how to publish new versions of your Pods. You have to create a tag and push it on a new version as before and use that tag in your pod spec file.

    $ git tag -a 1.0.2 -m '1.0.2'
    $ git push --tags
    

    Then you should check your new updated pod spec.

    pod spec lint
    

    Then you just push your pod spec to a web service. Now you do not have to create one more folder for a new PodSpec file, copy it to your Specs fork and create a pull request. Everything is much simpler!

    $ pod trunk push ./DKProgressHUD.podspec
    

    Here it is important to tell a path to your pod spec file. I use here a dot since my pod spec file is located in the folder, where I am currently in Terminal.
    For more information read a blog of CocoaPods project.

    If you are asked to register a session first, do this:

    $ pod trunk register name@example.org 'Your Name' --description='macbook pro'
    

    In my case:

    $ pod trunk register alwawee@gmail.com 'Dennis Kutlubaev' --description='iMac at the office'