Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 59 lines (42 sloc) 1.76 KB
//
// Created by Pete Callaway on 26/06/2014.
// Copyright (c) 2014 Dative Studios. All rights reserved.
//
import UIKit
class MessageViewController: UIViewController, UIViewControllerTransitioningDelegate {
required init(coder aDecoder: NSCoder!) {
super.init(coder: aDecoder)
self.commonInit()
}
override init(nibName nibNameOrNil: String!, bundle nibBundleOrNil: NSBundle!) {
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
self.commonInit()
}
func commonInit() {
self.modalPresentationStyle = .Custom
self.transitioningDelegate = self
}
// ---- UIViewControllerTransitioningDelegate methods
func presentationControllerForPresentedViewController(presented: UIViewController!, presentingViewController presenting: UIViewController!, sourceViewController source: UIViewController!) -> UIPresentationController! {
if presented == self {
return CustomPresentationController(presentedViewController: presented, presentingViewController: presenting)
}
return nil
}
func animationControllerForPresentedController(presented: UIViewController!, presentingController presenting: UIViewController!, sourceController source: UIViewController!) -> UIViewControllerAnimatedTransitioning! {
if presented == self {
return CustomPresentationAnimationController(isPresenting: true)
}
else {
return nil
}
}
func animationControllerForDismissedController(dismissed: UIViewController!) -> UIViewControllerAnimatedTransitioning! {
if dismissed == self {
return CustomPresentationAnimationController(isPresenting: false)
}
else {
return nil
}
}
}