Created
March 26, 2019 10:01
-
-
Save ha1f/c5c28579d94e7de0a7319c7e5fb4dc04 to your computer and use it in GitHub Desktop.
This file contains 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
// | |
// CircleView.swift | |
// | |
// Created by ha1f on 2019/02/27. | |
// Copyright © 2019年 ha1f. All rights reserved. | |
// | |
import UIKit | |
/// I guess this is faster than using cornerRadius. | |
final class CircleView: UIView { | |
let circleColor = UIColor.white | |
override init(frame: CGRect) { | |
super.init(frame: frame) | |
backgroundColor = .clear | |
} | |
required init?(coder aDecoder: NSCoder) { | |
super.init(coder: aDecoder) | |
backgroundColor = .clear | |
} | |
override func draw(_ rect: CGRect) { | |
circleColor.setFill() | |
let path = UIBezierPath(ovalIn: rect) | |
path.fill() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment