先来看看官方文档
MSConversation
The MSConversation class represents a conversation in the Messages app. Use conversation objects to access information about the currently selected message or the conversation participants, or to send text, stickers, attachments, or message objects.
MSConversation类表示Messages应用程序中的对话。使用会话对象来访问有关当前选择的消息或对话参与者的信息,或者发送文本,贴纸,附件或消息对象。MSMessage
Use the MSMessage class to create interactive message objects. To create a message that can be updated by the conversation’s participants, instantiate a message with a session using the init(session:) method. Otherwise, instantiate the message using the init() method.
使用MSMessage类创建交互式消息对象。要创建可由对话参与者更新的消息,请使用init(session:)方法实例化具有会话的消息。否则,使用init()方法实例化消息。
MSMessageLayout
The MSMessageLayout class is an abstract base class that defines the appearance of MSMessage objects in the conversation transcript.
MSMessage Layout类是一个抽象基类,用于定义会话记录中MSMessage对象的外观。
MSMessagesAppViewController
The MSMessagesAppViewController class acts as the principal view controller for Messages extensions. Use this class to manage your extension. For more information on app extensions, see App Extension Programming Guide.
MSMessages App View Controller类作为消息扩展的主视图控制器。使用此类来管理您的扩展名。有关应用程序扩展的更多信息,请参阅App Extension编程指南。
MSMessageTemplateLayout
The MSMessageTemplateLayout describes how an MSMessage object is presented in the transcript. The message template includes the Message extension’s icon, an image, video, or audio file, and a number of text elements (title, subtitle, caption, subcaption, trailing caption, and trailing subcaption). These elements are laid out as shown in Figure 1.
MSMessageTemplateLayout描述如何在脚本中显示MSMessage对象。消息模板包括消息扩展的图标,图像,视频或音频文件以及许多文本元素(标题,字幕,标题,子字幕,尾字幕和尾部子画面)。这些元素如图1所示。
MSSession
Use the MSSession class to create and update messages.
使用MSSession类来创建和更新消息。
MSSticker
A sticker for use in the Messages app. A sticker can be sent as a new message or attached to an existing balloon in the transcript.
用于“消息”应用的贴纸。贴纸可以作为新消息发送或附加到抄本中的现有气球。
MSStickerBrowserView
Use the MSStickerBrowserView class to display a dynamically generated list of stickers. The browser provides drag-and-drop functionality. The user can press and hold a sticker to peel it from the browser, then drag the sticker to any balloon in the transcript. The user can also tap stickers to add them to the Messages app’s input field.
使用MSStickerBrowserView类显示动态生成的贴纸列表。浏览器提供拖放功能。用户可以按住标签将其从浏览器中剥离,然后将贴纸拖放到抄本中的任何气球。用户还可以点击贴纸将其添加到消息应用的输入字段。
MSStickerBrowserViewController
Use the MSStickerBrowserViewController to present the standard sticker browser. This browser provides drag-and-drop functionality. The user can press and hold a sticker to peel it from the browser, then drag the sticker to any balloon in the transcript. The user can also tap stickers to add them to the Messages app’s input field.
使用MSSticker浏览器视图控制器来呈现标准贴纸浏览器。此浏览器提供拖放功能。用户可以按住标签将其从浏览器中剥离,然后将贴纸拖放到抄本中的任何气球。用户还可以点击贴纸将其添加到消息应用的输入字段。
MSStickerView
Use the MSStickerView class to display sticker objects. The sticker view also provides drag-and-drop functionality. The user can press and hold a sticker to peel it from the view, and then drag the sticker to any balloon in the transcript.
使用MSSticker View类显示贴纸对象。贴纸视图还提供了拖放功能。用户可以按住标签将其从视图中剥离出来,然后将标签拖放到抄本中的任何气球。
MSStickerBrowserViewDataSource
Implement the MSStickerBrowserViewDataSource protocol to dynamically provide stickers for a browser.
实现MSSticker浏览器查看数据源协议,为浏览器动态提供strickers。
协议一、public func numberOfStickers(in stickerBrowserView: MSStickerBrowserView) -> Int
返回sticker的总数
协议二、public func stickerBrowserView(_ stickerBrowserView: MSStickerBrowserView, stickerAt index: Int) -> MSSticker
返回指定index对应的sticker