Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Changing text message object property to another text message and reload collection view does not change text message initially shown in messageLabel.

Aperta
#1,771 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
ios, swift
Ambito
mobile-dev

Direzione di ricerca

Inizia riproducendo la modifica nel messages data source e ricaricando la collection view mentre la chat rimane aperta. Verifica come le collection-view cells popolano messageLabel e confronta questo percorso con l’aggiornamento del data source; il lavoro è completato quando il testo modificato appare immediatamente senza riaprire la chat.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

question

Hi guys,

I am implementing an edit message feature in my app, the feature would allow users to edit a message they had already sent. It is a simple feature to implement, however, am facing an unexpected difficulty.

I have a data source array of messages shown in the collection view; var mkMessages = MKMessage

When a user decides to edit a message, I simply update the message's mkMessage.textMessage property in the database, and since the user still has the chat open, I will go ahead and look for the message in the data source array and do the same change (change mkMessage.textMessage property to newly edited text), then I reload messagesCollectionView. However, the edited message text does not change to the new one. I tried to debug with printing the mkMessage.textMessage property, and yes, the property in the data source array is changed. I also know that it is changed because after reloading the chat, the message bottom label changes to "Edited" as I have programmed it.

If l close the chat view controller and open the it again, it shows the correct message (edited message).

What could be wrong, any help please? Thanks.

Lingua principale
Swift
Stelle
6.3k
Fork
1.2k
Merge medio
12h 4m
PR unite (30g)
9

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di MessageKit/MessageKit

Tutte le issue di MessageKit/MessageKit

Issue simili

Altre issue su Swift

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.