title: How to place profile image on uibarbuttonitem with rounded corners in objective c?
body: <p>I want to make my UIbarbuttonItem with rounded corners (the right). <a href="https://stackoverflow.com/questions/23886528/uibarbuttonitem-with-rounded-corners-and-shadow">I referred the link to implement</a> still I'm not getting.The image comes from URL.My code is,</p>
  
  <pre><code> dispatch_async(dispatch_get_global_queue(0,0), ^{
  
   NSData * data = [[NSData alloc] initWithContentsOfURL: [NSURL   URLWithString:userImage]];
      if ( data == nil )
          return;
      dispatch_async(dispatch_get_main_queue(), ^{
          // WARNING: is the cell still using the same data by this point??
          UIImage *img = [UIImage imageWithData: data];
  
          UIImage *btnImage = [self imageWithImage:img scaledToSize:CGSizeMake(50, 50)];
          UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
          // btn.bounds = CGRectMake( 0, 0, btnImage.size.width, btnImage.size.height );
          [btn addTarget:self action:@selector(action:) forControlEvents:UIControlEventTouchDown];
          [btn setImage:btnImage forState:UIControlStateNormal];
          UIBarButtonItem *btnItem = [[UIBarButtonItem alloc] initWithCustomView:btn];
          self.navigationItem.rightBarButtonItem = btnItem;
      });
  
  });
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/yd0tv.png" alt="enter image description here">
  I need to implement the same as the image.What I' doing wrong,please anybody help me to fix this.</p>