TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Dec 2014 |
Maintained by Bruno Tortato Furtado.
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.
NZCircularImageView uses SDWebImage and UIActivityIndicator-for-SDWebImage to download async images.
Alternatively you can directly add source files to your project.
NZCircularImageView
folder 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 UIViewContentModeScaleAspectFill
contentMode with the clipsToBounds
flag 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 #define NZDEBUG
at *-Prefix.pch
file 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.