New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Annoying animation with custom shapes #4
Comments
Hi, I updated the project to try something. class ReloadDynamicButton: DynamicButtonStyle {
convenience required init(center: CGPoint, size: CGFloat, offset: CGPoint, lineWidth: CGFloat) {
let curveBezierPath = UIBezierPath(arcCenter: center, radius: size / 2 - lineWidth, startAngle: 0, endAngle: CGFloat((3 * M_PI) / 2), clockwise: true)
let path = curveBezierPath.CGPath
let thirdSize = size / 6
let sixthSize = size / 12
let path1 = CGPathCreateMutable()
CGPathMoveToPoint(path1, nil, center.x, center.x - size / 2 + lineWidth)
CGPathAddLineToPoint(path1, nil, center.x - sixthSize, center.x - size / 2 + lineWidth - thirdSize)
let path2 = CGPathCreateMutable()
CGPathMoveToPoint(path2, nil, center.x, center.x - size / 2 + lineWidth)
CGPathAddLineToPoint(path2, nil, center.x - sixthSize, center.x - size / 2 + lineWidth + thirdSize)
self.init(path1: path1, path2: path2, path3: path, path4: path)
}
} Is this code works better? |
Awesome ! Thanks alot |
No prob. The Moreover this portion of code is wrong: let path2 = CGPathCreateMutable()
CGPathMoveToPoint(path1, nil, offset.x + a.x, offsetFromCenter.y + a.y)
CGPathAddLineToPoint(path1, nil, offset.x + c.x, offsetFromCenter.y + c.y) You use the Thank you, I'll add it to the library, it's a good idea. 👍 |
Here is the code for reload icon.
The text was updated successfully, but these errors were encountered: