         //------------------------------
         // AlertView Height
         reloadAlertViewHeight()
-        alertView.frame.size = CGSizeMake(alertViewWidth, alertViewHeightConstraint?.constant ?? 150)
+        alertView.frame.size = CGSize(width: alertViewWidth, height: alertViewHeightConstraint?.constant ?? 150)
     }
     
     // Reload AlertView Height
     func reloadAlertViewHeight() {
         
-        var screenSize = self.presentingViewController != nil ? self.presentingViewController!.view.bounds.size : UIScreen.mainScreen().bounds.size
-        if ((UIDevice.currentDevice().systemVersion as NSString).floatValue < 8.0) {
+        var screenSize = self.presentingViewController != nil ? self.presentingViewController!.view.bounds.size : UIScreen.main.bounds.size
+        if ((UIDevice.current.systemVersion as NSString).floatValue < 8.0) {
             if (UIInterfaceOrientationIsLandscape(currentOrientation())) {
-                screenSize = CGSizeMake(screenSize.height, screenSize.width)
+                screenSize = CGSize(width: screenSize.height, height: screenSize.width)
             }
         }
         let maxHeight = screenSize.height - keyboardHeight

        })
    }
    
    func dismissAnimateTransition(transitionContext: UIViewControllerContextTransitioning) {
        
        let alertController = transitionContext.viewControllerForKey(UITransitionContextFromViewControllerKey) as! DOAlertController
        
        UIView.animateWithDuration(self.transitionDuration(transitionContext),
                                   animations: {
                                    alertController.overlayView.alpha = 0.0
                                    if (alertController.isAlert()) {
                                        alertController.alertView.alpha = 0.0
                                        alertController.alertView.transform = CGAffineTransformMakeScale(0.9, 0.9)
                                    } else {
                                        alertController.containerView.transform = CGAffineTransformMakeTranslation(0, alertController.alertView.frame.height)
                                    }
        },
                                   completion: { finished in

        
        // TitleLabel
        if (hasTitle) {
            titleLabel.frame.size = CGSize(width: innerContentWidth, height: 0.0)
            titleLabel.numberOfLines = 0
            titleLabel.textAlignment = .center
            titleLabel.font = titleFont
            titleLabel.textColor = titleTextColor
            titleLabel.text = title
            titleLabel.sizeToFit()
            titleLabel.frame = CGRect(x: 0, y: textAreaPositionY, width: innerContentWidth, height: titleLabel.frame.height)
            textContainer.addSubview(titleLabel)
            textAreaPositionY += titleLabel.frame.height + 5.0
        }
        
        // MessageView
        if (hasMessage) {
            messageView.frame.size = CGSize(width: innerContentWidth, height: 0.0)
            messageView.numberOfLines = 0
            messageView.textAlignment = .center
            messageView.font = messageFont
            messageView.textColor = messageTextColor
            messageView.text = message
            messageView.sizeToFit()
            messageView.frame = CGRect(x: 0, y: textAreaPositionY, width: innerContentWidth, height: messageView.frame.height)
            textContainer.addSubview(messageView)
            textAreaPositionY += messageView.frame.height + 5.0
        }
