Learn Courses My Dashboard

How can I access the functions from my other swift files?

Hi there, I’ve only been learning swift for 3 weeks and today, I came across the error "value of type ‘()’ has no member ‘()’ "

I have searched the internet and there are several answers. However, I don’t understand their explanation. I’m hoping someone can give me a straight-to-the-point and simple answer. Thank you!

What is the code that is triggering this error. It’s kinda hard to diagnose a problem without seeing the cause.

Hi @roosterboy

I currently have an app that records audio. When the user records an audio, they can choose to either delete the file or sync it to this particular server.

Now, I’m trying to automate the syncing. I added an option for “auto-sync” on the settings. If this is enabled, when the user finishes recording, it automatically gets synced to the server.

Now, I have file_1.swift → which deals with startRecording, stopRecording and saving the file || and file_2.swift which deals with the syncing and deleting options.

I tried to create the autosync function in file_2.swift which requires the use of some functions from file_1.swift e.g., stopRecording but it would show me this:

I supposed automating this isn’t hard since I already have the functions needed to sync the file to the server. However, I’m having a hard time putting the puzzle together.

I’m very keen on finishing this and if someone can help me asap.

Please refer to your other post in relation to offering payment for services. We don’t allow that on this community so any help offered by responders to your question would be on the basis of just helping you out in the spirit of it being a community.

I’m really sorry I wasn’t aware!