@@ -84,7 +84,40 @@ final class MineMessageEntity: MessageEntity {
8484
8585``` Swift
8686class CustomMessageListController : MessageListController {
87+
88+ // 要实现微信样式(followInput),需要同时重载下面的方法以及仿系统 UIActionSheet 样式(ActionSheet)的方法
89+ override func processFollowInputAttachmentAction () {
90+ if Appearance.chat.messageAttachmentMenuStyle == .followInput {
91+ if let fileItem = Appearance.chat.inputExtendActions.first (where : { $0 .tag == " File" }) {
92+ fileItem.action = { [weak self ] item,object in
93+ self ? .handleAttachmentAction (item : item)
94+ }
95+ }
96+ if let photoItem = Appearance.chat.inputExtendActions.first (where : { $0 .tag == " Photo" }) {
97+ photoItem.action = { [weak self ] item,object in
98+ self ? .handleAttachmentAction (item : item)
99+ }
100+ }
101+ if let cameraItem = Appearance.chat.inputExtendActions.first (where : { $0 .tag == " Camera" }) {
102+ cameraItem.action = { [weak self ] item,object in
103+ self ? .handleAttachmentAction (item : item)
104+ }
105+ }
106+ if let contactItem = Appearance.chat.inputExtendActions.first (where : { $0 .tag == " Contact" }) {
107+ contactItem.action = { [weak self ] item,object in
108+ self ? .handleAttachmentAction (item : item)
109+ }
110+ }
111+ if let redPackageItem = Appearance.chat.inputExtendActions.first (where : { $0 .tag == " Red" }) {
112+ redPackageItem.action = { [weak self ] item,object in
113+ self ? .handleAttachmentAction (item : item)
114+ }
115+ }
116+
117+ }
118+ }
87119
120+ // 仿系统 UIActionSheet 样式(ActionSheet)只需要重载以下方法
88121 override func handleAttachmentAction (item : any ActionSheetItemProtocol) {
89122 switch item.tag {
90123 case " File" : self .selectFile ()
0 commit comments