-
Notifications
You must be signed in to change notification settings - Fork 780
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
Add new mask types: hear, ring, gear and superEllipse #518
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please update the CHANGELOG.md as well?
let center = CGPoint(x: bounds.midX, y: bounds.midY) | ||
let diameter = ceil(min(bounds.width, bounds.height)) | ||
let innerRadius = max(1, diameter / 2 - radius) | ||
let outerRadius = diameter / 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may be able to encapsulate these four lines into a method because they are same as line 231.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You want something like this ?
let (center, diameter, innerRadius, outerRadius) = bounds.ringParameters(radius)
I can make CGRect extension
like
var center: CGPoint { // I do not know why this do not exist already in CoreGraphic
return CGPoint(x: self.midX, y: self.midY)
}
var diameter: CGFloat {
return ceil(min(self.width, self.height))
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer to have extensions. They look better to me.
} | ||
|
||
private extension UIBezierPath { | ||
func point(from angle: CGFloat, radius: CGFloat, offset: CGPoint) -> CGPoint { | ||
return CGPoint(x: radius * cos(angle) + offset.x, y: radius * sin(angle) + offset.y) | ||
} | ||
} | ||
|
||
extension CGFloat { | ||
static let 𝑒 = CGFloat(M_E) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool
Generated by 🚫 Danger |
I am wondering why I did not see all this swiftlint warning in Xcode? $ which swiftlint
/usr/local/bin/swiftlint
$ swiftlint version
0.23.1
|
Is the IBAnimatable's swiftlint script is still here and valid? Otherwise, don't see why 🤔 |
to make it working in my local repo I add to the swiflint conf file
So I fix the issue (and see that there is a lot of warnings in activity indicators classes) ps: I know that the conf file is shared with other project and targets, so my 'edit' will not work for them. So I keep it in my local repo I add |
4 new mask types (idea from #482 )