Skip to content

Commit

Permalink
[Feat] ring 색깔 변경 #37
Browse files Browse the repository at this point in the history
  • Loading branch information
HELLOHIDI committed Nov 25, 2023
1 parent 0767d0b commit c2b7a53
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ final class ActivityCardView: UIView {
//MARK: - set Properties

let progressView1 = ProgressView(frame: .init(origin: .zero, size: .init(width: 187,height: 187)))

let progressView2 = ProgressView(frame: .init(origin: .zero, size: .init(width: 145,height: 145)))

let progressView3 = ProgressView(frame: .init(origin: .zero, size: .init(width: 105,height: 105)))

let activityStackView = ActivityStackView()
private let divisionLine = UIView()
private let showDetailButton = UIButton()
Expand All @@ -27,6 +30,9 @@ final class ActivityCardView: UIView {
self.setUI()
self.setHierachy()
self.setLayout()
progressView1.ringColor = .blue1
progressView2.ringColor = .blue2
progressView3.ringColor = .blue3
}

@available(*, unavailable)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,19 @@
import UIKit

class ProgressView: UIView {
var ringColor: UIColor?
private var circleLayer = CAShapeLayer()
private var progressLayer = CAShapeLayer()
private var startPoint = CGFloat(-0.5 * Double.pi)
private var endPoint = CGFloat(1.5 * Double.pi)


override func draw(_ rect: CGRect) {
createCircularPath()
}

func createCircularPath() {
guard let ringColor else { return }
self.backgroundColor = .white
let circularPath = UIBezierPath(arcCenter: .init(
x: self.frame.width / 2.0,
Expand All @@ -43,7 +46,7 @@ class ProgressView: UIView {
progressLayer.strokeStart = 0.0
// progressLayer.strokeEnd = 0.5

progressLayer.strokeColor = UIColor.red.cgColor
progressLayer.strokeColor = ringColor.cgColor
layer.addSublayer(progressLayer)
}

Expand Down

0 comments on commit c2b7a53

Please sign in to comment.