     :param: keyboardRect Current keyboard frame
     */
     private func makeActiveTextFieldVisible(var keyboardRect: CGRect) {
-        if activeTextField == nil { return }
+		guard let activeTextField = activeTextField else {
+			print("Warning: activeTextField is nil")
+			return
+		}
+		
         // flipLandscapeFrameForIOS7 only changes CGRect for landscape on iOS7
         keyboardRect = flipLandscapeFrameForIOS7(keyboardRect)
         

		:param: textField A target text field
		*/
        private func setupEditingActionsForTextField(textField: UITextField) {
            if textField.actionsForTarget(self.superview!, forControlEvent: .EditingDidBegin) == nil {
                textField.addTarget(self.superview!, action: "_textFieldEditingDidBegin:", forControlEvents: .EditingDidBegin)
            }
            
            if textField.actionsForTarget(self.superview!, forControlEvent: .EditingChanged) == nil {
                textField.addTarget(self.superview!, action: "_textFieldEditingChanged:", forControlEvents: .EditingChanged)
            }
            
            if textField.actionsForTarget(self.superview!, forControlEvent: .EditingDidEnd) == nil {
                textField.addTarget(self.superview!, action: "_textFieldEditingDidEnd:", forControlEvents: .EditingDidEnd)
            }
            
            if textField.actionsForTarget(self.superview!, forControlEvent: .EditingDidEndOnExit) == nil {
                textField.addTarget(self.superview!, action: "_textFieldEditingDidEndOnExit:", forControlEvents: .EditingDidEndOnExit)
            }
        }
		

		:param: textField A target text field
		*/
		private func removeEditingActionsForTextField(textField: UITextField) {
			guard let scrollView = superview as? UIScrollView else {
				print("Error: contentView's superview is not scrollView")
				return
			}
			
			if textField.actionsForTarget(scrollView, forControlEvent: .EditingDidBegin) != nil {
				textField.removeTarget(scrollView, action: "_textFieldEditingDidBegin:", forControlEvents: .EditingDidBegin)
			}
			
			if textField.actionsForTarget(scrollView, forControlEvent: .EditingChanged) != nil {
				textField.removeTarget(scrollView, action: "_textFieldEditingChanged:", forControlEvents: .EditingChanged)
			}
			
			if textField.actionsForTarget(scrollView, forControlEvent: .EditingDidEnd) != nil {
				textField.removeTarget(scrollView, action: "_textFieldEditingDidEnd:", forControlEvents: .EditingDidEnd)
			}
			
			if textField.actionsForTarget(scrollView, forControlEvent: .EditingDidEndOnExit) != nil {
				textField.removeTarget(scrollView, action: "_textFieldEditingDidEndOnExit:", forControlEvents: .EditingDidEndOnExit)
			}
		}
    }
