Skip to content
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

Merged
merged 2 commits into from
Oct 19, 2017

Conversation

phimage
Copy link
Member

@phimage phimage commented Oct 18, 2017

4 new mask types (idea from #482 )

@phimage phimage mentioned this pull request Oct 18, 2017
7 tasks
Copy link
Member

@JakeLin JakeLin left a 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
Copy link
Member

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.

Copy link
Member Author

@phimage phimage Oct 18, 2017

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))
}

Copy link
Member

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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool

@IBAnimatableBot
Copy link

IBAnimatableBot commented Oct 18, 2017

1 Warning
⚠️ Consider adding supporting documentation to this change. Documentation can be found in the docs directory.

Generated by 🚫 Danger

@phimage
Copy link
Member Author

phimage commented Oct 18, 2017

I am wondering why I did not see all this swiftlint warning in Xcode?
I have not problem with my other project (but the configuration file is in same path)

$ which swiftlint
/usr/local/bin/swiftlint

$ swiftlint version
0.23.1

@tbaranes
Copy link
Member

Is the IBAnimatable's swiftlint script is still here and valid? Otherwise, don't see why 🤔

@phimage
Copy link
Member Author

phimage commented Oct 18, 2017

to make it working in my local repo I add to the swiflint conf file

included:
    - ../Sources

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 --path $SRCROOT/../Source in run script build phase and that also working

@phimage phimage merged commit ca5c78d into IBAnimatable:master Oct 19, 2017
@phimage phimage deleted the feature/masks branch October 20, 2017 05:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants