Not showing Attributes top, bottom
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
Research direction
Start with the shown cellTopLabelHeight(for:at:in:) and cellTopLabelAttributedText(for:at:) implementations, then read the MessageKit message-cell label configuration and layout flow. Reproduce the reported display-name layout on the iPhone 14 Pro Max setup and compare it with the referenced screenshots. Done means the sender display name appears in the intended top-label position and styling.
Written by the indexing model from the issue text.
Description
ChatNetworkService.uploadMessage(page: 0) { [weak self] (result) in
guard let self = self else { return }
switch result {
case .success(let data):
data.list?.forEach({ chat in
if chat.mine == false {
self.selfSender = Sender(photoURL: "",
senderId: "0",
displayName: chat.clientName ?? "")
} else {
self.selfSender = Sender(photoURL: "",
senderId: chat.clientID ?? "",
displayName: chat.clientName ?? "")
}
let att = NSAttributedString(string: chat.message ?? "")
print(self.selfSender)
self.messages.append(Message(sender: self.selfSender,
messageId: chat.id?.description ?? "",
sentDate: Date(),
kind: .attributedText(att)))
})
DispatchQueue.main.async {
self.messagesCollectionView.reloadData()
}
print("success")
case .failure(let error):
switch error {
case .standard(_, let model):
print("Standard")
case .technical(let title, let description):
print("HELLO WORLD TECHNICAL \(title) \(description) ")
case .unexpected(let description, _, _):
print("HELLO WORLD UNEXPECTED \(description) ")
default:
break
}
}
}
I have this code for appending data to message I have a layout like this:
func cellTopLabelHeight(for message: MessageType, at indexPath: IndexPath, in messagesCollectionView: MessagesCollectionView) -> CGFloat {
20
}
func cellTopLabelAttributedText(for message: MessageType, at indexPath: IndexPath) -> NSAttributedString? {
return NSAttributedString(string: message.sender.displayName)
}
if I am writing this code its showing display name but not like on cell example, screenshot above:
last version of MessageKit
Xcode version: 14.2
- Dominant language
- Swift
- Stars
- 6.3k
- Forks
- 1.2k
- Avg merge
- 12h 4m
- Merged PRs (30d)
- 9
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from MessageKit/MessageKit
-
Keyboard bug Openbug?
Difficulty 3/5 1-2 days Newbie friendliness 45/100
MessageKit/MessageKit#1901 ·
-
question
Difficulty 4/5 3-5 days Newbie friendliness 35/100
MessageKit/MessageKit#1888 · 2 comments ·
-
Transparent navigation bar in messageInputBar but messagesCollectionView is not shown in these areas Openfeature request
Difficulty 3/5 1-2 days Newbie friendliness 35/100
MessageKit/MessageKit#1884 · 1 comment ·
-
feature request
Difficulty 3/5 1-2 days Newbie friendliness 45/100
MessageKit/MessageKit#1880 ·
-
bug?
Difficulty 4/5 3-5 days Newbie friendliness 35/100
MessageKit/MessageKit#1878 ·
All issues in MessageKit/MessageKit
Similar issues
-
🎉 Add KinetTask Open
Difficulty 1/5 Under an hour Newbie friendliness 88/100
jaywcjlove/awesome-mac#2932 ·
-
tvOS
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
skiptools/skip-fuse-ui#147 ·
-
area:collectors P2
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
catehstn/social-brain-app#183 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100