iOS的遠程圖片操作框架:DFImageManager
Modern iOS framework用于從各種源獲取,緩存,處理和加工圖片。它采用iOS SDK最新的技術,不改造現有的技術。它提供了一個功能強大的API,可擴展您應用程序的功能。
支持的資源
- NSURL with http, https, ftp, file, and data schemes
- PHAsset and NSURL with com.github.kean.photos-kit scheme
- DFALAsset, ALAsset and NSURL with assets-library scheme
特性
- Zero config yet immense customization and extensibility.
- Uses latest advancements in Foundation URL Loading System including NSURLSession that supports SPDY protocol.
- Extreme performance even on outdated devices. Completely asynchronous and thread safe. Performance-critical subsystems run entirely on the background threads.
- Instead of reinventing a caching methodology it relies on HTTP cache as defined in HTTP specification and caching implementation provided by Foundation URL Loading System. The caching and revalidation are completely transparent to the client. Read more
- Memory cache layer that stores decompressed and processed images with fine grained control.
- Centralized image decompression, resizing and processing. Image resizing results in a lack of misaligned images and lower memory footprint. Image processing is fully customizable.
- Automatic preheating of images that are close to the viewport.
- Groups same requests and never executes them twice. This is true for both fetching and processing. For example, the user creates three requests for the same URL, two of the requests want the image to be resized to the same target size while the other one wants the original image.DFImageManagerwill fetch the original image once, then it will resize it once.DFImageManagerprovides a fine grained control over which requests should be considered equivalent (both in terms of fetching and processing).
- High quality source code base that successfully manages complexity and follows best design principles and patterns, including dependency injection that is used throughout.
DFImageRequestID *requestID = [[DFImageManager sharedManager] requestImageForResource:[NSURL URLWithString:@"http://..."] completion:^(UIImage *image, NSDictionary *info) { // Use decompressed image and inspect info }]; [requestID cancel]; // requestID can be used to cancel the request
本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!