Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

187
Views
Ambiguous reference to member async execute in completion block AWS S3 Swift 3

While trying to use the AWSTransferutility to upload photos with Swift, I get this error. Ambiguous reference to member async(execute:) I searched similar questions but didn't find solution.

func uploadS3Background (dict: NSMutableDictionary) {

    let  transferUtility = AWSS3TransferUtility.default()
    let expression = AWSS3TransferUtilityUploadExpression()
    
    
    let completionHandler = { (task, error) -> Void in
        
        DispatchQueue.main.async(execute: {
            
        })
    }
    
    transferUtility.uploadFile(URL(fileURLWithPath: dict.object(forKey: "url") as! String),
    bucket: "bucketname/images",
    key: (dict.object(forKey: "filename") as! String),
    contentType: "image/png",
    expression: expression,
    completionHandler).continueWith { (task) -> AnyObject! in
        
        if let error = task.error
        {
            print("Error: \(error.localizedDescription)")
        }
            
        if let _ = task.result
        {
            // Do something with uploadTask.
        }
        
        return nil;
    }
}

Outside of a completion block I don't get the error for dispatching on the main queue.

enter image description here

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Declare this in your view controller -

var completionHandler: AWSS3TransferUtilityUploadCompletionHandlerBlock?

and then use

self.completionHandler = { (task, error) -> Void in
            DispatchQueue.main.async(execute: {

      })
}
about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!