First off, I'm learning Swift still while working on my project and am not very good yet.
I'm trying to pass the "result" variable from a func call to another function with some of my parameters...
I'm also working with AWS's Amplify as you'll see here but that part is a bit irrelevant.
The code before is like this...
Amplify.API.get (request:request)
{
result in switch result
What I would like to do is to pass that result to a func along with some other parameters.. Such as..
Amplify.API.get (request:request)
{
myFunction(result, myParam1, myParam2)
}
But Swift does things different than I'm used to with Objective-C.
The definition for Amplify.API.get is...
Amplify.API.get(request: RESTRequest, listener:((AmplifyOperation<RESTOperationRequest, Data, APIError>.OperationResult) -> Void)
How do I setup my func so that it will take in what the get function is sending and handle it? Something like...
func handleGet (request: RESTRequest, listener:((AmplifyOperation<RESTOperationRequest, Data, APIError>.OperationResult) -> Void, myParam1, myParam2)
But then I don't know how to pass that to the get or call it within the code block?