A simple NSImageView subclass that let's you download images asynchronously from the web on the Mac with some other useful properties.
- 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
- Add both .h and .m files of PVAsyncImageView to your project.
- Import PVAsyncImageView.h to wherever you want to use it just by
#import "PVAsyncImageView.h"
- Set the PVAsyncImageView class to your NSImageView in Interface Builder or by code
- 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];
This includes a Demo project that explains how to use PVAsyncImageView easily, with almost no lines of code.
PVAsyncImageView was created by Pedro Vieira.
@w1tch_
[email protected]
PVAsyncImageView is licensed under the terms of the BSD. Read the LICENSE file for more information.