 			btn.frame = CGRect(x:12, y:y, width:kWindowWidth - 24, height:35)
 			btn.layer.cornerRadius = 3
 			y += 45.0
+		}
+	}
+	
+	override func touchesEnded(touches:NSSet, withEvent event:UIEvent) {
+		if event.touchesForView(view)?.count > 0 {
+			view.endEditing(true)
 		}
 	}
 	

	}
}

// The Main Class
class SCLAlertView: UIViewController {
    let kDefaultShadowOpacity: CGFloat = 0.7
    let kCircleHeight: CGFloat = 56.0
    let kCircleTopPosition: CGFloat = -12.0
    let kCircleBackgroundTopPosition: CGFloat = -15.0
    let kCircleHeightBackground: CGFloat = 62.0
    let kCircleIconHeight: CGFloat = 20.0
    let kWindowWidth: CGFloat = 240.0
    var kWindowHeight: CGFloat = 178.0
	var kTextHeight: CGFloat = 90.0

			}
		}
		// Set background frame
		view.frame.size = sz
		// Set frames
		var x = (sz.width - kWindowWidth) / 2
		var y = (sz.height - kWindowHeight -  (kCircleHeight / 8)) / 2
		contentView.frame = CGRect(x:x, y:y, width:kWindowWidth, height:kWindowHeight)
		y -= kCircleHeightBackground * 0.6
		x = (sz.width - kCircleHeightBackground) / 2
		circleBG.frame = CGRect(x:x, y:y, width:kCircleHeightBackground, height:kCircleHeightBackground)
		// Subtitle
		y = kTitleTop + kTitleHeight
		viewText.frame = CGRect(x:12, y:y, width: kWindowWidth - 24, height:kTextHeight)
		// Text fields
		y += kTextHeight + 14.0
		for txt in inputs {
			txt.frame = CGRect(x:12, y:y, width:kWindowWidth - 24, height:30)
			txt.layer.cornerRadius = 3
