InputBarButtonItem
open class InputBarButtonItem : UIButton, InputItem
A InputItem that inherits from UIButton
Important Notes
- Intended to be used in an
InputStackView
-
The spacing properties of the InputBarButtonItem
- fixed: The spacing is fixed
- flexible: The spacing is flexible
- none: There is no spacing
Declaration
Swift
public enum Spacing
-
Declaration
Swift
public typealias InputBarButtonItemAction = ((InputBarButtonItem) -> Void)
-
A weak reference to the InputBarAccessoryView that the InputBarButtonItem used in
Declaration
Swift
open weak var inputBarAccessoryView: InputBarAccessoryView?
-
The spacing property of the InputBarButtonItem that determines the contentHuggingPriority and any additional space to the intrinsicContentSize
Declaration
Swift
open var spacing: Spacing { get set }
-
Declaration
Swift
open override var intrinsicContentSize: CGSize { get }
-
A reference to the stack view position that the InputBarButtonItem is held in
Declaration
Swift
open var parentStackViewPosition: InputStackView.Position?
-
The title for the UIControlState.normal
Declaration
Swift
open var title: String? { get set }
-
The image for the UIControlState.normal
Declaration
Swift
open var image: UIImage? { get set }
-
Calls the onSelectedAction or onDeselectedAction when set
Declaration
Swift
open override var isHighlighted: Bool { get set }
-
Calls the onEnabledAction or onDisabledAction when set
Declaration
Swift
open override var isEnabled: Bool { get set }
-
Declaration
Swift
public convenience init()
-
Declaration
Swift
public override init(frame: CGRect)
-
Declaration
Swift
required public init?(coder aDecoder: NSCoder)
-
Sets up the default properties
Declaration
Swift
open func setup()
-
Sets the size of the InputBarButtonItem which overrides the intrinsicContentSize. When set to nil the default intrinsicContentSize is used. The new size will be laid out in the UIStackView that the InputBarButtonItem is held in
Declaration
Swift
open func setSize(_ newValue: CGSize?, animated: Bool)
Parameters
newValue
The new size
animated
If the layout should be animated
-
Used to setup your own initial properties
Declaration
Swift
@discardableResult open func configure(_ item: InputBarButtonItemAction) -> Self
Parameters
item
A reference to Self
Return Value
Self
-
Sets the onKeyboardEditingBeginsAction
Declaration
Swift
@discardableResult open func onKeyboardEditingBegins(_ action: @escaping InputBarButtonItemAction) -> Self
Parameters
action
The new onKeyboardEditingBeginsAction
Return Value
Self
-
Sets the onKeyboardEditingEndsAction
Declaration
Swift
@discardableResult open func onKeyboardEditingEnds(_ action: @escaping InputBarButtonItemAction) -> Self
Parameters
action
The new onKeyboardEditingEndsAction
Return Value
Self
-
Sets the onKeyboardSwipeGestureAction
Declaration
Swift
@discardableResult open func onKeyboardSwipeGesture(_ action: @escaping (_ item: InputBarButtonItem, _ gesture: UISwipeGestureRecognizer) -> Void) -> Self
Parameters
action
The new onKeyboardSwipeGestureAction
Return Value
Self
-
Sets the onTextViewDidChangeAction
Declaration
Swift
@discardableResult open func onTextViewDidChange(_ action: @escaping (_ item: InputBarButtonItem, _ textView: InputTextView) -> Void) -> Self
Parameters
action
The new onTextViewDidChangeAction
Return Value
Self
-
Sets the onTouchUpInsideAction
Declaration
Swift
@discardableResult open func onTouchUpInside(_ action: @escaping InputBarButtonItemAction) -> Self
Parameters
action
The new onTouchUpInsideAction
Return Value
Self
-
Sets the onSelectedAction
Declaration
Swift
@discardableResult open func onSelected(_ action: @escaping InputBarButtonItemAction) -> Self
Parameters
action
The new onSelectedAction
Return Value
Self
-
Sets the onDeselectedAction
Declaration
Swift
@discardableResult open func onDeselected(_ action: @escaping InputBarButtonItemAction) -> Self
Parameters
action
The new onDeselectedAction
Return Value
Self
-
Sets the onEnabledAction
Declaration
Swift
@discardableResult open func onEnabled(_ action: @escaping InputBarButtonItemAction) -> Self
Parameters
action
The new onEnabledAction
Return Value
Self
-
Sets the onDisabledAction
Declaration
Swift
@discardableResult open func onDisabled(_ action: @escaping InputBarButtonItemAction) -> Self
Parameters
action
The new onDisabledAction
Return Value
Self
-
Executes the onTextViewDidChangeAction with the given textView
Declaration
Swift
open func textViewDidChangeAction(with textView: InputTextView)
Parameters
textView
A reference to the InputTextView
-
Executes the onKeyboardSwipeGestureAction with the given gesture
Declaration
Swift
open func keyboardSwipeGestureAction(with gesture: UISwipeGestureRecognizer)
Parameters
gesture
A reference to the gesture that was recognized
-
Executes the onKeyboardEditingEndsAction
Declaration
Swift
open func keyboardEditingEndsAction()
-
Executes the onKeyboardEditingBeginsAction
Declaration
Swift
open func keyboardEditingBeginsAction()
-
Executes the onTouchUpInsideAction
Declaration
Swift
@objc open func touchUpInsideAction()
-
An InputBarButtonItem that’s spacing property is set to be .flexible
Declaration
Swift
public static var flexibleSpace: InputBarButtonItem { get }
-
An InputBarButtonItem that’s spacing property is set to be .fixed with the width arguement
Declaration
Swift
public static func fixedSpace(_ width: CGFloat) -> InputBarButtonItem