Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ILSImageCache is a lightweight, pure-Swift library for downloading and caching images from the web. It provides you a chance to use a pure-Swift alternative in your next app.

NotificationsYou must be signed in to change notification settings

ileafsolutions/ILSImageCache

Repository files navigation

ILSImageCache is a lightweight, pure-Swift library for downloading and caching images from the web. It provides you a chance to use a pure-Swift alternative in your next app.

Features

  • Asynchronous image downloading and caching.
  • URLSession-based networking.
  • Independent components. Use the downloader or caching system separately as you need.
  • Prefetching images and showing them from cache later when necessary.
  • Extensions for UIImageView and UIButton to directly set an image from a URL.
  • Built-in transition animation when setting images.
  • Customizable placeholder while loading images.
  • Extensible image processing and image format support.


Installation

Compatibility

  • iOS 9.0+

  • Xcode 9.0+, Swift 4+

Manual installation

Download and drop the 'ILSImageCache.framework' into your Xcode project.Make Sure you add it by Embedded Binaries

Note

  • Use the ILSImageCache.framework in the folder 'AppStore Submission Framework' when you are submitting your application to the appstore

Usage

  1. The simplest use-case is setting an image to an image view with the UIImageView extension:

leturl="url_of_your_image"imageView.loadImageUsingCache(withUrl: url, placeholder:  placeholder image, animation:UIImageView.AnimationTypes.dissolve)
  1. Help to add set cache size to hold until refresh

ILSImageCache.setCacheSize(_numberofitemscachecanhold:10)
  1. Helps to remove cache when you want to clear

ILSImageCache.removeImageCaches()
  1. Also have image downloader block method


ILSImageCache.loadImageusingCache(withUrl: imageUrl) { (status, image) inguard let outPutimage = imageelse{self.imageViewdwn.image =  imageLiteral(resourceName: "placeholder")return}self.imageViewdwn.image = outPutimage}
  1. Also user can set the animation for image loading 


public enum AnimationTypes : String{case hideEffect,dissolve,none}
  1. Also ther is extension for UIButton
leturl="url_of_your_image"button.loadImageUsingCache(withUrl: url, placeholder:  placeholder image, animation:UIButton.AnimationTypes.dissolve)

7.Added UIImage Extension to Resize your image on the basis of width

self.imageViewdwn.image= outPutimage.resizedImage(toWidth:self.imageViewdwn.frame.size.width)

7.Added UIImage Extension to Resize your image on the basis of percentage

self.imageViewdwn.image= outPutimage.resizedImage(withPercentage:0.2)

Author

iLeaf Solutionshttp://www.ileafsolutions.com

About

ILSImageCache is a lightweight, pure-Swift library for downloading and caching images from the web. It provides you a chance to use a pure-Swift alternative in your next app.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp