         return super.canPerformAction(action, withSender: sender)
     }
     
-    override public func caretRect(for position: UITextPosition) -> CGRect {
+    override open func caretRect(for position: UITextPosition) -> CGRect {
         guard let type = getType?() else {
             return super.caretRect(for: position)
         }


import Foundation

enum EditableActionType {
    case selectAll
    case select
    case cut
    case copy
    case paste

    static let allActions = [EditableActionType.selectAll, .select, .cut, .paste, .copy]
}

public class EditableTextField: UITextField {

    /// Actions, that will be disabled for this textField.
    /// By default no actions are disabled.
    var disabledActions: [EditableActionType] = []

    /// Allows to disable moving cursor for user
    var pinCursorToEnd: Bool = false

    var getType: (() -> TextType?)?

    // MARK: - Private


        return super.caretRect(for: position)
    }

    override open func closestPosition(to point: CGPoint) -> UITextPosition? {
        if pinCursorToEnd {
            return endOfDocument
        }
