KFSwiftImageLoader alternatives and similar libraries
Based on the "Image" category.
Alternatively, view KFSwiftImageLoader alternatives based on common mentions on social networks and blogs.
-
SDWebImage
Asynchronous image downloader with cache support as a UIImageView category -
GPU Image
An open source iOS framework for GPU-based image and video processing -
Kingfisher
A lightweight, pure-Swift library for downloading and caching images from the web. -
MWPhotoBrowser
A simple iOS photo and video browser with grid view, captions and selections. -
FastImageCache
iOS library for quickly displaying images while scrolling -
GPUImage2
GPUImage 2 is a BSD-licensed Swift framework for GPU-accelerated video and image processing. -
TOCropViewController
A view controller for iOS that allows users to crop portions of UIImage objects -
AlamofireImage
AlamofireImage is an image component library for Alamofire -
PINRemoteImage
A thread safe, performant, feature rich image fetcher -
IDMPhotoBrowser
Photo Browser / Viewer inspired by Facebook's and Tweetbot's with ARC support, swipe-to-dismiss, image progress and more -
NYTPhotoViewer
A modern photo viewing experience for iOS. -
AspectFillFaceAware
An extension that gives UIImageView the ability to focus on faces within an image. -
SKPhotoBrowser
Simple PhotoBrowser/Viewer inspired by facebook, twitter photo browsers written by swift -
FlagKit
Beautiful flag icons for usage in apps and on the web. -
UIImageColors
Fetches the most dominant and prominent colors from an image. -
RSKImageCropper
An image cropper / photo cropper for iOS like in the Contacts app with support for landscape orientation. -
GPUImage3
GPUImage 3 is a BSD-licensed Swift framework for GPU-accelerated video and image processing using Metal. -
TLPhotoPicker
📷 multiple phassets picker for iOS lib. like a facebook -
ImageSlideshow
Swift image slideshow with circular scrolling, timer and full screen viewer -
EBPhotoPages
A photo gallery for iOS with a modern feature set. Similar features as the Facebook photo browser. -
Lightbox
:milky_way: A convenient and easy to use image viewer for your iOS app -
TinyCrayon
A smart and easy-to-use image masking and cutout SDK for mobile apps. -
MetalPetal
A GPU accelerated image and video processing framework built on Metal. -
Twitter Image Pipline
Twitter Image Pipeline is a robust and performant image loading and caching framework for iOS clients -
ImagePickerSheetController
ImagePickerSheetController replicates the custom photo action sheet in iMessage. -
Sharaku
(Not maintained)Image filtering UI library like Instagram. -
YUCIHighPassSkinSmoothing
An implementation of High Pass Skin Smoothing using Apple's Core Image Framework -
DFImageManager
Image loading, processing, caching and preheating -
SFSafeSymbols
Safely access Apple's SF Symbols using static typing -
CTPanoramaView
A library that displays spherical or cylindrical panoramas with touch or motion based controls. -
ImageScout
A Swift implementation of fastimage. Supports PNG, GIF, and JPEG. -
Paparazzo
Custom iOS camera and photo picker with editing capabilities -
OnlyPictures
A simple and flexible way to add source of overlapping circular pictures, currently supports horizontal overlapping or distant pictures with great layout flexibility. -
ShadowImageView
A apple music cover picture shadow style image library -
AXPhotoViewer
An iOS/tvOS photo gallery viewer, useful for viewing a large (or small!) number of photos. -
ComplimentaryGradientView
Create complementary gradients generated from dominant and prominent colors in supplied image. Inspired by Grade.js -
Imaginary
:unicorn: Remote images, as easy as one, two, three. -
SimpleImageViewer
A snappy image viewer with zoom and interactive dismissal transition. -
SABlurImageView
You can use blur effect and it's animation easily to call only two methods.
Appwrite - The Open Source Firebase alternative introduces iOS support
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of KFSwiftImageLoader or a related project?
README
KFSwiftImageLoader
KFSwiftImageLoader is an extremely high-performance, lightweight, and energy-efficient pure Swift async web image loader with memory and disk caching for iOS and Watch.
This is the world's first Watch-optimized async image loader with WKInterfaceImage extensions and intelligent automatic cache handling via WKInterfaceDevice.
Please also check out KFWatchKitAnimations for a great way to record beautiful 60 FPS animations for Watch by recording animations from the iOS Simulator.
Note:
Features
- WKInterfaceImage, UIImageView, UIButton, and MKAnnotationView extensions for asynchronous web image loading.
- Memory and disk cache to prevent downloading images every time a request is made or when the app relaunches, with automatic cache management to optimize resource use.
- Energy efficiency by sending only one HTTP/HTTPS request for image downloads from multiple sources that reference the same URL string, registering them as observers for the request.
- Maximum peformance by utilizing the latest and greatest of modern technologies such as Swift 5.1, URLSession, and GCD.
KFSwiftImageLoader Requirements
- Xcode 11.0+
- iOS 12.0+
- watchOS 6.0+
CocoaPods
To ensure you stay up-to-date with the latest version of KFSwiftImageLoader, it is recommended that you use CocoaPods.
Optimized for CocoaPods 1.8.4+, so you will need to run the following command first:
sudo gem install cocoapods
Add the following to your Podfile
platform :ios, '12.0'
pod 'KFSwiftImageLoader', '~> 4.0'
You will need to import KFSwiftImageLoader everywhere you wish to use it:
import KFSwiftImageLoader
Example Usage
UIImageView
imageView.loadImage(urlString: urlString)
Yes, it really is that easy. It just works. In the above example, the inputs "placeholder" and "completion" were ignored, so they default to nil. We can include them in the following way:
imageView.loadImage(urlString: urlString, placeholder: UIImage(named: "KiavashFaisali")) {
(success, error) in
// 'success' is a 'Bool' indicating success or failure.
// 'error' is an 'Error?' containing the error (if any) when 'success' is 'false'.
}
For flexibility, there are several different methods for loading images. Below are the method signatures for all of them:
func loadImage(_ urlString: String,
placeholder: UIImage? = nil,
completion: ((_ success: Bool, _ error: Error?) -> Void)? = nil)
func loadImage(_ url: URL,
placeholder: UIImage? = nil,
completion: ((_ success: Bool, _ error: Error?) -> Void)? = nil)
func loadImage(_ request: URLRequest,
placeholder: UIImage? = nil,
completion: ((_ success: Bool, _ error: Error?) -> Void)? = nil)
WKInterfaceImage
func loadImage(_ urlString: urlString,
placeholderName: String? = nil,
completion: ((_ success: Bool, _ error: Error?) -> Void)? = nil)
The main difference with the UIImageView extension is the parameter "placeholderName", which requires the placeholder image to be bundled with the Watch app for performance reasons.
UIButton
button.loadImage(urlString)
Again, KFSwiftImageLoader makes it very easy to load images. In this case, the button uses mostly the same method signature as UIImageView, but it includes two more optional parameters: "isBackground" and "controlState".
func loadImage(_ urlString: String,
placeholder: UIImage? = nil,
controlState: UIControlState = .normal,
isBackground: Bool = false,
completion: ((_ success: Bool, _ error: Error?) -> Void)? = nil)
"controlState" takes a UIControlState value that is required when setting images for buttons. "isBackground" simply indicates whether or not the button should use "setBackgroundImage:for:" or "setImage:for:" for image loading.
MKAnnotationView
annotationView.loadImage(urlString)
The methods in the MKAnnotationView extension are exactly the same as those in the UIImageView extension.
KFImageCacheManager
// Disable the fade animation.
// The default value is 0.1.
KFImageCacheManager.shared.fadeAnimationDuration = 0.0
// Set a custom timeout interval for the image requests.
// The default value is 60.0.
KFImageCacheManager.shared.timeoutIntervalForRequest = 15.0
// Set a custom request cache policy for the image requests as well as the session's configuration.
// The default value is .returnCacheDataElseLoad.
KFImageCacheManager.shared.requestCachePolicy = .useProtocolCachePolicy
// Disable file system caching by adjusting the max age of the disk cache and the request cache policy.
// The default value is 60 * 60 * 24 * 7 = 604800 seconds (1 week).
KFImageCacheManager.shared.diskCacheMaxAge = 0
KFImageCacheManager.shared.requestCachePolicy = .reloadIgnoringLocalCacheData
Sample App
Please take a look at the sample app under the Example folder for a clear idea of how to use KFSwiftImageLoader to load images in iOS and Watch.
Contact Information
Kiavash Faisali
License
KFSwiftImageLoader is available under the MIT license.
Copyright (c) 2019 Kiavash Faisali
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*Note that all licence references and agreements mentioned in the KFSwiftImageLoader README section above
are relevant to that project's source code only.