     }
     
     open func fadeInAnimation(_ dialogView: UIView, sourceView: UIView, overlayView: UIView) {
-        let sourceSize: CGSize = sourceView.bounds.size
-        let dialogSize: CGSize = dialogView.bounds.size
+        let sourceSize = sourceView.bounds.size
+        let dialogSize = dialogView.bounds.size
         dialogView.frame = CGRect(x: (sourceSize.width - dialogSize.width) / 2,
                                   y: (sourceSize.height - dialogSize.height) / 2,
                                   width: dialogSize.width,

    }
    
    open func slideInAnimation(_ dialogView: UIView, sourceView: UIView, overlayView: UIView, animationPattern: LSAnimationPattern) {
        
        let sourceSize: CGSize = sourceView.bounds.size
        let dialogSize: CGSize = dialogView.bounds.size
        var dialogStartRect:CGRect
        
        switch animationPattern {
        case .slideBottomTop, .slideBottomBottom:
            dialogStartRect = CGRect(x: (sourceSize.width - dialogSize.width) / 2, y: sourceSize.height, width: dialogSize.width, height: dialogSize.height)
        case .slideLeftLeft, .slideLeftRight:
            dialogStartRect = CGRect(x: -sourceSize.width, y: (sourceSize.height - dialogSize.height) / 2, width: dialogSize.width, height: dialogSize.height)
        case .slideTopTop, .slideTopBottom:
            dialogStartRect = CGRect(x: (sourceSize.width - dialogSize.width) / 2, y: -sourceSize.height, width: dialogSize.width, height: dialogSize.height)
        default:
            dialogStartRect = CGRect(x: sourceSize.width, y: (sourceSize.height - dialogSize.height) / 2, width: dialogSize.width, height: dialogSize.height)
        }
        
        let dialogEndRect:CGRect = CGRect(x: (sourceSize.width - dialogSize.width)/2, y: (sourceSize.height - dialogSize.height)/2, width: dialogSize.width, height: dialogSize.height)
        dialogView.frame = dialogStartRect
        dialogView.alpha = 1.0
        UIView.animate(withDuration: animationDuration, animations: { () -> Void in
            self.parentViewController?.ls_dialogViewController?.viewWillAppear(false)
            self.parentViewController?.ls_dialogBackgroundView?.alpha = 1.0
            dialogView.frame = dialogEndRect
            }, completion: { (finished) -> Void in
                self.parentViewController?.ls_dialogViewController?.viewDidAppear(false)
        })
    }
    
    open func slideOutAnimation(_ dialogView: UIView, sourceView: UIView, overlayView: UIView, animationPattern: LSAnimationPattern) {
        
        let sourceSize: CGSize = sourceView.bounds.size
        let dialogSize: CGSize = dialogView.bounds.size
        var dialogEndRect: CGRect
        
        switch animationPattern {
        case .slideBottomTop, .slideTopTop:
            dialogEndRect = CGRect(x: (sourceSize.width - dialogSize.width) / 2, y: -dialogSize.height, width: dialogSize.width, height: dialogSize.height)
        case .slideBottomBottom, .slideTopBottom:
            dialogEndRect = CGRect(x: (sourceSize.width - dialogSize.width)/2, y: dialogSize.height, width: dialogSize.width, height: dialogSize.height)
        case .slideLeftRight, .slideRightRight:
            dialogEndRect = CGRect(x: sourceSize.width, y: dialogView.frame.origin.y, width: dialogSize.width, height: dialogSize.height)
        default:
            dialogEndRect = CGRect(x: -dialogSize.width, y: dialogView.frame.origin.y, width: dialogSize.width, height: dialogSize.height)

    }
    
    open func zoomInAnimation(_ dialogView: UIView, sourceView: UIView, overlayView: UIView) {
        let sourceSize = sourceView.bounds.size
        let dialogSize = dialogView.bounds.size
        dialogView.frame = CGRect(x: (sourceSize.width - dialogSize.width) / 2,
                                  y: (sourceSize.height - dialogSize.height) / 2,
                                  width: dialogSize.width,
