簡單地說,資料庫不適合拿來塞圖片。
在 AWS 解決方案中,經常會使用 S3 作為圖床。
pod 'AmplifyPlugins/AWSS3StoragePlugin'
pod install --repo-update
import AWSS3StoragePlugin
...
func configureAmplify() {
do {
try Amplify.add(plugin: AWSCognitoAuthPlugin())
let models = AmplifyModels()
try Amplify.add(plugin: AWSAPIPlugin(modelRegistration: models))
try Amplify.add(plugin: AWSDataStorePlugin(modelRegistration: models))
try Amplify.add(plugin: AWSS3StoragePlugin())
try Amplify.configure()
print("The Amplify configured with Auth and Storage plugins!")
} catch {
print(error)
}
}
坑坑坑
... 待補充