Skip to content

Instantly share code, notes, and snippets.

import UIKit
class BaseImageView: UIView{
var roundedShape = CAShapeLayer()
var curvedPath: UIBezierPath!
var shapeColor: UIColor!
var circular: Bool!
var shadow: Bool!
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
let button = CustomButton()
self.view.addSubview(button)
button.translatesAutoresizingMaskIntoConstraints = false
button.topAnchor.constraint(equalTo: self.view.topAnchor, constant: 50).isActive = true
button.leftAnchor.constraint(equalTo: self.view.leftAnchor, constant: 20).isActive = true
button.setTitle("Click Here", for: .normal)
button.setTitleColor(.black, for: .normal)