Created
February 27, 2015 00:42
-
-
Save thinkclay/254be40311f38dc113a2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
class ViewController: UIViewController { | |
@IBOutlet weak var buttonWithBorderLeft: UIButton! | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
// Do any additional setup after loading the view, typically from a nib. | |
// FYI: In storyboard, I explicetly set the height to 30 points | |
buttonWithBorderLeft.setTitle("Meow", forState: .Normal) | |
let path = UIBezierPath() | |
path.moveToPoint(CGPoint(x: 0, y: 0)) | |
path.addLineToPoint(CGPoint(x: 0, y: 30)) | |
let shapeLayer = CAShapeLayer() | |
shapeLayer.path = path.CGPath | |
shapeLayer.lineWidth = 3.0 | |
shapeLayer.strokeColor = UIColor.grayColor().CGColor | |
shapeLayer.fillColor = UIColor.grayColor().CGColor | |
buttonWithBorderLeft.layer.addSublayer(shapeLayer) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment