That is the code I used to avoid wasting my picture into firestore however I acquired this error
Thread 1: “Unsupported sort: __SwiftValue (present in discipline profileImage)”
How I rewrite this code to create a photograph url and to reserve it into Firestore
PhotosPicker(
choice: $selectedItem,
matching: .photos,
photoLibrary: .shared()
) {
}
Button{
AddFirebase()
}label: {
Textual content("Save")
.foregroundColor(.crimson)
.font(.largeTitle)
.fontWeight(.daring)
}
}
}
func AddFirebase() {
let db = Firestore.firestore()
db.assortment("consumer").doc("username").setData(["username" : name, "bio": profileText, "profileImage" : $selectedItem ])
return
}