         contentView.layer.borderColor = UIColorFromRGB(0xCCCCCC).CGColor
     }
 	
-	override init(frame: CGRect) {
-		super.init(frame:frame)
-	}
-	
-	override func layoutSubviews() {
+	override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?) {
+		super.init(nibName:nibNameOrNil, bundle:nibBundleOrNil)
+	}
+	
+	override func viewDidLayoutSubviews() {
 		println("Layout Subviews Called")
-		super.layoutSubviews()
+		super.viewWillLayoutSubviews()
 		let sz = UIScreen.mainScreen().bounds.size
 		// Set frames
-		frame = CGRect(x:(sz.width-kWindowWidth)/2, y:-kWindowHeight, width: kWindowWidth, height: kWindowHeight)
+		var r:CGRect
+		if view.superview != nil {
+			// View is showing, position at center of screen
+			r = CGRect(x:(sz.width-kWindowWidth)/2, y:(sz.height-kWindowHeight)/2, width: kWindowWidth, height: kWindowHeight)
+		} else {
+			// View is not visible, position outside screen bounds
+			r = CGRect(x:(sz.width-kWindowWidth)/2, y:-kWindowHeight, width: kWindowWidth, height: kWindowHeight)
+		}
+		view.frame = r
 		contentView.frame = CGRect(x: 0, y: kCircleHeight / 4, width: kWindowWidth, height: kWindowHeight)
 		circleViewBackground.frame = CGRect(x: kWindowWidth / 2 - kCircleHeightBackground / 2, y: kCircleBackgroundTopPosition, width: kCircleHeightBackground, height: kCircleHeightBackground)
 		circleViewBackground.layer.cornerRadius = circleViewBackground.frame.size.height / 2

}

// The Main Class
class SCLAlertView: UIView {
    let kDefaultShadowOpacity: CGFloat = 0.7
    let kCircleHeight: CGFloat = 56.0
    let kCircleTopPosition: CGFloat = -12.0

    
    required override init() {
		super.init()
		// Add Subvies
		view.addSubview(contentView)
		view.addSubview(circleViewBackground)
		view.addSubview(circleView)
		circleView.addSubview(circleIconImageView)
		contentView.addSubview(labelTitle)
		contentView.addSubview(viewText)
