MessageMetaArray
public final class MessageMetaArray: NSObject, Codable, NSCopying
extension MessageMetaArray: Serializable
The MessageMetaArray instance has a string type of key and an array type of value.
The value consists of a string. It usually can be used for ‘vote’ or ‘reaction’ for the message.
-
A string type of key.
Since
3.0.148Declaration
Swift
public internal(set) var key: String -
The value consists of a string. The value guarantees de-duplicated string.
Since
3.0.148Declaration
Swift
public internal(set) var value: [String] -
Declaration
Swift
public func encode(to encoder: Encoder) throws -
Declaration
Swift
public required init(from decoder: Decoder) throws -
Initializes an message meta array with the given key and an empty array of the value.
Since
3.0.148Declaration
Swift
public convenience init(key: String)Parameters
keyA string type of key.
Return Value
Message meta array instance.
-
Initializes an message meta array with the given key and the given value.
Since
3.0.148Declaration
Swift
public init(key: String, value: [String]?)Parameters
keyA string type of key.
valueThe value consists of a string.
Return Value
Message meta array instance.
-
Adds an set type of the value to the receiver’s value field.
Since
3.0.148Declaration
Swift
public func addValue(_ value: Set<String>)Parameters
valueString set.
-
Adds an array type of the value to the receiver’s value field.
Since
3.0.148Declaration
Swift
public func addValue(with array: [String])Parameters
arrayString array.
-
Removes an set type of the value from the receiver’s value field.
Note
Nonexistent string value are not ignored.Since
3.0.148Declaration
Swift
public func removeValue(_ value: Set<String>)Parameters
valueString set.
-
Removes an array type of the value from the receiver’s value field.
Note
Nonexistent string value are not ignored.Since
3.0.148Declaration
Swift
public func removeValue(with array: [String])Parameters
arrayString array.
-
Compares this object with given other object.
Declaration
Swift
public override func isEqual(_ object: Any?) -> BoolParameters
objectAnyinstanceReturn Value
trueif same otherwisefalse -
Copies this object
Declaration
Swift
public func copy(with zone: NSZone? = nil) -> AnyParameters
zoneoptional
NSZoneReturn Value
MessageMetaArrayinstance -
Serializes this object into data
Declaration
Swift
public func serialize() -> Data?Return Value
optioanal
Datainstance -
Deserializes and reconstructs the object
Declaration
Swift
public static func build(fromSerializedData data: Data?) -> Self?Parameters
dataDatainstanceReturn Value
MessageMetaArrayif parameter is valid, otherwisenil
View on GitHub
Install in Dash