Skip to content

Commit f0be767

Browse files
Added docs for custom attachments
1 parent 04ff8f6 commit f0be767

File tree

5 files changed

+393
-5
lines changed

5 files changed

+393
-5
lines changed

DemoAppSwiftUI/CustomComposerAttachmentView.swift

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ struct ContactAttachmentPayload: AttachmentPayload {
1818
let phoneNumber: String
1919
}
2020

21-
typealias ContactAttachment = ChatMessageAttachment<ContactAttachmentPayload>
22-
2321
extension ContactAttachmentPayload: Identifiable {
2422

2523
var id: String {
@@ -53,7 +51,6 @@ class CustomAttachmentsFactory: ViewFactory {
5351
id: "127",
5452
content: AnyAttachmentPayload(payload: ContactAttachmentPayload(name: "Test 5", phoneNumber: "534534543543534"))
5553
)
56-
5754
]
5855

5956
func makeAttachmentSourcePickerView(
@@ -203,7 +200,7 @@ struct CustomContactAttachmentView: View {
203200
.frame(maxWidth: .infinity)
204201
}
205202
}
206-
}
203+
}
207204
}
208205

209206
}

Sources/StreamChatSwiftUI/ChatChannel/Composer/AttachmentPickerTypeView.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ public enum AttachmentPickerType {
2020
case media
2121
/// Giphy commands are selected.
2222
case giphy
23+
/// Custom attachment picker type.
24+
case custom
2325
}
2426

2527
/// View for picking the attachment type (media or giphy commands).

0 commit comments

Comments
 (0)