ibireme/YYWebImage là dự án mã nguồn mở trên GitHub, viết chủ yếu bằng Objective-C, với 3.5k sao. Asynchronous image loading framework.
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
Image loading category for UIImageView, UIButton, MKAnnotationView and CALayer.
Image effect: blur, round corner, resize, color tint, crop, rotate and more.
High performance memory and disk image cache.
High performance image loader to avoid main thread blocked.
Fully documented.
Usage
Load image from URL
// load from remote url
imageView.yy_imageURL = [NSURL URLWithString:@"http://github.com/logo.png"];
// load from local url
imageView.yy_imageURL = [NSURL fileURLWithPath:@"/tmp/logo.png"];
Load animated image
// just replace `UIImageView` with `YYAnimatedImageView`
UIImageView *imageView = [YYAnimatedImageView new];
imageView.yy_imageURL = [NSURL URLWithString:@"http://github.com/ani.webp"];
Load image progressively
// progressive
[imageView yy_setImageWithURL:url options:YYWebImageOptionProgressive];
// progressive with blur and fade animation (see the demo at the top of this page)
[imageView yy_setImageWithURL:url options:YYWebImageOptionProgressiveBlur | YYWebImageOptionSetImageWithFadeAnimation];
Load and process image
// 1. download image from remote
// 2. get download progress
// 3. resize image and add round corner
// 4. set image with a fade animation
[imageView yy_setImageWithURL:url
placeholder:nil
options:YYWebImageOptionSetImageWithFadeAnimation
progress:^(NSInteger receivedSize, NSInteger expectedSize) {
progress = (float)receivedSize / expectedSize;
}
transform:^UIImage *(UIImage *image, NSURL *url) {
image = [image yy_imageByResizeToSize:CGSizeMake(100, 100) contentMode:UIViewContentModeCenter];
return [image yy_imageByRoundCornerRadius:10];
}
completion:^(UIImage *image, NSURL *url, YYWebImageFromType from, YYWebImageStage stage, NSError *error) {
if (from == YYWebImageFromDiskCache) {
NSLog(@"load from disk cache");
}
}];
Image Cache
YYImageCache *cache = [YYWebImageManager sharedManager].cache;
// get cache capacity
cache.memoryCache.totalCost;
cache.memoryCache.totalCount;
cache.diskCache.totalCost;
cache.diskCache.totalCount;
// clear cache
[cache.memoryCache removeAllObjects];
[cache.diskCache removeAllObjects];
// clear disk cache with progress
[cache.diskCache removeAllObjectsWithProgressBlock:^(int removedCount, int totalCount) {
// progress
} endBlock:^(BOOL error) {
// end
}];
Installation
CocoaPods
Update cocoapods to the latest version.
Add pod 'YYWebImage' to your Podfile.
Run pod install or pod update.
Import <YYWebImage/YYWebImage.h>.
Notice: it doesn't include WebP subspec by default, if you want to support WebP format, you may add pod 'YYImage/WebP' to your Podfile. You may call YYImageWebPAvailable() to check whether the WebP subspec is installed correctly.
Carthage
Add github "ibireme/YYWebImage" to your Cartfile.
Run carthage update --platform ios and add the framework to your project.
Import <YYWebImage/YYWebImage.h>.
Notice: carthage framework doesn't include webp component, if you want to support WebP format, use CocoaPods or install manually. You may call YYImageWebPAvailable() to check whether the WebP library is installed correctly.
Manually
Download all the files in the YYWebImage subdirectory.
Add the source files to your Xcode project.
Link with required frameworks:
UIKit
CoreFoundation
QuartzCore
AssetsLibrary
ImageIO
Accelerate
MobileCoreServices
sqlite3
libz
Import YYWebImage.h.
Notice: if you want to support WebP format, you may add Vendor/WebP.framework(static library) to your Xcode project.
Documentation
Full API documentation is available on CocoaDocs.
You can also install documentation locally using appledoc.
Requirements
This library requires iOS 6.0+ and Xcode 8.0+.
License
YYWebImage is provided under the MIT license. See LICENSE file for details.
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/ibireme/YYWebImage là nguồn chính thức.
ibireme/YYWebImage có bao nhiêu sao?
ibireme/YYWebImage có 3.5k sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/ibireme/YYWebImage. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
ibireme/YYWebImage có tag gì không?
Bản đồng bộ chưa ghi nhận topic GitHub nào cho ibireme/YYWebImage. GitHub topics hiển thị ở thanh bên phải trang repo — đó là nơi đáng kiểm tra nhất.
ibireme/YYWebImage còn đang phát triển không?
Commit gần nhất trên ibireme/YYWebImage là 5.8 năm trước (theo timestamp GitHub). Repo có 609 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
ibireme/YYWebImage viết bằng ngôn ngữ gì?
ibireme/YYWebImage chủ yếu viết bằng Objective-C. Trường "language" của GitHub dựa trên phần lớn byte ở nhánh mặc định.
Đọc đầy đủ README ở tab phía trên.
Chưa chắc YYWebImage có hợp với bạn?
Để ChatGPT, Claude hoặc Perplexity tìm hiểu giúp — bấm bên dưới và xem AI nói gì về YYWebImage.