NZN/NZCircularImageView

Name: NZCircularImageView

Owner: Grupo NZN

Description: UIImageView class extension. Performs async download image and leaves with rounded edge, used for presenting pictures of user profiles.

Created: 2013-12-10 15:38:25.0

Updated: 2018-01-12 16:46:34.0

Pushed: 2015-08-25 15:25:33.0

Homepage: null

Size: 898

Language: Objective-C

GitHub Committers

UserMost Recent Commit# Commits
Ernesto Rivera2014-08-12 08:42:46.02
Darren Ehlers2014-04-04 20:09:40.03
Bruno Tortato Furtado2014-09-25 13:02:20.023
Elie Soueidy2014-02-01 21:10:41.01

Other Committers

UserEmailMost Recent Commit# Commits
Bruno Tortato Furtadobruno.furtado@gruponzn.com2013-12-14 21:01:51.011

README

NZCircularImageView License MIT

NZCircularImageView

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.

Build Status Cocoapods Cocoapods Analytics

Requirements

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.

Adding NZCircularImageView to your project
Cocoapods

CocoaPods is the recommended way to add NZCircularImageView to your project.

Source files

Alternatively you can directly add source files to your project.

  1. Download the latest code version or add the repository as a git submodule to your git-tracked project.
  2. Open your project in Xcode, then drag and drop all files at 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.
  3. Install SDWebImage
  4. Install UIActivityIndicator-for-SDWebImage
Usage

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.

NZCircularImageView

ularImageView.image = [UIImage imageNamed:@"Default-Avatar"];
his method append parameters at url:
 width: image view width
 height: image view height
 mode: crop (crop image from center)
cularImageView setImageWithResizeURL:@"http://example.com/image.png"];

.. with custom loading indicator
cularImageView setImageWithResizeURL:kImageUrl
         usingActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];

.. with placeholder image
f.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.

License

This code is distributed under the terms and conditions of the MIT license.

Change-log

A brief summary of each NZCircularImageView release can be found on the wiki.

To-do Items

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.