title: Create custom rounded rectangle button corner on top-left?
body: <p>I have a custom button that I want to make top-left border of it look like normal round rectangle.</p>
  
  <p>I found code that makes all corners round:</p>
  
  <pre><code>_myButton.layer.cornerRadius = 8;
  _myButton.layer.borderWidth = 0.5;
  _myButton.layer.borderColor = [UIColor grayColor].CGColor;
  _myButton.clipsToBounds = YES;
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/O1k7J.png" alt="enter image description here"></p>
  
  <p>How can I fix the code to make it round just in the top-left side?</p>
  
  <hr>
  
  <p>Edit:</p>
  
  <pre><code>_myButton.layer.borderWidth = 2;
  _myButton.layer.borderColor = [UIColor blackColor].CGColor;
  
  UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:_myButton.bounds
                                                      byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight
                                                          cornerRadii:CGSizeMake(7.0, 7.0)];
  
  CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
  
  maskLayer.frame = _myButton.bounds;
  maskLayer.path = maskPath.CGPath;
  _myButton.layer.mask = maskLayer;
  [maskLayer release];
  </code></pre>
  
  <p>This code does not work. The whole button disappears.</p>