diff --git a/DOFavoriteButton/DOFavoriteButton.swift b/DOFavoriteButton/DOFavoriteButton.swift index 47e6d9d..5c77f11 100644 --- a/DOFavoriteButton/DOFavoriteButton.swift +++ b/DOFavoriteButton/DOFavoriteButton.swift @@ -128,7 +128,7 @@ open class DOFavoriteButton: UIButton { circleShape.mask = circleMask let maskPath = UIBezierPath(rect: imageFrame) - maskPath.addArc(withCenter: imgCenterPoint, radius: 0.1, startAngle: CGFloat(0.0), endAngle: CGFloat(M_PI * 2), clockwise: true) + maskPath.addArc(withCenter: imgCenterPoint, radius: 0.1, startAngle: CGFloat(0.0), endAngle: CGFloat(Double.pi * 2), clockwise: true) circleMask.path = maskPath.cgPath //=============== @@ -155,7 +155,7 @@ open class DOFavoriteButton: UIButton { line.strokeStart = 0.0 line.strokeEnd = 0.0 line.opacity = 0.0 - line.transform = CATransform3DMakeRotation(CGFloat(M_PI) / 5 * (CGFloat(i) * 2 + 1), 0.0, 0.0, 1.0) + line.transform = CATransform3DMakeRotation(CGFloat(Double.pi) / 5 * (CGFloat(i) * 2 + 1), 0.0, 0.0, 1.0) self.layer.addSublayer(line) lines.append(line) } @@ -345,19 +345,19 @@ open class DOFavoriteButton: UIButton { self.addTarget(self, action: #selector(DOFavoriteButton.touchCancel(_:)), for: UIControlEvents.touchCancel) } - func touchDown(_ sender: DOFavoriteButton) { + @objc func touchDown(_ sender: DOFavoriteButton) { self.layer.opacity = 0.4 } - func touchUpInside(_ sender: DOFavoriteButton) { + @objc func touchUpInside(_ sender: DOFavoriteButton) { self.layer.opacity = 1.0 } - func touchDragExit(_ sender: DOFavoriteButton) { + @objc func touchDragExit(_ sender: DOFavoriteButton) { self.layer.opacity = 1.0 } - func touchDragEnter(_ sender: DOFavoriteButton) { + @objc func touchDragEnter(_ sender: DOFavoriteButton) { self.layer.opacity = 0.4 } - func touchCancel(_ sender: DOFavoriteButton) { + @objc func touchCancel(_ sender: DOFavoriteButton) { self.layer.opacity = 1.0 }