AdmiralSwiftUI Chat ChatInput - admiral-team/admiralui-ios GitHub Wiki
ChatInput
- A view for chat input message and add files.
ChatInput(
.constant("Text"),
contentType: .default,
returnKeyType: .send,
autocapitalizationType: .none,
autocorrectionType: .default,
isResponder: .constant(false),
placeholder: "Введите сообщение",
tapSendButton: {},
tapFileButton: {},
isShowFileButton: true
)
You can create a ChatInput
by specifying the following parameters in the initializer
- content: Binding<String - The text that the text field displays.
- contentType: UIKeyboardType - The semantic meaning for a text input area.
- returnKeyType: UIReturnKeyType - The visible title of the Return key.
- autocapitalizationType: UITextAutocapitalizationType - The autocapitalization style for the text object.
- autocorrectionType: UITextAutocorrectionType - The autocorrection style for the text object.
- isResponder: Binding<Bool?> - Is ChatInput responder
- placeholder: String - The string that displays when there is no other text in the text field.
- tapSendButton: @escaping () - Tap send button. Return true if you want clear text.
- tapFileButton: @escaping () - Tap file button.
- isShowFileButton: Bool - Will the file button be shown.
- formatter: Formatter?
- isSendButtonDisabled: Bool? - Flag send button disabled.
- maxNumberOfLines: Int? - Max number of lines input.
- maxHeight: CGFloat? - Max height input
- onCursorPosition: An action to perform change cursor position. On enter 3 parameters - startCursor, currentCursor, text. Return cursor position.
To run live demo with ChatInput
open Xcode and run project with Example target. Then in the Chat -> Input
You can help us to find bugs or ask us to add features.
- To start
issue
please use ready-made templates. - To make changes to the repository, you need to create a
fork
of the project, make changes to the code and create apull request
in our project. You can read more about this in the Github documentation.