You can't directly "edit the text" in the Word document. A .docx
file is actually a ZIP file with a certain file/folder structure inside (try to rename it to .zip
& extract it and you'll see), which conforms to the "Office Open XML" format (https://en.wikipedia.org/wiki/Office_Open_XML).
If there are no libraries to modify the Office OpenXML format in Swift, you may just have to resort to writing the code yourself. However, if you have simple requirements (just some plain text, as you state), this shouldn't be too complicated.
Microsoft has an OpenXML library in GitHub at https://github.com/OfficeDev/Open-XML-SDK which may be of help to you.