UIImageView class extension. Performs async download image and leaves with rounded edge, used for presenting pictures of user profiles.
NZCircularImageView is a UIImageView extension. Its performs async download image and leaves with rounded edge.
It can be used, for example, to presenting pictures of user profiles.
NZCircularImageView works on iOS 6.0+ version and is compatible with ARC projects. It depends on the following Apple frameworks, which should already be included with most Xcode templates:
You will need LLVM 3.0 or later in order to build NZCircularImageView.
CocoaPods is the recommended way to add NZCircularImageView to your project.
Alternatively you can directly add source files to your project.
NZCircularImageViewfolder onto your project (use the "Product Navigator view"). Make sure to select Copy items when asked if you extracted the code archive outside of your project.
The class overrides
-(void)setFrame:, thus ensuring that every time an image is set, it will be presented in a rounded shape. This class also uses
UIViewContentModeScaleAspectFillcontentMode with the
clipsToBoundsflag so that the image resolution is not changed.
circularImageView.image = [UIImage imageNamed:@"Default-Avatar"];
// this method append parameters at url: // - width: image view width // - height: image view height // - mode: crop (crop image from center) [circularImageView setImageWithResizeURL:@"http://example.com/image.png"]; // // ... with custom loading indicator [circularImageView setImageWithResizeURL:kImageUrl usingActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite]; // // ... with placeholder image [self.imageView setImageWithResizeURL:kImageUrl placeholderImage:[UIImage imageNamed:@"Sample"] usingActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
To enable the logs in debug/release mode, add
*-Prefix.pchfile in your project.
This code is distributed under the terms and conditions of the MIT license.
A brief summary of each NZCircularImageView release can be found on the wiki.