title: Round corner Gradient UIButton iOS
body: <p>Hi I would like to create a button similar to (attached) image. </p>
  
  <p><a href="https://i.stack.imgur.com/O09xW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/O09xW.png" alt="enter image description here"></a></p>
  
  <p>challenge here is round corner with gradient color. I was able to create round corner using</p>
  
  <p>view.layer setCornerRadius:radius;
  view.layer setMasksToBounds:YES;</p>
  
  <p>I am also able to create single border color </p>
  
  <p>view.layer.borderColor = color.CGColor;
   view.layer.borderWidth = width;</p>
  
  <p>But what need to be done for gradient border color?</p>
  
  <p>I did following but it is not as desired. I followed this post but it does not provide me gradient border color. 
  <a href="https://stackoverflow.com/questions/5971073/uibutton-w-gradient-rounded-corners-border-and-drop-shadow">UIButton w/ gradient, rounded corners, border, and drop shadow</a></p>
  
  <p>Can anyone help me understand, how can i draw gradient border for UIButton. Pseudo code/Example will be very helpful.</p>