如何使用XlsxReaderWriter在iOS中的Excel文件中添加超链接

如何使用XlsxReaderWriter在iOS中的Excel文件中添加超链接,ios,swift,excel,hyperlink,Ios,Swift,Excel,Hyperlink,我使用XlsxReaderWriter库生成Excel文件。一切都很正常,但当我用“link”属性设置属性字符串时,它就不起作用了。链接不适用于文本 Github链接: 它可以使用以下代码正常工作: let documentPath:String = Bundle.main.path(forResource: "demo1", ofType: "xlsx")! let spreadsheet: BRAOfficeDocumentPackage = BRAOfficeDocumentPackag

我使用XlsxReaderWriter库生成Excel文件。一切都很正常,但当我用“link”属性设置属性字符串时,它就不起作用了。链接不适用于文本

Github链接:

它可以使用以下代码正常工作:

let documentPath:String = Bundle.main.path(forResource: "demo1", ofType: "xlsx")!
let spreadsheet: BRAOfficeDocumentPackage = BRAOfficeDocumentPackage.open(documentPath)
let fooWorkSheet: BRAWorksheet = spreadsheet.workbook.worksheets[0] as! BRAWorksheet
let title = NSMutableAttributedString(string: "Title", attributes: [
                                                .font: FONT_BOLD(30),
                                                .foregroundColor: UIColor.red
                                                ])
fooWorkSheet.cell(forCellReference: "Title", shouldCreate: true)?.setAttributedStringValue(title)
但它不能使用以下代码:

let documentPath:String = Bundle.main.path(forResource: "demo1", ofType: "xlsx")!
let spreadsheet: BRAOfficeDocumentPackage = BRAOfficeDocumentPackage.open(documentPath)
let fooWorkSheet: BRAWorksheet = spreadsheet.workbook.worksheets[0] as! BRAWorksheet
let title = NSMutableAttributedString(string: "Title", attributes: [
                            .foregroundColor: UIColor.blue,
                            .link: "http://www.google.com"
                        ])
fooWorkSheet.cell(forCellReference: "Title", shouldCreate: true)?.setAttributedStringValue(title)

所以有人请帮帮我

当你说它不起作用时,会发生什么?你期望会发生什么?是否有任何错误消息?当我更改字体、字体大小和颜色时,属性字符串可以正常工作,但当我应用“.link”属性时,我得到的excel工作表中不会出现任何问题。没有错误消息,但链接不适用于文本。当您说它不工作时,会发生什么,您预计会发生什么?是否有任何错误消息?当我更改字体、字体大小和颜色时,属性字符串可以正常工作,但当我应用“.link”属性时,我得到的excel工作表中不会出现任何问题。没有错误消息,但链接未应用于文本。