2

好的,我到处找,找不到一个关于这个的帖子。我正在构建一个 iMessage 扩展应用程序,我需要知道 IF 以及如何以编程方式清除 iMessage 文本输入字段。不一定要编辑内容,只需删除已放在那里的所有文字/贴纸。

我的意思是一旦发送消息就不会:

在此处输入图像描述

我知道我们拥有所有这些,我使用最后两个来查看贴纸是否已发送或已在输入字段中取消。

override func willBecomeActive(with conversation: MSConversation) {
        // Called when the extension is about to move from the inactive to active state.
        // This will happen when the extension is about to present UI.

        // Use this method to configure the extension and restore previously stored state.
    }

    override func didResignActive(with conversation: MSConversation) {
        // Called when the extension is about to move from the active to inactive state.
        // This will happen when the user dissmises the extension, changes to a different
        // conversation or quits Messages.

        // Use this method to release shared resources, save user data, invalidate timers,
        // and store enough state information to restore your extension to its current state
        // in case it is terminated later.
    }

    override func didReceive(_ message: MSMessage, conversation: MSConversation) {
        // Called when a message arrives that was generated by another instance of this
        // extension on a remote device.

        // Use this method to trigger UI updates in response to the message.
    }

    override func didStartSending(_ message: MSMessage, conversation: MSConversation) {
        // Called when the user taps the send button.
        print("sent icon")
    }

    override func didCancelSending(_ message: MSMessage, conversation: MSConversation) {
        // Called when the user deletes the message without sending it.

        // Use this to clean up state related to the deleted message.
        print("nope, icon not sent")
    }

我怎么能这样做,或任何类似的东西?

4

0 回答 0