A customizable, multiline text field for chat interfaces in SwiftUI.
The ChatField
struct enhances the standard SwiftUI text field by supporting multiline input and adapting to specific platform behaviors.
On iOS, ChatField
offers an expanded chat field experience, enabling multiline input with a specified line limit, thus catering to the requirements of chat-based applications.
On macOS, ChatField
is designed to enhance user interaction by allowing the insertion of new lines through Shift+Enter
, aligning with the typical chat interface behavior on desktop platforms.
You can find the documentation here: https://kevinhermawan.github.io/ChatField/documentation/chatfield
You can add ChatField
as a dependency to your project using Swift Package Manager by adding it to the dependencies value of your Package.swift
.
dependencies: [
.package(url: "https://github.com/kevinhermawan/ChatField.git", .upToNextMajor(from: "2.0.0"))
]
Alternatively, in Xcode:
- Open your project in Xcode.
- Click on
File
->Swift Packages
->Add Package Dependency...
- Enter the repository URL:
https://github.com/kevinhermawan/ChatField.git
- Choose the version you want to add. You probably want to add the latest version.
- Click
Add Package
.