Help with an issue relating to callbacks and @escaping?

I’m pretty much a beginner and I’ve gotten a little out of my depth. At this point I’ve learned the fundamentals and the only way to keep learning is just to start creating apps and tackle any new knowledge I need as I require it. Usually that approach works okay for me, but this time I’m stumped.

I’m trying to make a simple audiobook conversion app for MacOS using FFmpeg. There were two options for incorporating FFmpeg into XCode, both of which are more advanced than I’m probably ready for.

The first approach, found here, is probably better suited for what I’m trying to do, but the sample scripts are intimidating. The variables he’s using are meaningless for me but all his files are so intertwined that I can’t figure out if I can make it work for me.

This is a much simpler approach, and I understand exactly what it’s doing up until we get to the point of dealing with the @escaping and callback parts. Perhaps it’s because it’s written for an older version of Xcode and Swift, I don’t know.

func filterVideo(inputFilePath: String, outputFilePath: String,
             filterPath: String, callback: @escaping (Bool) -> Void)

When I try to call the function in the IBAction method for my “start encoding” button, I get the following error:

@escaping attribute may only be used in function parameter position

It suggests I delete @escaping to fix the problem, but when I do that, I get other errors relating to the (Bool) -> Void part of the parameter, and because I don’t understand what the callback is doing, I don’t know how to fix it. I’ve spent the last several days trying to learn about callbacks but it’s just going over my head. It’s several steps beyond where I am in my learning, I think, but I can’t proceed without knowing.

What is this code doing and how to I work with it to make it work for me?

@ncrusher Do you still have issues with this?

No, I ended up going in another direction with it. Sorry, I’m unable to delete my threads, so I should have posted that I didn’t need help anymore. Thank you.

Hi @ncrusher,
No worries, I will close this thread as you do not require any more help on this.

cheers,