Kingfisher v6.0.0 Release Notes

Release Date: 2021-01-03 // about 3 years ago
  • โž• Add

    • A KF shorthand to create image setting tasks and config them. It provides a cleaner and modern way to use Kingfisher. Now, instead of using imageView.kf.setImage(with:options:), you can perform chain-able invocation with KF helpers. For example, the code below is identical. #1546

      // Old way
      imageView.kf.setImage(
        with: url,
        placeholder: localImage,
        options: [.transition(.fade(1)), .loadDiskFileSynchronously],
        progressBlock: { receivedSize, totalSize in
            print("progressBlock")
        },
        completionHandler: { result in
            print(result)
        }
      )
      
      // New way
      KF.url(url)
        .placeholder(localImage)
        .fade(duration: 1)
        .loadDiskFileSynchronously()
        .onProgress { _ in print("progressBlock") }
        .onSuccess { result in print(result) }
        .onFailure { err in print("Error: \(err)") }
        .set(to: imageView)
      
    • Similar to KF, The KFImage for SwiftUI is now having the similar chain-able syntax to setup an image task and options. This makes the KFImage APIs closer to the way how SwiftUI code is written. #1586

    • โž• Add support for TVMonogramView on tvOS. #1571

    • Some important properties and method in AnimatedImageView.Animator are marked as public now. It provides some useful information of the decoded GIF files. #1575

    • ๐Ÿ‘ An AsyncImageDownloadRequestModifier to support modifying the request in an asynchronous way. #1589

    • โž• Add a .lowDataMode option to support for Low Data Mode. When the .lowDataMode option is provided with an alternative source (usually a low-resolution version of the original image), Kingfisher will respect user's Low Data Mode setting and download the alternative image instead. #1590

    ๐Ÿ›  Fix

    • ๐Ÿ— An issue that importing AppKit wrongly in a macCatalyst build. #1547

    โœ‚ Remove

    • ๐Ÿšš Deprecated types, methods and properties are removed. If you are still using Kingfisher.Image, Kingfisher.ImageView or Kingfisher.Button, use the equivalent KFCrossPlatform types (such as KFCrossPlatformImage, etc) instead. Please make sure you do not have any warnings before migrate to Kingfisher v6. For more about the removed deprecated things, check #1525.
    • โฌ†๏ธ The standalone framework target of SwiftUI support is removed. Now the SwiftUI support is a part in the main Kingfisher library. To upgrade to v6, first remove Kingfisher/SwiftUI subpod (if you are using CocoaPods) or remove the KingfisherSwiftUI target (if you are using Carthage or Swift Package Manager), then reinstall Kingfisher. #1574