imessage使用一

来源:互联网 发布:双击屏幕唤醒软件 编辑:程序博客网 时间:2024/06/07 03:43

先来看看官方文档

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()方法实例化消息。
MSMessage​Layout
The MSMessage​Layout class is an abstract base class that defines the appearance of MSMessage objects in the conversation transcript.
MSMessage Layout类是一个抽象基类,用于定义会话记录中MSMessage对象的外观。
MSMessages​App​View​Controller
The MSMessages​App​View​Controller 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编程指南。
MSMessage​Template​Layout
The MSMessage​Template​Layout 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.
MSMessage​Template​Layout描述如何在脚本中显示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.
用于“消息”应用的贴纸。贴纸可以作为新消息发送或附加到抄本中的现有气球。
MSSticker​Browser​View
Use the MSSticker​Browser​View 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.
使用MSSticker​Browser​View类显示动态生成的贴纸列表。浏览器提供拖放功能。用户可以按住标签将其从浏览器中剥离,然后将贴纸拖放到抄本中的任何气球。用户还可以点击贴纸将其添加到消息应用的输入字段。
MSSticker​Browser​View​Controller
Use the MSSticker​Browser​View​Controller 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浏览器视图控制器来呈现标准贴纸浏览器。此浏览器提供拖放功能。用户可以按住标签将其从浏览器中剥离,然后将贴纸拖放到抄本中的任何气球。用户还可以点击贴纸将其添加到消息应用的输入字段。
MSSticker​View
Use the MSSticker​View 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类显示贴纸对象。贴纸视图还提供了拖放功能。用户可以按住标签将其从视图中剥离出来,然后将标签拖放到抄本中的任何气球。
MSSticker​Browser​View​Data​Source
Implement the MSSticker​Browser​View​Data​Source 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


0 0
原创粉丝点击