I've been following a tutorial online about creating custom animations. So for making the custom animations, I created a class name Transition Manager of type NSObject. I'm facing two problems,
1) So when further defining the class as,
class TransitionManager: NSObject, UIViewControllerAnimatedTransitioning,
UIViewControllerTransitioningDelegate
{
//Further Code
}
I get a compile time error,
Type 'TransitionManager' does not conform to protocol
'UIViewControllerAnimatedTransitioning'
and
Protocol requires function 'transitionDuration' with type
'(UIViewControllerContextTransitioning) -> NSTimeInterval'
Here is the 'transitionDuration' function:
// return how many seconds the transition animation will take
func transitionDuration(transitionContext: UIViewControllerContextTransitioning) -> NSTimeInterval
{
return 0.5
}
2) Another compile time error pops up, at the following line:
// get the duration of the animation
let duration = self.transitionDuration(transitionContext)
Error:
'TransitionManager' does not have a member named 'transitionDuration'
Here is the complete TransitionManager.swift: http://pastebin.com/LkLym5Ci