Skip to content

A simple NSImageView subclass that let's you download images asynchronously from the web on the Mac with some other useful properties.

License

Notifications You must be signed in to change notification settings

pedrovieira/PVAsyncImageView

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PVAsyncImageView

A simple NSImageView subclass that let's you download images asynchronously from the web on the Mac with some other useful properties.

Features

  • Download images from the Web to the NSImageViews asynchronously with just 1 line of code
  • Set a 'Placheholder Image' to be displayed on the NSImageView until the image is downloaded
  • Set an 'Error Image' to be displayed when an error occurs while downloading the image
  • Set ToolTips on the NSImageView for each state -> Loading Image / Image Loaded / Error Loading Image
  • Display a Spinning Wheel on top of the NSImageView while it's downloading the image

How-to-use

  1. Add both .h and .m files of PVAsyncImageView to your project.
  2. Import PVAsyncImageView.h to wherever you want to use it just by #import "PVAsyncImageView.h"
  3. Set the PVAsyncImageView class to your NSImageView in Interface Builder or by code
  4. Download an image (there are many methods to load images, but this is the most completed one) by:
[_imageView downloadImageFromURL:@"mywebsite.com/image.png" withPlaceholderImage:[NSImage imageNamed:@"loading_IMG"] errorImage:[NSImage imageNamed:@"error_IMG"] andDisplaySpinningWheel:YES];

Demo Project

This includes a Demo project that explains how to use PVAsyncImageView easily, with almost no lines of code.

Author

PVAsyncImageView was created by Pedro Vieira.
@w1tch_
[email protected]

License

PVAsyncImageView is licensed under the terms of the BSD. Read the LICENSE file for more information.

About

A simple NSImageView subclass that let's you download images asynchronously from the web on the Mac with some other useful properties.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published