I do use URLsession. From what I could find with research online and even checking with ChatGPT for more specific questions on the topics that seemed to be what I needed to allow the app to connect to a website and use URL links to download docx files for the app.
The problem that I am seeing is I am not sure if I am using the URLsession correctly or if there are additional steps I need to take when it comes to accessing this Documents Directory that is on the mobile device itself to access the documents.
From my own testing when Io run the app I try checking documents on the mobile device but nothing looks to update so my guess is I am not using the URLsession function correctly.
I am a beginner still with using swift and Xcode so I am trying to learn as much as I can for working on this project.
My Project is setup with multiple .view scripts to handle different parts of the app itself.
They are setup as follows:
ContentView
This script is used for viewing the app itself where I have buttons displayed that swap between different lists that could be viewed and searched through using the searchable modifier.
This function works correctly and I can change the lists by pressing the buttons just fine.
The listed data comes from txt files in the project as test data to work with.
FileUpdater
This file would be used to download the docx files from the URL links when the device is connected to a specific wifi network that I have listed and set to check for the needed connection. I also have the URL links as well.
This should also download the files to save locally.
FileLoader
This script is supposed to take the docx data that was downloaded and upload it to the txt files by conversion and writing the data and this whole process is a type of online update system. So when the online docx are modified the list will stay up to date with the new information when I use the app to search through.
FileInitializer
This script is a singe run that is used to copy the bundle txt files to the document directory on the first launch of the app. This should help with the data conversion being done in my other scripts as mentioned.
The final two scripts are as follows:
HighlightHelper
SearchTextChangeHandler
These are small scripts used to help with the basic search functionality when using the application.
I am sorry if this is adding too much information or detail but I hope this helps understand what I am trying to create with this project.