 		super.init(nibName:nibNameOrNil, bundle:nibBundleOrNil)
 	}
 	
-	override func viewDidLayoutSubviews() {
-		println("Layout Subviews Called")
+	override func viewWillLayoutSubviews() {
 		super.viewWillLayoutSubviews()
-		let sz = UIScreen.mainScreen().bounds.size
+		var sz = UIScreen.mainScreen().bounds.size
+		let sver = UIDevice.currentDevice().systemVersion as NSString
+		let ver = sver.floatValue
+		if ver < 8.0 {
+			// iOS versions before 7.0 did not switch the width and height on device roration
+			if UIInterfaceOrientationIsLandscape(UIApplication.sharedApplication().statusBarOrientation) {
+				let ssz = sz
+				sz = CGSize(width:ssz.height, height:ssz.width)
+			}
+		}
+		// Set background frame
+		shadowView.frame.size = sz
 		// Set frames
 		var r:CGRect
 		if view.superview != nil {

        viewText.textAlignment = .Center
        viewText.font = UIFont(name: kDefaultFont, size: 14)
        // Shadow View
        shadowView = UIView(frame: UIScreen.mainScreen().bounds)
		shadowView.setTranslatesAutoresizingMaskIntoConstraints(false)
        shadowView.backgroundColor = UIColor.blackColor()
        // Colours
        contentView.backgroundColor = UIColorFromRGB(0xFFFFFF)

        rootViewController = vc
		// Add subviews
		rootViewController.addChildViewController(self)
		shadowView.frame = vc.view.bounds
        rootViewController.view.addSubview(shadowView)
        rootViewController.view.addSubview(view)
		
        // Alert colour/icon
        var viewColor = UIColor()
