Use AWS SDK
For advanced use cases where Amplify does not provide the functionality, you can retrieve the escape hatch to access the AWSS3 instance.
Add the following imports:
import AWSS3StoragePlugin // Imports the Amplify plugin interfaceimport AWSS3 // Imports the AWSS3 client escape hatch
import AmplifyPlugins // Imports the Amplify plugin interfaceimport AWSS3 // Imports the AWSS3 client escape hatch
Then retrieve the escape hatch with this code
func getEscapeHatch() { do { let plugin = try Amplify.Storage.getPlugin(for: "awsS3StoragePlugin") as! AWSS3StoragePlugin let awsS3 = plugin.getEscapeHatch() } catch { print("Get escape hatch failed with error - \(error)") }}