         }
         var textColor = self.darkTextColor
         
-        let sz = UIScreen.mainScreen().bounds.size
+        let sz = self.screenSize()
         self.viewWidth = sz.width
         self.viewHeight = sz.height
+        
+        self.view.frame.size = sz
         
         // Container for the entire alert modal contents
         self.containerView = UIView()

        self.view.removeFromSuperview()
    }
    
}



        UIView.animateWithDuration(0.2, animations: {
            self.view.alpha = 1
        })
        self.containerView.frame.origin.x = self.view.center.x
        self.containerView.center.y = -500
        UIView.animateWithDuration(0.5, delay: 0.05, usingSpringWithDamping: 0.8, initialSpringVelocity: 0.5, options: nil, animations: {
            self.containerView.center = self.view.center
            }, completion: { finished in
                
        })
