Structure
StandardEditActionHandling
public struct StandardEditActionHandling<Responder: UIResponder>
A protocol-witness style implementation of the UIResponderStandardEditActions
protocol that can be used to override the default behaviour of UITextField
.
All of the functions return a Bool
. Returning false
to prevent the default behaviour.
Nested Type Aliases
StandardEditActionHandler
public typealias StandardEditActionHandler = (Responder, Any?) -> Bool
A closure that can be used to customise a standard edit action.
-
Responder
- the control that this action is associated with, e.g. theUITextField
-
Any?
- the sender of the action.
ConversionHandler
public typealias ConversionHandler = ([NSAttributedString.Key : Any]) -> [NSAttributedString.Key : Any]
Initializers
init(cut:copy:paste:delete:select:selectAll:toggleBoldface:toggleItalics:toggleUnderline:makeTextWritingDirectionLeftToRight:makeTextWritingDirectionRightToLeft:increaseSize:decreaseSize:updateTextAttributes:)
public init(
cut: StandardEditActionHandler? = nil,
copy: StandardEditActionHandler? = nil,
paste: StandardEditActionHandler? = nil,
delete: StandardEditActionHandler? = nil,
select: StandardEditActionHandler? = nil,
selectAll: StandardEditActionHandler? = nil,
toggleBoldface: StandardEditActionHandler? = nil,
toggleItalics: StandardEditActionHandler? = nil,
toggleUnderline: StandardEditActionHandler? = nil,
makeTextWritingDirectionLeftToRight: StandardEditActionHandler? = nil,
makeTextWritingDirectionRightToLeft: StandardEditActionHandler? = nil,
increaseSize: StandardEditActionHandler? = nil,
decreaseSize: StandardEditActionHandler? = nil,
updateTextAttributes: ((Responder, ConversionHandler) -> Bool)? = nil
)
Properties
cut
public var cut: StandardEditActionHandler?
copy
public var copy: StandardEditActionHandler?
paste
public var paste: StandardEditActionHandler?
delete
public var delete: StandardEditActionHandler?
select
public var select: StandardEditActionHandler?
selectAll
public var selectAll: StandardEditActionHandler?
toggleBoldface
public var toggleBoldface: StandardEditActionHandler?
toggleItalics
public var toggleItalics: StandardEditActionHandler?
toggleUnderline
public var toggleUnderline: StandardEditActionHandler?
makeTextWritingDirectionLeftToRight
public var makeTextWritingDirectionLeftToRight: StandardEditActionHandler?
makeTextWritingDirectionRightToLeft
public var makeTextWritingDirectionRightToLeft: StandardEditActionHandler?
increaseSize
public var increaseSize: StandardEditActionHandler?
decreaseSize
public var decreaseSize: StandardEditActionHandler?
updateTextAttributes
public var updateTextAttributes: ((Responder, ConversionHandler) -> Bool)?