IMSDK
IM features a comprehensive suite of solutions including global access, one-to-one chat, group chat, message push, profile and relationship chain hosting, and account authentication. It also provides complete app access and backend management APIs.
V2TIMElemabstract
Swift - V2TIMElem
Swift

Class V2TIMElem

public class V2TIMElem  

Definition of V2TIMElem

V2TIMElem V2TIMElem V2TIMSoundElem V2TIMSoundElem V2TIMSoundElem->V2TIMElem V2TIMTextElem V2TIMTextElem V2TIMTextElem->V2TIMElem V2TIMLocationElem V2TIMLocationElem V2TIMLocationElem->V2TIMElem V2TIMGroupTipsElem V2TIMGroupTipsElem V2TIMGroupTipsElem->V2TIMElem V2TIMCustomElem V2TIMCustomElem V2TIMCustomElem->V2TIMElem V2TIMFaceElem V2TIMFaceElem V2TIMFaceElem->V2TIMElem V2TIMMergerElem V2TIMMergerElem V2TIMMergerElem->V2TIMElem V2TIMFileElem V2TIMFileElem V2TIMFileElem->V2TIMElem V2TIMImageElem V2TIMImageElem V2TIMImageElem->V2TIMElem V2TIMVideoElem V2TIMVideoElem V2TIMVideoElem->V2TIMElem

Subclasses

V2TIMTextElem

Definition of V2TIMTextElem

V2TIMCustomElem

Definition of V2TIMCustomElem

V2TIMImageElem

Definition of V2TIMImageElem

V2TIMSoundElem

Definition of V2TIMSoundElem

V2TIMVideoElem

Definition of V2TIMVideoElem

V2TIMFileElem

Definition of V2TIMFileElem

V2TIMLocationElem

Definition of V2TIMLocationElem

V2TIMFaceElem

Definition of V2TIMFaceElem

V2TIMMergerElem

Definition of V2TIMMergerElem

V2TIMGroupTipsElem

Definition of V2TIMGroupTipsElem

Initializers

init()

public init()  

Properties

description

public var description: String  

Methods

get​Next​Elem()

public func getNextElem() -> V2TIMElem?  

Get the next Elem. If your message has multiple Elems, you can get the next Elem object from the current Elem. If the return value is nil, it means the Elem acquisition is over.

For detailed usage, please refer to the document Message sending and receiving

append​Elem(element:​)

public func appendElem(element: V2TIMElem)  

Add the next element


To configure multiple elements, after creating a Message object, you can add the next element via the element object of Message. The following is the sample code for creating V2TIMTextElem and V2TIMCustomElem:
let msg = V2TIMManager.shared.createTextMessage(text: "text")
let customElem = V2TIMCustomElem()
customElem.data = "custom message".data(using: .utf8)
msg.textElem?.appendElem(customElem: customElem)
- Warning: Note that: * This API can be called only by elements of a Message object created via createMessage. * This API can be used to add V2TIMTextElem, V2TIMCustomElem, V2TIMFaceElem, or V2TIMLocationElem.