Latest 0.0.6
Homepage https://github.com/iblacksun/NZCircularImageView
License MIT
Platforms ios 8.0, requires ARC
Dependencies SDWebImage
Authors

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:

  • Foundation.framework
  • QuartzCore.framework
  • UIKit.framework

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.

  • Add a pod entry for NZCircularImageView to your Podfile pod 'NZCircularImageView'
  • Install the pod(s) by running pod install.

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.

  • Setting at Storyboard to automatic rounded image

NZCircularImageView

  • Setting a rounded avatar image
circularImageView.image = [UIImage imageNamed:@"Default-Avatar"];
  • Async download image
// 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.

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

Latest podspec

{
    "name": "IBCircularImageView",
    "version": "0.0.6",
    "license": "MIT",
    "summary": "Performs async download image and leaves with rounded edge, used for presenting pictures of user profiles.",
    "homepage": "https://github.com/iblacksun/NZCircularImageView",
    "requires_arc": true,
    "platforms": {
        "ios": "8.0"
    },
    "authors": {
        "Bruno Tortato Furtado": "[email protected]"
    },
    "dependencies": {
        "SDWebImage": [
            "~> 3.7.5"
        ]
    },
    "ios": {
        "frameworks": "QuartzCore"
    },
    "source_files": "NZCircularImageView/*.{h,m}",
    "source": {
        "git": "https://github.com/iblacksun/NZCircularImageView.git",
        "tag": "0.0.6"
    }
}

Pin It on Pinterest

Share This