Skip to content

Commit

Permalink
convert swift2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
xxxAIRINxxx committed Sep 17, 2015
1 parent 02bff51 commit cc1e5e8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
16 changes: 8 additions & 8 deletions ARNTransitionAnimator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -313,19 +313,19 @@ public class ARNTransitionAnimator: UIPercentDrivenInteractiveTransition {

extension ARNTransitionAnimator: UIViewControllerAnimatedTransitioning {

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

public func animateTransition(transitionContext: UIViewControllerContextTransitioning) {
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())
}
Expand Down Expand Up @@ -369,7 +369,7 @@ extension ARNTransitionAnimator: UIViewControllerTransitioningDelegate {

// MARK: UIViewControllerInteractiveTransitioning

extension ARNTransitionAnimator: UIViewControllerInteractiveTransitioning {
extension ARNTransitionAnimator {

public override func startInteractiveTransition(transitionContext: UIViewControllerContextTransitioning) {
let containerView = transitionContext.containerView()
Expand All @@ -385,7 +385,7 @@ extension ARNTransitionAnimator: UIViewControllerInteractiveTransitioning {
}

self.transitionContext = transitionContext
self.fireBeforeHandler(containerView, transitionContext: transitionContext)
self.fireBeforeHandler(containerView!, transitionContext: transitionContext)
}
}

Expand All @@ -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)
}
}

Expand All @@ -407,7 +407,7 @@ extension ARNTransitionAnimator {
let containerView = transitionContext.containerView()
self.animateWithDuration(
self.transitionDuration(transitionContext),
containerView: containerView,
containerView: containerView!,
completeTransition: true) {
transitionContext.completeTransition(true)
}
Expand All @@ -420,7 +420,7 @@ extension ARNTransitionAnimator {
let containerView = transitionContext.containerView()
self.animateWithDuration(
self.transitionDuration(transitionContext),
containerView: containerView,
containerView: containerView!,
completeTransition: false) {
transitionContext.completeTransition(false)
}
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit cc1e5e8

Please sign in to comment.