Skip to content

Commit 6ec6a5d

Browse files
committed
feat: ✨ AddIssueButton 구현 (#27)
1 parent 5c87910 commit 6ec6a5d

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
//
2+
// AddIssueButton.swift
3+
// issue-tracker
4+
//
5+
// Created by 양준혁 on 2021/06/11.
6+
//
7+
8+
import UIKit
9+
10+
class AddIssueButton: UIView {
11+
12+
override init(frame: CGRect) {
13+
super.init(frame: frame)
14+
setButton()
15+
}
16+
17+
required init?(coder: NSCoder) {
18+
super.init(coder: coder)
19+
}
20+
21+
override func draw(_ rect: CGRect) {
22+
let path = UIBezierPath()
23+
24+
path.move(to: CGPoint(x: self.bounds.width * 0.25, y: self.bounds.height * 0.5))
25+
path.addLine(to: CGPoint(x: self.bounds.width * 0.75, y: self.bounds.height * 0.5))
26+
path.move(to: CGPoint(x: self.bounds.width * 0.5, y: self.bounds.height * 0.25))
27+
path.addLine(to: CGPoint(x: self.bounds.width * 0.5, y: self.bounds.height * 0.75))
28+
UIColor.white.set()
29+
path.stroke()
30+
}
31+
32+
func setButton() {
33+
clipsToBounds = true
34+
layer.cornerRadius = self.bounds.size.width * 0.5
35+
backgroundColor = .systemBlue
36+
37+
}
38+
}

0 commit comments

Comments
 (0)