Skip to content

Commit

Permalink
modify
Browse files Browse the repository at this point in the history
  • Loading branch information
haoxiuwen committed Dec 12, 2024
1 parent 4d89dfc commit cfcfc61
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions docs/uikit/chatuikit/ios/chatuikit_custom_cell.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,40 @@ final class MineMessageEntity: MessageEntity {

```Swift
class CustomMessageListController: MessageListController {

//followInput需要同时重载这个以及下面那个
override func processFollowInputAttachmentAction() {
if Appearance.chat.messageAttachmentMenuStyle == .followInput {
if let fileItem = Appearance.chat.inputExtendActions.first(where: { $0.tag == "File" }) {
fileItem.action = { [weak self] item,object in
self?.handleAttachmentAction(item: item)
}
}
if let photoItem = Appearance.chat.inputExtendActions.first(where: { $0.tag == "Photo" }) {
photoItem.action = { [weak self] item,object in
self?.handleAttachmentAction(item: item)
}
}
if let cameraItem = Appearance.chat.inputExtendActions.first(where: { $0.tag == "Camera" }) {
cameraItem.action = { [weak self] item,object in
self?.handleAttachmentAction(item: item)
}
}
if let contactItem = Appearance.chat.inputExtendActions.first(where: { $0.tag == "Contact" }) {
contactItem.action = { [weak self] item,object in
self?.handleAttachmentAction(item: item)
}
}
if let redPackageItem = Appearance.chat.inputExtendActions.first(where: { $0.tag == "Red" }) {
redPackageItem.action = { [weak self] item,object in
self?.handleAttachmentAction(item: item)
}
}

}
}

//ActionSheet 风格只需要重载这个
override func handleAttachmentAction(item: any ActionSheetItemProtocol) {
switch item.tag {
case "File": self.selectFile()
Expand Down

0 comments on commit cfcfc61

Please sign in to comment.