Hi. I am using this library in swift 4 and xcode 8.3.3. My problem is I have to cast almost everything and this is a problem because I can not save my changes to the file. The values returned are not same as the ones in the objective-C function bodies.
for example
file = BRAOfficeDocumentPackage.open(filePath)!
let worksheet: BRAWorkshhet = file.workbook.worksheets[0] //this is supposed to return a BRAWorksheet. But not for me. It returns Any for me. So the line does not compile and gives me this "can not assign value of type Any to BRAWorksheet"
So I have to cast it now
let worksheet = file.workbook.worksheets[0] as! BRAWorksheet
This is fine for reading from files. But writing becomes a problem because the worksheet returned by casting is a COPY of the one in the workbook, not the original reference. so when I file.save(), nothing is saved to the file.
I have a feeling that I have done something wrong with importing the framework, though I followed what was written in the guide step by step, except I used cocoa pods.
Can Anyone tell me the problem here?? thanks
Hi. I am using this library in swift 4 and xcode 8.3.3. My problem is I have to cast almost everything and this is a problem because I can not save my changes to the file. The values returned are not same as the ones in the objective-C function bodies.
for example
So I have to cast it now
let worksheet = file.workbook.worksheets[0] as! BRAWorksheet
This is fine for reading from files. But writing becomes a problem because the worksheet returned by casting is a COPY of the one in the workbook, not the original reference. so when Ifile.save()
, nothing is saved to the file. I have a feeling that I have done something wrong with importing the framework, though I followed what was written in the guide step by step, except I used cocoa pods. Can Anyone tell me the problem here?? thanks