Class
V2TIMElem
public class V2TIMElem
Definition of V2TIMElem
Relationships
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
getNextElem()
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
appendElem(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.