Update installation.md

This commit is contained in:
Hannah Troisi
2016-07-24 09:13:12 -07:00
committed by GitHub
parent c4109c9701
commit f9e2c0d552

View File

@@ -6,54 +6,79 @@ prevPage: resources.html
nextPage: intelligent-preloading.html
---
### CocoaPods
AsyncDisplayKit may be added to your project via <a href = "installation.html#cocoapods">CocoaPods</a> or <a href = "installation.html#carthage-standard-build">Carthage</a> (standard build)</li>. Do not forget to import the framework header
AsyncDisplayKit is available on <a href="http://cocoapods.org">CocoaPods</a>. Add the following to your Podfile:
```
#import <AsyncDisplayKit/AsyncDisplayKit.h>
```
or create a <a href="https://developer.apple.com/library/ios/documentation/swift/conceptual/buildingcocoaapps/MixandMatch.html">Objective-C bridging header</a> (Swift).
<div class = "highlight-group">
<span class="language-toggle"><a data-lang="ruby" class = "active">Ruby</a></span>
If you have any problems installing AsyncDisplayKit, please contact us on Github or <a href = "/docs/resources.html#slack">Slack</a>!
<div class = "code">
<pre lang="ruby" class="ruby">
pod 'AsyncDisplayKit'
</pre>
</div>
## CocoaPods
AsyncDisplayKit is available on <a href="https://cocoapods.org/pods/AsyncDisplayKit">CocoaPods</a>. Add the following to your Podfile:
```
target 'MyApp' do
pod "AsyncDisplayKit"
end
```
Quit Xcode completely before running
```
> pod install
```
in the project directory in Terminal.
To update your version of AsyncDisplayKit, run
```
> pod update AsyncDisplayKit
```
in the project directory in Terminal.
Don't forget to use the workspace `.xcworkspace` file, _not_ the project `.xcodeproj` file.
## Carthage (standard build)
<div class = "note">
The standard way to use Carthage is to have a Cartfile list the dependencies, and then run <code>carthage update</code> to download the dependenices into the <code>Cathage/Checkouts</code> folder and build each of those into frameworks located in the <code>Carthage/Build</code> folder, and finally the developer has to manually integrate in the project.
</div>
AsyncDisplayKit is also available through <a href="https://github.com/Carthage/Carthage">Carthage</a>.
### Carthage
Add the following to your Cartfile to get the **latest release** branch:
AsyncDisplayKit is also available through <a href="https://github.com/Carthage/Carthage">Carthage</a>. Add the following to your Cartfile:
<div class = "highlight-group">
<span class="language-toggle"><a data-lang="carthage" class = "active">Carthage</a></span>
<div class = "code">
<pre lang="carthage" class="carthage">
```
github "facebook/AsyncDisplayKit"
</pre>
</div>
</div>
```
Run carthage update in Terminal and to fetch and build the AsyncDisplayKit library. This will create a folder named Carthage in your apps root folder. In that folder there will be a Build folder from where you have to drag the frameworks you want to use into the “Linked Frameworks and Libraries” section in Xcode.
Or, to get the **master** branch:
### Static Library
```
github "facebook/AsyncDisplayKit" "master"
```
AsyncDisplayKit can also be used as a regular static library
<ol>
<li>Copy the project to your codebase manually, adding `AsyncDisplayKit.xcodeproj` to your workspace.</li>
<li>In "Build Phases", add the AsyncDisplayKit Library to the list of "Target Dependencies".</li>
<li>In "Build Phases", add `libAsyncDisplayKit.a`, AssetsLibrary, and Photos to the "Link Binary With Libraries" list.</li>
<li>In "Build Settings", include `-lc++ -ObjC` in your project linker flags.</li>
</ol>
AsyncDisplayKit has its own Cartfile which lists its dependencies, so this is the only line you will need to include in your Cartfile.
###Importing AsyncDisplayKit
Import the framework header, or create an <a href="https://developer.apple.com/library/ios/documentation/swift/conceptual/buildingcocoaapps/MixandMatch.html">Objective-C bridging header</a> if you're using **Swift**:
Run
<div class = "highlight-group">
<span class="language-toggle"><a data-lang="objective-c" class = "active objcButton">Objective-C</a></span>
<div class = "code">
<pre lang="objc" class="objc">
#import &lt;AsyncDisplayKit/AsyncDisplayKit.h&gt;
</pre>
</div>
</div>
```
> carthage update
```
in Terminal. This will fetch dependencies into a `Carthage/Checkouts` folder, then build each one.
Look for terminal output confirming `AsyncDisplayKit`, `PINRemoteImage (3.0.0-beta.2)` and `PINCache` are all fetched and built. The ASDK framework Cartfile should handle the dependencies correctly.
In Xcode, on your application targets **“General”** settings tab, in the **“Linked Frameworks and Libraries”** section, drag and drop each framework you want to use from the `Carthage/Build` folder on disk.
## Carthage (light)
AsyncDisplayKit does not yet support the lighter way of using Carthage, in which you manually add the project files. This is because one of its dependencies, PINCache (a nested dependency of PINRemoteImage) does not yet have a project file.
Without including PINRemoteImage and PINCache, you will not get AsyncDisplayKit's full image feature set.