Swift 带AlternateFileName的InsertAttachment在iOS 10中不起作用

Swift 带AlternateFileName的InsertAttachment在iOS 10中不起作用,swift,swift3,ios10,imessage,ios-messages-extension,Swift,Swift3,Ios10,Imessage,Ios Messages Extension,根据文件: @method insertAttachment:withAlternateFilename:completionHandler: @abstract The NSURL instance provided in the URL parameter is inserted into the Messages.app input field. This must be a file URL. @param URL The URL to

根据文件:

@method     insertAttachment:withAlternateFilename:completionHandler:
@abstract   The NSURL instance provided in the URL parameter is inserted into the Messages.app
input field. This must be a file URL.
@param      URL                The URL to the media file to be inserted.
@param      filename           If you supply a string here, the message UI uses it for the attachment. Use an alternate filename to better describe the attachment or to make the name more readable.
@param      completionHandler  A completion handler called when the insert is complete.
 */
open func insertAttachment(_ URL: URL, withAlternateFilename filename: String?, completionHandler: (@escaping (Error?) -> Swift.Void)? = nil)
上面写着什么

文件名-->如果在此处提供字符串,则消息UI会将其用于 附件。使用备用文件名更好地描述 附件或以使名称更具可读性

我的代码是:

if let conversation = activeConversation {
    conversation.insertAttachment(fileURL, withAlternateFilename: "This is file Description.", completionHandler: nil)
}
但它并没有显示在短信应用程序的任何地方

我在这里发送视频文件

我想在用户单击消息时在导航栏标题上显示该说明,如果可能的话,也可以在MSMessage下面显示。

根据最新文档,请尝试 func addAttachmentURL_uAttachmentUrl:NSURL, 是否使用alternateFilename alternateFilename:String?->布尔

根据最新文档,请尝试 func addAttachmentURL_uAttachmentUrl:NSURL, 是否使用alternateFilename alternateFilename:String?->布尔


从WWWDC 2020开始,我认为这是通过Xcode 12或iOS 14修复的,因为我在Xcode 11中看到了它,但我的更新版本工作。

从WWWDC 2020开始,我认为这是通过Xcode 12或iOS 14修复的,因为我在Xcode 11中看到了它,但我的更新版本工作。

在设置替代文件名时尝试指定文件扩展名,例如:这是文件Description.pngThanks以获取注释,但它没有帮助@阿齐莫夫:你有没有想过?我遇到了同样的问题!2019年,仍然是一个bug。这个Swift版本已经坏了。此版本的objective-C正如预期的那样工作。必须导入Objective-C.h和.m文件,并为Swift项目提供桥接头。效果很好,文件名正确。在设置备用文件名时,请尝试指定文件的扩展名,例如:这是file Description.pngThanks以获取注释,但它没有帮助@阿齐莫夫:你有没有想过?我遇到了同样的问题!2019年,仍然是一个bug。这个Swift版本已经坏了。此版本的objective-C正如预期的那样工作。必须导入Objective-C.h和.m文件,并为Swift项目提供桥接头。很好,文件名正确。仅供参考:这不仅仅是错误的类文档,这是错误的框架,如果您想知道为什么会有这么多的否决票,这是我的猜测。仅供参考:这不仅仅是错误的类文档,这是错误的框架,如果您想知道为什么会有这么多否决票,这是我的猜测。