Giter Club home page Giter Club logo

cpimageview's Introduction

CPImageView

A small, lightweight subclass of UIImageView which supports async loading from URLs and caching both in memory and storage.

Features

  • Loading images asynchronously from a web server without interrupting the UI thread
  • Automatic caching images on the file system and using cache where needed
  • Additional automatic caching of newly downloaded files in-memory for faster access and releasing them if app receives memory warning
  • Optionally clearing previous image while loading, and checking if downloaded image is still the image to be displayed on the view upon download (ideal for using in reusable table view cells)
  • Optional logging about download and caching events

Usage

CPImageView is a subclass of the standard UIImageView. Just change your UIImageView instance to CPImageView whether it's in code or in Interface Builder.

  • For changing/settings an existing image view's image, use setImageFromURL: to set the source image from a URL. You can both pass in an NSString or an NSURL, the method (and all the other similar methods) accepts both. You can pass in nil to clear the image.

  • To create a new image view, you can use initWithImageURL: method directly to initialize an instance and start loading the image.

  • You may use the convenience methods storedImageForURL: and storeImage:forURL: methods to access file system cache for images.

Alternatives

There are many more alternatives to CPImageView, use whatever you need. There are more advanced, and even lighther alternatives to CPImageView. If they suit your needs, use them. If CPImageView is just what you need, feel free to use it. If you like to contribute to CPImageView, you are more than welcome to!

cpimageview's People

Contributors

canpoyrazoglu avatar

Stargazers

Mehmet Akif DERE avatar Håkon Bogen avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.