To integrate TIP into your iOS project using CocoaPods, simply add the following to your Podfile:
target 'MyApp' do
pod 'TwitterImagePipeline', '~> 2.25.0'
end
Then run a pod install
inside your terminal, or from CocoaPods.app.
TIP also has support for two additional codecs that are not included with the default installation:
- WebP (Backwards compatible to iOS 10)
- MP4
If you wish to include these codecs, modify your Podfile to define the appropriate subspecs like the examples below:
target 'MyApp' do
pod 'TwitterImagePipeline', '~> 2.25.0', :subspecs => ['WebPCodec/Default']
pod 'TwitterImagePipeline', '~> 2.25.0', :subspecs => ['WebPCodec/Animated']
pod 'TwitterImagePipeline', '~> 2.25.0', :subspecs => ['MP4Codec']
pod 'TwitterImagePipeline', '~> 2.25.0', :subspecs => ['WebPCodec/Animated', 'MP4']
end
WebP/Default
: Includes theTIPXWebPCodec
with the WebP framework for basic WebP support.WebP/Animated
: Adds additional support to theTIPXWebPCodec
for demuxing WebP data allowing for animated images.MP4Codec
: Includes theTIPXMP4Codec
.
Note: You are still required to add these codecs to the TIPImageCodecCatalogue
manually:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
TIPImageCodecCatalogue *codecCatalogue = [TIPImageCodecCatalogue sharedInstance];
[codecCatalogue setCodec:[[TIPXWebPCodec alloc] initPreservingDefaultCodecsIfPresent:NO]
forImageType:TIPImageTypeWEBP];
[codecCatalogue setCodec:[[TIPMP4Codec alloc] init]
forImageType:TIPXImageTypeMP4];
// ...
}