Skip to content

Commit aa0b3bc

Browse files
authored
Add COCOAPODS.md with installation instructions (#58)
1 parent 3aea7a6 commit aa0b3bc

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

COCOAPODS.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# CocoaPods
2+
3+
## Basic Integration
4+
5+
To integrate TIP into your iOS project using CocoaPods, simply add the following to your **Podfile**:
6+
7+
```ruby
8+
target 'MyApp' do
9+
pod 'TwitterImagePipeline', '~> 2.24.1'
10+
end
11+
```
12+
13+
Then run a `pod install` inside your terminal, or from CocoaPods.app.
14+
15+
## Extended Integration
16+
17+
TIP also has support for two additional codecs that are not included with the default installation:
18+
19+
- WebP (Backwards compatible to iOS 10)
20+
- MP4
21+
22+
If you wish to include these codecs, modify your **Podfile** to define the appropriate subspecs like the examples below:
23+
24+
```ruby
25+
target 'MyApp' do
26+
pod 'TwitterImagePipeline', '~> 2.24.1', :subspecs => ['WebPCodec/Default']
27+
28+
pod 'TwitterImagePipeline', '~> 2.24.1', :subspecs => ['WebPCodec/Animated']
29+
30+
pod 'TwitterImagePipeline', '~> 2.24.1', :subspecs => ['MP4Codec']
31+
32+
pod 'TwitterImagePipeline', '~> 2.24.1', :subspecs => ['WebPCodec/Animated', 'MP4']
33+
end
34+
```
35+
36+
- **`WebP/Default`**: Includes the `TIPXWebPCodec` with the WebP framework for basic WebP support.
37+
- **`WebP/Animated`**: Adds additional support to the `TIPXWebPCodec` for demuxing WebP data allowing for animated images.
38+
- **`MP4Codec`**: Includes the `TIPXMP4Codec`.
39+
40+
**Note:** You are still required to add these codecs to the `TIPImageCodecCatalogue` manually:
41+
42+
```objc
43+
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
44+
{
45+
TIPImageCodecCatalogue *codecCatalogue = [TIPImageCodecCatalogue sharedInstance];
46+
47+
[codecCatalogue setCodec:[[TIPXWebPCodec alloc] initPreservingDefaultCodecsIfPresent:NO]
48+
forImageType:TIPImageTypeWEBP];
49+
50+
[codecCatalogue setCodec:[[TIPMP4Codec alloc] init]
51+
forImageType:TIPXImageTypeMP4];
52+
53+
// ...
54+
}
55+
```

0 commit comments

Comments
 (0)