Movatterモバイル変換


[0]ホーム

URL:


The Podfile

<What is a Podfile?

The Podfile is a specification that describes the dependencies of thetargets of one or more Xcode projects. The file should simply be namedPodfile.All the examples in the guides are based on CocoaPods version 1.0 and onwards.

A Podfile can be very simple, this adds Alamofire to a single target:

An example of a more complex Podfile linking an app and its test bundle:

If you want multiple targets to share the same pods, use anabstract_target.

There is implicit abstract target at the root of the Podfile, so you could write the above example as:

<Migrating from 0.x to 1.0

We have ablog post explaining the changes in depth.

<Specifying pod versions

When starting out with a project it is likely that you will want to use the latest version of a Pod. If this is the case, simply omit the version requirements.

Later on in the project you may want to freeze to a specific version of a Pod, in which case you can specify that version number.

Besides no version, or a specific one, it is also possible to use logical operators:

In addition to the logic operators CocoaPods has an optimistic operator~>:

For more information, regarding versioning policy, see:

<Using the files from a folder local to the machine.

If you would like to develop a Pod in tandem with its clientproject you can use:path.

Using this option CocoaPods will assume the given folder to be theroot of the Pod and will link the files directly from there in thePods project. This means that your edits will persist between CocoaPodsinstallations. The referenced folder can be a checkout of your favourite SCM oreven a git submodule of the current repo.

Note that thepodspec of the Pod file is expected to be in that the designated folder.

<From a podspec in the root of a library repo.

Sometimes you may want to use the bleeding edge version of a Pod, aspecific revision or your own fork. If this is the case, you can specify that with yourpod declaration.

To use themaster branch of the repo:

To use a different branch of the repo:

To use a tag of the repo:

Or specify a commit:

It is important to note, though, that this means that the version willhave to satisfy any other dependencies on the Pod by other Pods.

Thepodspec file is expected to be in the root of the repo, if thislibrary does not have apodspec file in its repo yet, you will haveto use one of the approaches outlined in the sections below.

<< External resources

Using CocoaPods

Build with CocoaPods

Plugins

Contributing

Reference


[8]ページ先頭

©2009-2025 Movatter.jp