A session object used to create and update messages.
- iOS 10.0+
MSMessage objects associated with a session receive the following treatment in the transcript:
The first time a session is used, the message appears normally in the transcript.
If a later message is sent using the same session, the previous message is removed from the transcript. The new message, with the updated content, is added to the bottom of the transcript, as normal.
If the previous message has a non-
summaryproperty, the Messages app creates a summary message from the text and inserts it in the message’s previous location.
Create New, Updatable Messages
Use the following workflow to create a new, updatable message.
Create the following:
Send the message by calling the conversation’s
nilfor the change description.
The Messages app adds the message to the transcript as soon as the user taps the send button.
Use the following workflow to receive and update a message.
When the user taps on one of your
MSMessageentries, the conversation’s
selectedproperty is changed to the tapped message. Use key-value observing to respond to these changes. Extract the current state from the message’s
urlproperty, and present it to the user.
For more information on receiving messages, see
After the user responds, create the following:
Send the updated message by calling the conversation’s
The Messages app updates the message in the transcript as soon as the user taps the send button.