-1
import Foundation
import UIKit

enum TransitionType {
   case Presenting, Dismissing
}

class AnimationController: NSObject, UIViewControllerAnimatedTransitioning {
   var duration: NSTimeInterval
   var isPresenting: Bool
   var originFrame: CGRect

   init(withDuration duration: NSTimeInterval, forTransitionType type: TransitionType, originFrame: CGRect) {
      self.duration = duration
      self.isPresenting = type == .Presenting
      self.originFrame = originFrame

      super.init()
   }

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

The code was adapted from the below tutorial:

Victor Sigler
  • 23,243
  • 14
  • 88
  • 105
teamiOS
  • 11
  • 5
  • Always is a good tip make Command+Click inside the delegate and see what function are mandatory for the protocol, not marked as `optional` and see what's missing – Victor Sigler Jan 29 '16 at 22:46

1 Answers1

1

It's what the error says. The code hasn't fully adopted the UIViewControllerAnimatedTransitioning protocol. You need to implement public func animateTransition(transitionContext: UIViewControllerContextTransitioning), which happens in the next block of code in the article you linked to.

JWK
  • 3,345
  • 2
  • 19
  • 27