How do you upload a FIle Object Synchronously? - API EX. Not working - IOS SWIFT

Any help would be appreciated, I have obviously looked over the API and tried a few examples of getting file upload to work, and I have gotten the asynchronous method to work, however I need to use the Synchronous method for my app. When I looked at the API for the synchronous method all was well, but when I tried to implement it i got errors in xCode.
Error: Expected member name following ‘.’
Edit: Line 1 is where the error in xCode occurs
Code:

Types.try({ () -> Void in 
var data = NSData(bytes:"Hello mbaas!\nUploading files is easy!", length:37) 
var uploadedFile = self.backendless.fileService.upload("myfiles/myhelloworld-sync.txt", content: data) 
print("File has been uploaded. File URL is - \(uploadedFile.fileURL)") }, 
catch: { (exception) -> Void in 
print("Server reported an error: \(exception as Fault)")
} )

See the comments in another threads: here & here, please.