LCIMTypedMessage

Objective-C

@interface LCIMTypedMessage : LCIMMessage

Swift

class LCIMTypedMessage : LCIMMessage

Base class for rich media message.

  • The string text.

    Declaration

    Objective-C

    @property (nonatomic, nullable) NSString *text;

    Swift

    var text: String? { get set }
  • The custom attributes.

    Declaration

    Objective-C

    @property (nonatomic, nullable) NSDictionary *attributes;

    Swift

    var attributes: [AnyHashable : Any]? { get set }
  • The file.

    Declaration

    Objective-C

    @property (nonatomic, nullable) LCFile *file;

    Swift

    var file: LCFile? { get set }
  • The location.

    Declaration

    Objective-C

    @property (nonatomic, nullable) LCGeoPoint *location;

    Swift

    var location: LCGeoPoint? { get set }
  • Add custom property for message.

    Declaration

    Objective-C

    - (void)setObject:(id _Nullable)object forKey:(nonnull NSString *)key;

    Swift

    func setObject(_ object: Any?, forKey key: String)

    Parameters

    object

    The property value.

    key

    The property name.

  • Get a user-defiend property for a key.

    Declaration

    Objective-C

    - (id _Nullable)objectForKey:(nonnull NSString *)key;

    Swift

    func object(forKey key: String) -> Any?

    Parameters

    key

    The key of property that you want to get.

    Return Value

    The value for key.

  • Any custom typed message should be registered at first.

    Declaration

    Objective-C

    + (void)registerSubclass;

    Swift

    class func registerSubclass()
  • Create a message with file from local path.

    Declaration

    Objective-C

    + (nullable instancetype)messageWithText:(NSString *_Nullable)text
                            attachedFilePath:(nonnull NSString *)attachedFilePath
                                  attributes:(NSDictionary *_Nullable)attributes;

    Swift

    convenience init?(text: String?, attachedFilePath: String, attributes: [AnyHashable : Any]? = nil)

    Parameters

    text

    The string text.

    attachedFilePath

    The local path of the file.

    attributes

    The custom attributes.

  • Create a message with text, file and attributes.

    Declaration

    Objective-C

    + (nonnull instancetype)messageWithText:(NSString *_Nullable)text
                                       file:(nonnull LCFile *)file
                                 attributes:(NSDictionary *_Nullable)attributes;

    Swift

    convenience init(text: String?, file: LCFile, attributes: [AnyHashable : Any]? = nil)

    Parameters

    text

    The string text.

    file

    The file object.

    attributes

    The custom attributes.