Skip to content

Commit

Permalink
Merge pull request #11 from aashishdhawan/code-refactor
Browse files Browse the repository at this point in the history
Code Refactor: remove overused self
  • Loading branch information
RuiAAPeres committed Jan 23, 2016
2 parents c7405e4 + 71bbf88 commit 462fd4c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ class ImageViewerDismissTransition: NSObject, UIViewControllerAnimatedTransition
// MARK: - UIViewControllerAnimatedTransitioning

func transitionDuration(transitionContext: UIViewControllerContextTransitioning?) -> NSTimeInterval {
return self.duration
return duration
}

func animateTransition(transitionContext: UIViewControllerContextTransitioning) {
let fromViewController = transitionContext.viewControllerForKey(UITransitionContextFromViewControllerKey)!

if let imageViewer = fromViewController as? ImageViewer {
imageViewer.closeAnimation(self.duration, completion: {(finished) -> Void in
imageViewer.closeAnimation(duration, completion: {(finished) -> Void in
transitionContext.completeTransition(finished)
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class ImageViewerPresentTransition: NSObject, UIViewControllerAnimatedTransition
// MARK: - UIViewControllerAnimatedTransitioning

func transitionDuration(transitionContext: UIViewControllerContextTransitioning?) -> NSTimeInterval {
return self.duration
return duration
}

func animateTransition(transitionContext: UIViewControllerContextTransitioning) {
Expand All @@ -30,7 +30,7 @@ class ImageViewerPresentTransition: NSObject, UIViewControllerAnimatedTransition
container?.addSubview(toViewController.view)

if let imageViewer = toViewController as? ImageViewer {
imageViewer.showAnimation(self.duration, completion: {(finished) -> Void in
imageViewer.showAnimation(duration, completion: {(finished) -> Void in
transitionContext.completeTransition(finished)
})
}
Expand Down

0 comments on commit 462fd4c

Please sign in to comment.