Message Parts

ICMessagePart

This interface represents a part of the message that the developer wants to display in a partial view.

Properties:

contentType

NSString

The message part content type

ICTextMessagePart

This class will retrieve all the text that will be displayed for a specific message.

Properties:

text

NSString

The message text

ICAttachmentMessagePart

This class will retrieve a single attachment that will be displayed for a specific message.

Properties:

filePath

NSURL

The file path where the message is locally stored

attachment

ICAttachment

The attachment that should be displayed in the message part view

ICURLMessagePart

This class will retrieve a URL from which a preview will be displayed for a specific message

Properties:

url

NSURL

The URL that will be represented in the message part view

ICMessageComposerView

This view represents the composer to write down some messages and add some attachments to these messages. To add some attachments to the message some plugins must be registered. These plugins will allow the user to pick some photos/videos, share a location or record some audio message for example.

Styling:

This class allows you to customise the message composer view.

Properties:

delegate

id

See ICMessageComposerViewDelegate description

composerTextView

ICMessageComposerTextView

See ICMessageComposerTextView description

borderWidth

CGFloat

The border width

borderColor

UIColor

The border color

cornerRadius

CGFloat

The corner radius

backgroundColor

UIColor

The background color

composerBackgroundColor

UIColor

The composer background color

Sample Code:

[[ICMessageComposerView appearance] setBorderWidth:2.0f];
[[ICMessageComposerView appearance] setBorderColor:[UIColor blueColor]];    
[[ICMessageComposerView appearance] setCornerRadius:10.0f];
[[ICMessageComposerView appearance] setBackgroundColor:[UIColor blueColor]];    
[[ICMessageComposerView appearance] setComposerBackgroundColor:[UIColor blueColor]];

Methods:

Syntax

Description

(void) registerPlugins:(NSArray *)plugins

Registers an array of plugins

(void) registerPlugin:(ICMessageComposerPlugin *)plugin

Registers a plugin

ICMessageComposerViewDelegate

This interface will warn the delegate each time an action has been made on the
composer.

Methods:

Syntax

Description

(void) didComposeMessage:(ICMessage )message withMessageParts:(NSArray )messageParts

Tells the delegate that a message has been composed and provides the eventual message parts attached to that message

(void) presentPluginOptionsInAlertController:(UIAlertController *)alertController

Tells the delegate to present an alertController containing plugin options

(void) didSelectPlugin:(ICMessageComposerPlugin *)plugin

Tells the delegate that a plugin has been selected by the user

(void) messageComposerView:(ICMessageComposerView *)messageComposerView
didUpdateHeight:(CGFloat)height

Tells the delegate that the message composer view has updated its height

(void) messageComposerViewDidStartTyping:(ICMessageComposerView *)messageComposerView

Tells the delegate that the user is typing

(void) messageComposerViewDidStopTyping:(ICMessageComposerView *)messageComposerView

Tells the delegate that the user is not typing anymore

ICMessageComposerTextView

This class represents the part of the composer when the user types some text.

Styling:

This class allows you to customise the message composer text view.

Properties:

composerTextDelegate

id

See ICMessageComposerTextViewDelegate description

messageTextColor

UIColor

The message text color

messageFont

UIFont

The message text font size

placeHolderText

NSString

The place holder text

placeHolderTextColor

UIColor

The place holder text color

Sample Code

[[ICMessageComposerTextView appearance] setMessageTextColor:[UIColor blueColor]];
[[ICMessageComposerTextView appearance] setMessageFont:[UIFont systemFontOfSize:12.0f weight:UIFontWeightRegular]];
[[ICMessageComposerTextView appearance] setPlaceHolderText:@"placeholder"];    
[[ICMessageComposerTextView appearance] setPlaceHolderTextColor:[UIColor blueColor]];

Methods:

Syntax

Description

(void) clear

Clears the composer text view and show the place holder

ICMessageComposerPlugin

This abstract class represents a way to add an attachment to a message. It can
be a photo picker, an audio recorder, etc,

Properties:

title

NSString

The plugin title

Methods:

Syntax

Description

(void) addMessagePart:(id)messagePart
withThumbnail:(UIImage *)thumbnail

This method should be called when a message part has been selected and his associated thumbnail generated

  • (instancetype) pluginWithTitle:(NSString *)title

Instantiates a plugin

(void) presentFromViewController:(UIViewController *)viewController

Shows the graphic component associated with the plugin from a view controller

(void) addMessagePart:(id)messagePart toMessage:(ICMessage *)message

Associates a message part to a message when the user has clicked on the Send button

ICMessageComposerAudioPlugin

This class represents a way to transform recorded audio to an audio attachment

ICMessageComposerAudioPluginViewControllerDelegate

This class provides an easy way to record an audio

Properties:

delegate

Id

See the ICMessageComposerAudioPluginViewControllerDelegate description

ICMessageComposerAudioPluginViewController

Methods:

Syntax

Description

(void)audioPluginViewController:(ICMessageComposerAudioPluginViewController )audioPluginViewController didFinishRecordingAudioAtURL:(NSURL )url withDuration:(CGFloat)duration

Tells the delegate that the audio has finished being recorded

ICMessageComposerLocationPlugin

This class represents a way to transform a selected location to a location
attachment

ICMessageComposerLocationPluginViewController

This class provides an easy way to pick a location

Properties:

delegate

Id

See the ICMessageComposerLocationPluginViewControllerDelegate description

ICMessageComposerLocationPluginViewControllerDelegate

Methods:

(void)locationPluginViewController:(ICMessageComposerLocationPluginViewController )locationPluginViewController didFinishPickingLocation:(CLLocation )location :(NSString *)address inRegion:(MKCoordinateRegion)region

Tells the delegate that the user has picked a location

ICMessageComposerFilePlugin

This class represents a way to transform a selected file to a file attachment

ICMessageComposerImagePlugin

This class represents a way to transform a selected image to an image attachment

Properties:

sourceType

UIImagePickerControllerSourceType

The source type of the image. It can be the library or directly the camera

ICImageViewController

This class provides a way to show an image in full screen

Properties:

Image

UIImage

The image that will be displayed in full screen

ICFileViewController

This class displays a preview of a file

Methods:

Syntax

Description

(void)showFilePreview:(NSURL *)filePath

Shows a file preview from a file path

ICMediaHandler

Handles an interaction with a media with a default behavior.

Methods:

  • (instancetype) shared

Gives a single instance of an ICMediaHandler

(void)handleMediaMessagePart:(ICMediaMessagePart )mediaMessagePart fromViewController:(UIViewController )viewController

Handles a media message part with a default behavior

ICMessageComposerTextViewDelegate

(void)composerTextView (ICMessageComposerTextView *)composerTextView didUpdateHeight:(CGFloat)height

Tells the delegate that the height of the composer text view has changed

(void)composerTextViewDidStartTyping:(ICMessageComposerTextView *)composerTextView

Tells the delegate that the user is typing

(void)composerTextViewDidStopTyping:(ICMessageComposerTextView *)composerTextView

Tells the delegate that the user is not typing anymore