Skip to content

Instantly share code, notes, and snippets.

@ha1f
Created March 26, 2019 10:01
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 ha1f/c5c28579d94e7de0a7319c7e5fb4dc04 to your computer and use it in GitHub Desktop.
Save ha1f/c5c28579d94e7de0a7319c7e5fb4dc04 to your computer and use it in GitHub Desktop.
//
// 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