Skip to content
This repository

Acknowledgements 

defragged edited this page · 5 revisions

CocoaPods will generate two 'Acknowledgements' files for each target specified in your Podfile which contain the License details for each Pod used in that target (assuming details have been specified in the Pod spec).

There is a markdown file, for general consumption, as well as a property list file that can be added to a settings bundle for an iOS application.

You don't need to do anything for this to happen, it should just work.

Customization

If you're not happy with the default boilerplate text generated for the title, header and footnotes in the files, it's possible to customise these by overriding the methods that generate the text in your Podfile like this:

class ::Pod::Generator::Acknowledgements
  def header_text
    "My custom header text"
  end
end

You can even go one step further and customise the text on a per target basis by checking against the target name, like this:

class ::Pod::Generator::Acknowledgements
  def header_text
    if @target_definition.label.end_with?("MyTargetName")
      "Custom header text for MyTargetName"
    else
      "Custom header text for other targets"
    end
  end
end

Finally, here's a list of the methods that are available to override:

Methods
header_title
header_text
footnote_title
footnote_text

iOS Setting Bundle

If you are using the generated plist in your settings bundle you might want to update the file every time that you update your pods. This can be accomplished by adding to your Podfile the following post_install hook.

post_install do | installer |
  require 'fileutils'
  FileUtils.copy('Pods/Pods-Acknowledgements.plist', 'Resources/Settings.bundle/Acknowledgements.plist')
end
Something went wrong with that request. Please try again.