I am trying to add Sign in With Apple to my SwiftUI app with Firebase Authentication and am getting an error with the provided sha256() function. I have referenced many articles and videos and have not come across this error anywhere else:
“Argument type ‘String.UTF8View’ does not conform to expected type ‘Decoder’
I am using XCode version 14.3.1 with iOS Minimum Deployment 16.1 selected.
This is the function provided by Firebase from here:
private func sha256(_ input: String) -> String {
let inputData = Data(input.utf8)
let hashedData = SHA256.hash(data: inputData)
let hashString = hashedData.compactMap {
return String(format: "%02x", $0)
}.joined()
return hashString
}
let inputData = (Data.input.utf8) is throwing the error.
Any help is appreciated




