 		:param: textField A target text field
 		*/
 		private func removeEditingActionsForTextField(textField: UITextField) {
-			if textField.actionsForTarget(self.superview!, forControlEvent: .EditingDidBegin) != nil {
-				textField.removeTarget(self.superview!, action: "_textFieldEditingDidBegin:", forControlEvents: .EditingDidBegin)
-			}
-			
-			if textField.actionsForTarget(self.superview!, forControlEvent: .EditingChanged) != nil {
-				textField.removeTarget(self.superview!, action: "_textFieldEditingChanged:", forControlEvents: .EditingChanged)
-			}
-			
-			if textField.actionsForTarget(self.superview!, forControlEvent: .EditingDidEnd) != nil {
-				textField.removeTarget(self.superview!, action: "_textFieldEditingDidEnd:", forControlEvents: .EditingDidEnd)
-			}
-			
-			if textField.actionsForTarget(self.superview!, forControlEvent: .EditingDidEndOnExit) != nil {
-				textField.removeTarget(self.superview!, action: "_textFieldEditingDidEndOnExit:", forControlEvents: .EditingDidEndOnExit)
+			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)
 			}
 		}
     }

        }
		
        // Enlarge the targetFrame, give top and bottom some points margin
        var targetFrame = flipLandscapeFrameForIOS7(activeTextField!.convertRect(activeTextField!.bounds, toView: self))
        
        // Add top & bottom margins for target frame
        targetFrame.origin.y -= textFieldMargin

	
	@objc(_textFieldEditingDidEnd:)
    private func _textFieldEditingDidEnd(sender: AnyObject) {
		activeTextField = nil
    }
	
	@objc(_textFieldEditingDidEndOnExit:)
    private func _textFieldEditingDidEndOnExit(sender: AnyObject) {
        // This method gives the ability of dismissing keyboard on tapping return
    }
}

