Module | Feature |
CloudInfinite (default module) | This module contains CI's basic image processing operations and supports freely combining various operations to build URLs for network requests. |
Loader | This module uses the CIImageLoadRequest instance to request online images and return image data. |
TPG | This module decodes and displays general images and TPG images. |
AVIF | This module decodes and displays general images and AVIF images (on v1.3.8 or later). |
SDWebImage-CloudInfinite | This module provides CI's basic image processing features based on the SDWebImage and CloudInfinite modules. |
pod 'CloudInfinite'
pod install
#import <CloudInfinite.h>
#import <CloudInfinite.h>
CloudInfinite * cloudInfinite = [CloudInfinite new];
let cloudInfinite = CloudInfinite();
CITransformation
and set related operations. The following takes TPG as an example.CITransformation * transform = [CITransformation new];[transform setFormatWith:CIImageTypeTPG options:CILoadTypeUrlFooter];
let transform = CITransformation();transform.setFormatWith(CIImageFormat.typeTPG, options: CILoadTypeEnum.urlFooter);
CIImageLoadRequest * imageloadRequest = [cloudInfinite requestWithBaseUrl:@"Image URL" transform:transform];// Image URLNSURL * imageURL = imageloadRequest.url;// Header parameterNSString * heaer = imageloadRequest.header;
let imageloadRequest = cloudInfinite.request(withBaseUrl: "Image URL", transform: transform);// Image URLlet imageURL = imageloadRequest.url;// Header parameterlet heaer = imageloadRequest.header;
[cloudInfinite requestWithBaseUrl:@"image link" transform:transform request:^(CIImageLoadRequest * _Nonnull request) {// Image URLrequest.url;// Header parameterrequest.header;}];
cloudInfinite.request(withBaseUrl: "", transform: transform) { (request) in// Image URLrequest.url;// Header parameterrequest.header;};
CIImageLoadRequest
is valid only when image format conversion is performed and options
is set to loadtypeacceptheader
.NSDictionary * header = @{@"accept":[NSString stringWithFormat:@"image/%@",request.header]};
CIImageLoadRequest
instance, use the CloudInfinite/Loader module to load images. Integrate the CloudInfinite/Loader module as follows:pod 'CloudInfinite/Loader'
NSData
, which is suitable for requesting TPG images (with the TPG decoding module required) or images that require additional processing of binary data.
Objective-C// `request` is the `CIImageLoadRequest` instance successfully constructed in the previous step.[[CIImageLoader shareLoader] loadData:request loadComplete:^(NSData * _Nullable data, NSError * _Nullable error) {// `data` is the obtained image data.}];
// `request` is the `CIImageLoadRequest` instance successfully constructed in the previous step.CIImageLoader.share().loadData(request) { (data, error) in// `data` is the obtained image data.};
// Pass in the image control `imageView` and the successfully constructed `CIImageLoadRequest` instance[[CIImageLoader shareLoader]display:imageView loadRequest:request placeHolder:nil loadComplete:^(NSData * _Nullable data, NSError * _Nullable error) {// `data` is the obtained image data.}];
// Pass in the image control `imageView` and the successfully constructed `CIImageLoadRequest` instanceCIImageLoader.share().display(imageView, loadRequest: request, placeHolder: nil) { (data, error) in// `data` is the obtained image data.};
Was this page helpful?