//circle
self.profileImageView.layer.cornerRadius = self.profileImageView.frame.size.width / 2;
self.profileImageView.clipsToBounds = YES;
//border
self.profileImageView.layer.borderWidth = 3.0f;
self.profileImageView.layer.borderColor = [UIColor whiteColor].CGColor;
UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapDetected)];
singleTap.numberOfTapsRequired = 1;
self.imageView.userInteractionEnabled = YES;
[self.imageView addGestureRecognizer:singleTap];
NSURL *imageURL = [NSURL URLWithString:@"http://best-posts.com/wp-content/uploads/2014/07/hottest_world_cup_girls_07.jpg"];
// download the image asynchronously
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:imageURL];
[NSURLConnection sendAsynchronousRequest:request
queue:[NSOperationQueue mainQueue]
completionHandler:^(NSURLResponse *response, NSData *data, NSError *error) {
if ( !error )
{
UIImage *image = [[UIImage alloc] initWithData:data];
[cell.profileImage setImage:image];
} else {
NSLog(@"%@", error);
}
}];
currently I am using SDWebImage