From cc1e5e8304d0469b382295f4c1a1e29d54589037 Mon Sep 17 00:00:00 2001 From: xxxAIRINxxx Date: Thu, 17 Sep 2015 12:07:34 +0900 Subject: [PATCH] convert swift2.0 --- ARNTransitionAnimator.swift | 16 ++++++++-------- README.md | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/ARNTransitionAnimator.swift b/ARNTransitionAnimator.swift index 8d89c42..016ef31 100644 --- a/ARNTransitionAnimator.swift +++ b/ARNTransitionAnimator.swift @@ -313,7 +313,7 @@ public class ARNTransitionAnimator: UIPercentDrivenInteractiveTransition { extension ARNTransitionAnimator: UIViewControllerAnimatedTransitioning { - public func transitionDuration(transitionContext: UIViewControllerContextTransitioning) -> NSTimeInterval { + public func transitionDuration(transitionContext: UIViewControllerContextTransitioning?) -> NSTimeInterval { return self.transitionDuration } @@ -321,11 +321,11 @@ extension ARNTransitionAnimator: UIViewControllerAnimatedTransitioning { let containerView = transitionContext.containerView() self.transitionContext = transitionContext - self.fireBeforeHandler(containerView, transitionContext: transitionContext) + self.fireBeforeHandler(containerView!, transitionContext: transitionContext) self.animateWithDuration( self.transitionDuration(transitionContext), - containerView: containerView, + containerView: containerView!, completeTransition: true) { transitionContext.completeTransition(!transitionContext.transitionWasCancelled()) } @@ -369,7 +369,7 @@ extension ARNTransitionAnimator: UIViewControllerTransitioningDelegate { // MARK: UIViewControllerInteractiveTransitioning -extension ARNTransitionAnimator: UIViewControllerInteractiveTransitioning { +extension ARNTransitionAnimator { public override func startInteractiveTransition(transitionContext: UIViewControllerContextTransitioning) { let containerView = transitionContext.containerView() @@ -385,7 +385,7 @@ extension ARNTransitionAnimator: UIViewControllerInteractiveTransitioning { } self.transitionContext = transitionContext - self.fireBeforeHandler(containerView, transitionContext: transitionContext) + self.fireBeforeHandler(containerView!, transitionContext: transitionContext) } } @@ -397,7 +397,7 @@ extension ARNTransitionAnimator { super.updateInteractiveTransition(percentComplete) if let transitionContext = self.transitionContext { let containerView = transitionContext.containerView() - self.fireAnimationHandler(containerView, percentComplete: percentComplete) + self.fireAnimationHandler(containerView!, percentComplete: percentComplete) } } @@ -407,7 +407,7 @@ extension ARNTransitionAnimator { let containerView = transitionContext.containerView() self.animateWithDuration( self.transitionDuration(transitionContext), - containerView: containerView, + containerView: containerView!, completeTransition: true) { transitionContext.completeTransition(true) } @@ -420,7 +420,7 @@ extension ARNTransitionAnimator { let containerView = transitionContext.containerView() self.animateWithDuration( self.transitionDuration(transitionContext), - containerView: containerView, + containerView: containerView!, completeTransition: false) { transitionContext.completeTransition(false) } diff --git a/README.md b/README.md index 7d65a13..7c29e26 100644 --- a/README.md +++ b/README.md @@ -2,14 +2,14 @@ [![Language: Swift](https://img.shields.io/badge/lang-Swift-yellow.svg?style=flat)](https://developer.apple.com/swift/) -Custom transition & interactive transition animator for iOS written in Swift. +Custom transition & interactive transition animator for iOS. written in Swift. ## Requirements -* Xcode 6.4 -* iOS 7.1+ -* Swift 1.2 +* Xcode 7.0 +* iOS 8.1+ +* Swift 2.0 ## Use Example