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

Remove self where not necessary #446

Merged
merged 2 commits into from
Apr 12, 2017

Conversation

SD10
Copy link
Member

@SD10 SD10 commented Apr 12, 2017

Summary of Pull Request:

Remove use of self where not necessary, #445

@IBAnimatableBot
Copy link

IBAnimatableBot commented Apr 12, 2017

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

Generated by 🚫 Danger

@SD10 SD10 changed the title Remove self where not necessary Remove self where not necessary #no-public-changes Apr 12, 2017
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.

Well done @SD10

@@ -579,7 +579,7 @@ fileprivate extension Animatable where Self: UIView {
}

var screenSize: CGSize {
return self.window?.screen.bounds.size ?? CGSize.zero
return window?.screen.bounds.size ?? CGSize.zero
Copy link
Member

Choose a reason for hiding this comment

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

I think we can remove CGSize and just use .zero.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done 👍

@@ -21,14 +21,13 @@ public class FlipAnimator: NSObject, AnimatedTransitioning {
fileprivate var horizontal: Bool = false

// MARK: - Life cycle
public init(from direction: TransitionAnimationType.Direction, transitionDuration: Duration) {
public init(from direction: TransitionAnimationType.Direction, duration: Duration) {
Copy link
Member

Choose a reason for hiding this comment

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

That will introduce breaking changes. Please update the CHANGELOG.md

Copy link
Member Author

@SD10 SD10 Apr 12, 2017

Choose a reason for hiding this comment

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

Do I just need to reference this Pull Request or should I actually state the parameter name change? I updated the CHANGELOG but let me know if I should change it. I'm learning what an API breaking change is now 😃

Copy link
Member

Choose a reason for hiding this comment

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

I don't think you should add an entry for the change of self. since it's only internal changes, but you should add an entry in the API breaking change to explain the prototype change transitionDuration -> duration because that may break for the users.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok I did this plus changed the remaining 3 that were not changed as to keep the API consistent. Thank you for clarifying @tbaranes

@JakeLin
Copy link
Member

JakeLin commented Apr 12, 2017

@SD10 thanks for fixing that in no time ⚡️⚡️⚡️, you rock 🚀. And please have a look at the comment on CHANGELOG.md.

@JakeLin JakeLin changed the title Remove self where not necessary #no-public-changes Remove self where not necessary Apr 12, 2017
CHANGELOG.md Outdated
@@ -11,6 +11,8 @@ All notable changes to this project will be documented in this file.
- Replace all `SystemAnimator` classes with `SystemTransitionAnimator`
[#427](https://github.com/IBAnimatable/IBAnimatable/pull/427) by [@SD10](https://github.com/sd10)
- `PresentationDesignable` now supports `contextFrameForPresentation` which allow you to present a controller with a custom configuration over another instead of being in fullscreen. Imitates `UIModalPresentationStyle.currentContext`
- Remove the use of `self` where not necessary
Copy link
Member

@JakeLin JakeLin Apr 12, 2017

Choose a reason for hiding this comment

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

@SD10 sorry, I don't think we need to put the title as "Remove the use of self where not necessary" for breaking changes, because it doesn't make sense for the user. I meant we should specify the API changes. something like Change the initializer for PortalAnimator, NatGeoAnimator, TurnAnimator, CardsAnimator, FlipAnimator, SlideAnimator, ZoomAnimator and DropDownAnimator. Rename the parameter from transitionDuration to duration.

And please add by [@SD10](https://github.com/sd10) as well.

@tbaranes tbaranes added this to the 4.0 milestone Apr 12, 2017
CHANGELOG.md Outdated
@@ -11,6 +11,8 @@ All notable changes to this project will be documented in this file.
- Replace all `SystemAnimator` classes with `SystemTransitionAnimator`
[#427](https://github.com/IBAnimatable/IBAnimatable/pull/427) by [@SD10](https://github.com/sd10)
- `PresentationDesignable` now supports `contextFrameForPresentation` which allow you to present a controller with a custom configuration over another instead of being in fullscreen. Imitates `UIModalPresentationStyle.currentContext`
- transition Animator classes initializer parameter changed from transitionDuration -> duration
Copy link
Member

@tbaranes tbaranes Apr 12, 2017

Choose a reason for hiding this comment

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

One last point: can you uppercase the first character and credit yourself?

@SD10 SD10 merged commit a9d1b2d into IBAnimatable:master Apr 12, 2017
@tbaranes tbaranes modified the milestones: 4.x, 4.0 Apr 20, 2017
@SD10 SD10 deleted the remove-superfluous-self branch April 25, 2017 02:19
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.

4 participants