一个多功能、多行文本输入组件,适用于 SwiftUI 中的聊天界面。
ChatField
结构体提供了一种增强的文本输入体验,专为 SwiftUI 中的聊天应用程序量身定制。它超越了标准的 SwiftUI 文本字段,提供多行输入功能和特定于平台的适配。
在 iOS 上,ChatField
可以扩展以适应具有可自定义行数限制的多行输入,满足移动聊天应用程序的需求。
对于 macOS,ChatField
经过精心设计,支持桌面聊天习惯。它允许用户使用 Shift+Enter
插入新行,保持熟悉的桌面聊天界面行为。
您可以在这里找到文档:https://kevinhermawan.github.io/ChatField/documentation/chatfield
您可以使用 Swift Package Manager 将 ChatField
作为依赖项添加到您的项目中,方法是将其添加到您的 Package.swift
的 dependencies 值中。
dependencies: [
.package(url: "https://github.com/kevinhermawan/ChatField.git", .upToNextMajor(from: "2.0.0"))
]
或者,在 Xcode 中
File
-> Swift Packages
-> Add Package Dependency...
https://github.com/kevinhermawan/ChatField.git
Add Package
。