I was working in Xcode 9. Code was working fine but when I used same code in Xcode 10 then I am getting compile time error.
This is the error:
1. While emitting SIL for 'fetchConsumerRecommendations(completionHandler:failureHandler:)' at /Users/shahezad/Desktop/Newcode/foodkonnectconsumer-ios/Food/FirebaseManager.swift:2578:5
2. While silgen emitFunction SIL function "@$S4Food15FirebaseManagerC28fetchConsumerRecommendations17completionHandler07failureH0yySaySSGc_ys5Error_pSgctFZ".
for 'fetchConsumerRecommendations(completionHandler:failureHandler:)' at /Users/shahezad/Desktop/Newcode/foodkonnectconsumer-ios/Food/FirebaseManager.swift:2578:5
3. While silgen closureexpr SIL function "@$S4Food15FirebaseManagerC28fetchConsumerRecommendations17completionHandler07failureH0yySaySSGc_ys5Error_pSgctFZySo19FIRDocumentSnapshotCSg_AItcfU_".
for expression at [/Users/shahezad/Desktop/Newcode/foodkonnectconsumer-ios/Food/FirebaseManager.swift:2584:285 - line:2615:9] RangeText="{ (documentSnapshot, error) in
if error == nil {
if (documentSnapshot?.exists)!{
print("Consumer Recommendations - \(describing: documentSnapshot?.data())")
let dictOnboarding:NSDictionary = (documentSnapshot?.data())! as NSDictionary
print("\(dictOnboarding.allKeys)")
completionHandler(dictOnboarding.allKeys as! [String])
}
else{
completionHandler([])
}
}
else{
failureHandler(error)
}
}"
error: Segmentation fault: 11
I am not able to figure out what this the problem with code.