Skip to content

Instantly share code, notes, and snippets.

@dduan
Last active August 29, 2015 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dduan/ea9f3af854033987f80a to your computer and use it in GitHub Desktop.
Save dduan/ea9f3af854033987f80a to your computer and use it in GitHub Desktop.
UIButton with border.
//
// BorderedButton.swift
//
// Created by Daniel Duan on 12/13/14.
import UIKit
class BorderedButton: UIButton {
override func willMoveToSuperview(newSuperview: UIView?) {
self.layer.borderWidth = 1.0
self.layer.cornerRadius = 2
self.layer.borderColor = self.titleColorForState(.Normal)?.CGColor
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment