0
class SwiftyRecordButton: SwiftyCamButton {

    private var circleBorder: CALayer!
    private var innerCircle: UIView!

    override init(frame: CGRect) {
        super.init(frame: frame)
        drawButton()
    }

    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
        drawButton()
    }

    private func drawButton() {
        self.backgroundColor = UIColor.white
        circleBorder = CALayer()
        circleBorder.backgroundColor = UIColor.red.cgColor
        circleBorder.borderWidth = 6.0
        circleBorder.borderColor = UIColor.blue.cgColor
        circleBorder.bounds = self.bounds
        circleBorder.position = CGPoint(x: self.bounds.midX, y: self.bounds.midY)
        circleBorder.cornerRadius = self.frame.size.width / 2
        layer.insertSublayer(circleBorder, at: 0)
    }
}

Im having an issue with the rendering of this button. It is somewhat of a special button that I use in place of the standard one that comes from swifty cams library. The issue comes with the drawButton function. Even though I clearly called it I can't see the snapchat style button with a border that should exist there. Can anyone see where I went wrong?

Bo Jackson
  • 345
  • 1
  • 5
  • 17

0 Answers0